4. Long Immediate Instructions
Part of
the Hawk Manual
|
4.1. Long Immediate Format
4.2. Load Immediate Long
07 | 06 | 05 | 04 | 03 | 02 | 01 | 00 | 15 | 14 | 13 | 12 | 11 | 10 | 09 | 08 | |
1 1 1 0 | dst | const:7:0 |
15 | 14 | 13 | 12 | 11 | 10 | 09 | 08 | 07 | 06 | 05 | 04 | 03 | 02 | 01 | 00 |
const:23:8 |
Long-immediate instructions occupy 32 bits and are not supported on the Sparrowhawk (see Chapter 16).
There is only one instruciton in this group, LIL. This instruction consists of two consecutive halfwords or four bytes. The first byte gives the destination register r[dst] while the remaining bytes are a 24-bit constant.
07 | 06 | 05 | 04 | 03 | 02 | 01 | 00 | 15 | 14 | 13 | 12 | 11 | 10 | 09 | 08 | ||||||
1 1 1 0 | dst (pc) | const:7:0 | LIL | dst,const | r[dst] = sx(const) |
LIL | NZVC unchanged | ||
LIL (load immediate long) sets r[dst] to a 24-bit sign-extended constant (see Section 1.5). The low 8 bits of the constant come from the const field of the instruction register, while the high 16 bits come from the halfword that immediately follows. The following examples load r[5] with the largest possible positive integer that LIL permits; any larger values will be interpreted as being negative because of sign extension:
LIL R5,#7FFFFF LIL R5,8388607
LIL R0,const or equivalently LIL PC,const sets the program counter to the sign extended constant. This is useful as a way to branch or jump to any location in the bottom 8 megabytes of memory (locations 0 through 7FFFFF16).