Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- AREA upc, CODE, READONLY
- ENTRY
- Start ADR r0, UPC-48 ;register r0 points to the upc string
- MOV r1, #6 ;Initializing the loop counter to 12
- MOV r2, #0 ;clearing the sum in r2
- MOV r3, #0 ;clearing r3 for the sum
- Loop LDRB r4,[r0]
- ADD r0,r0, #4 ; point to the next element
- ADD r2, r2, r4 ;add the evens
- ADD r0,r0, #4
- ADD r3,r3, r4 ; add the odds
- BNE Loop
- ;MUL r2,r2,#3
- ADD r5,r2,r3
- SUB r5, r5, #1
- UPC DCB "013800150738" ; upc string
- END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement