This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: Address Contents 0x00008218 0x92 0x00008219 0x01 0x0000821A 0x85 0x0000802B 0x0000802C 0x00008217 0x0A 0xC5 0x4F Example #3 Consider the following example which operates on the NULL terminated string pointed to by the label string Which of the following best describes what the program does? Sorts the characters in the string Converts all lowercase characters to upper case and vice versa Eliminates all occurrences of the character held in r0 in the string Terminates the string at the first occurrence of the character held in r0 Counts the number of occurrences of the character held in r0 ldr r1, =string ; r1 = orig strng ldr r2, =string ; r2 = new strng next ldrb r3, [r1], #1 ; r3 = character cmp r3, #0 ; End of string? beq done cmp r0, r3 beq next strb r3, [r2], #1 b next done strb r3, [r2], #1 ; Save NULL...
View Full Document
- Spring '11
- ASCII, null character, CMP r3, ldrb r3