ADR R0, Value @ Get address of variable Value.R0:C123 LDRB R1, [R0] @ Load the low byte value of 16-bit variable Value.R1:23 ADR R2, Result @ Get address of variable Result.R2:0 STRB R1, [R2] @ Store the value to low byte position of variable Result.R1:20 LDRB R1, [R0,#1] @ Load the high byte value of 16-bit variable Value.R1:21 STRB R1, [R2,#1] @ Store the value to high byte position of variable Result. R1:21 R2:20 hold: BALstart @ Program end
Value: .word0xC123 @ Value to be moved .ALIGN @ Need to do this because working with 16bit value Result: .word0x0 @ Storage space .end 求R0.R1.R2 R0:0xC123 R1:0x21 R2:0x20