4. Long Immediate Instructions

Part of the Hawk Manual
by Douglas W. Jones
THE UNIVERSITY OF IOWA Department of Computer Science

Contents

4.1. Long Immediate Format
4.2. Load Immediate Long


4.1. Long Immediate Format

07060504 03020100 15141312 11100908
1 1 1 0 dst const:7:0

15141312 11100908 07060504 03020100
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.

4.2. Load Immediate Long

07060504 03020100 15141312 11100908                        
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).