arm - How to load register with predefined bytes in Assembly -
using arm assembly, want load r0 predefined bytes a, b, c, d. in .data
section have them defined as:
a: .byte 0xff b: .byte 0xaa c: .byte 0x88 d: .byte 0x77
i want r0 ffaa8877
when said , done. not sure should using .byte
or .word
or else a, b, c, d.
edit: here i'm trying r0:
@on entry: r0 holds word swapped @on exit: r0 holds swapped word, r1 destroyed @r0 = a, b, c, d byteswap: eor r1, r0, r0, ror #16 bic r1, r1, #0xff0000 mov r0, r0, ror #8 eor r0, r0, r1, lsr #8
here shortcut.
ldr r0,=0xffaa8877
or can same thing manually...
ldr r0,my_number ... my_number: .word 0xffaa8877
Comments
Post a Comment