Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Start ADR r0, UPC ;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]
- SUBS r4,r4,#48
- ADD r2, r2, r4 ;add the odds
- ADD r0,r0, #1 ; point to the next element
- LDRB r4,[r0]
- SUBS r4,r4,#48
- ADD r3,r3, r4 ; add the evens
- SUBS r1,r1,#1
- BNE Loop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement