Renesas Technology, Tools FAQs
Last Updated: February 4, 2000
Document Number: 01051085_e
Q.
When I describe "LDI R0,#H'80", value H'80 is assumed to be an 8-bit immediate and a sign extended value H'FFFFFF80 is loaded
to register R0. On the other hand, if the value is assumed to be 16-bit immediate, non-sign extended value H'00000080 is loaded.
In which way does the assembler translate this description?
A.
LDI instruction can specify the sign extension. The range of the 8-bit sign immediate is -H'80~0~H'7F. Therefore, H'80 is not within
the range and the extension is assumed to be 16 bits.
The following list shows typical assembler expressions and the values to be loaded to R0 for execution.
Instruction code Assembler expression R0 load value
.....
90F0FF00 LDI R0,#-H'100 0xFFFFFF00
90F0FF01 LDI R0,#-H'FF 0xFFFFFF01
.....
90F0FF7F LDI R0,#-H'81 0xFFFFFF7F
6080 LDI R0,#-H'80 0xFFFFFF80
.....
60FF LDI R0,#-H'01 0xFFFFFFFF
6000 LDI R0,#0 0
6001 LDI R0,#H'01 0x00000001
.....
607F LDI R0,#H'7F 0x0000007F
90F00080 LDI R0,#H'80 0x00000080
.....
90F000FF LDI R0,#H'FF 0x000000FF
90F00100 LDI R0,#H'100 0x00000100
.....
Top of Page | Back to Previous Page
Terms of Use Privacy Policy
(C)2004 Renesas Technology Corp., All Rights Reserved.
Kommentare zu diesen Handbüchern