5. Hawk Short Immediate Instructions

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

Contents

5.1. Format
5.2. Load Immediate


 

5.1. Format

Short Immediate Format

 _______________________________
|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|
|15   12|11    8|7     4|3     0|
|1 1 0  |  dst  |     const     |
The short immediate format instructions are 16 bits each, incorporating an 8 bit constant.

 

5.2. Load Immediate

 1 1 0 1                          LIS   r[dst] = sxt(const)
 1 1 0 0                          ORIS  r[dst] = (r[dst]<<8)|pad(const)
The LIS, load immediate short, instruction loads the destination register with the sign extended 8 bit constant. The ORIS instruction shifts the destination register 8 places left and then loads the 8 bit constant into the least significant 8 bits of the register. Neither instruction sets the condition codes.

Hawk assemblers should provide the mnemonic CLR to load zero in a register, equivalent to LIS with a constant of zero.

The following sequence of instructions will load the 32 bit constant X into R1; the LIW (load immediate word) macro is normally used to generate this sequence:

        LIL  R1, X >> 8
        ORIS R1, X & #FF