HLASM Language Reference

HLASM Language Reference HLASM Language Reference

faculty.cs.niu.edu
from faculty.cs.niu.edu More from this publisher
22.02.2015 Views

Examples of Coded Machine Instructions where: 18 is the operation code 1 is register R 2 is register R RS Format The operand fields of RS-format instructions designate two registers, and a virtual storage address (coded as an implicit address or an explicit address). ┌────────┬────┬────┬────┬────────────┐ │Op Code │ R │ R │ B │ D │ └────────┴────┴────┴────┴────────────┘ 8 12 16 2 31 In the Insert Characters under Mask (ICM) and the Store Characters under Mask (STCM) instructions, a 4-bit mask (see X'E' and MASK in the instructions labeled DELTA1 and DELTA2 below), with a value between 0 and 15, replaces the second register specifications. ┌────────┬────┬────┬────┬────────────┐ │Op Code │ R │ M │ B │ D │ └────────┴────┴────┴────┴────────────┘ 8 12 16 2 31 Symbols used to represent registers (see REG4, REG6, and BASE in the instruction labeled ALPHA2 below) are assumed to be equated to absolute values between 0 and 15. Symbols used to represent implicit addresses (see AREA and IMPLICIT in the instructions labeled BETA1 and DELTA2 below) can be either relocatable or absolute. Symbols used to represent displacements (see DISPL in the instruction labeled BETA2 below) in explicit addresses are assumed to be equated to absolute values between 0 and 4095. Examples: ALPHA1 LM 4,6,2(12) ALPHA2 LM REG4,REG6,2(BASE) BETA1 STM 4,6,AREA BETA2 STM 4,6,DISPL(BASE) GAMMA1 SLL 2,15 DELTA1 ICM 3,X'E',124(1) DELTA2 ICM REG3,MASK,IMPLICIT When assembled, the object code for the instruction labeled ALPHA1, in hexadecimal, is: 9846C14 where: 98 is the operation code 4 is register R 6 is register R C is base register B 14 is displacement D from base register B 94 HLASM V1R5 Language Reference

Examples of Coded Machine Instructions When assembled, the object code for the instruction labeled DELTA1, in hexadecimal, is: BF3EA4 where: BF is the operation code 3 is register R E is mask M A is base register B 4 is displacement D from base register B RSI Format The operand fields of RSI-format instructions designate two registers and a 16-bit immediate operand. ┌────────┬────┬────┬─────────────────┐ │Op Code │ R │ R │ I │ └────────┴────┴────┴─────────────────┘ 8 12 16 31 Symbols used to represent registers (See REG1 below) are assumed to be equated to absolute values between 0 and 15. The immediate value is treated as a signed binary integer representing the number of halfwords to branch relative to the current location. The branch target may be specified as a label in which case the assembler calculates the immediate value and performs some checking of the value. The branch target may also be specified as an absolute value in which case the assembler issues a warning before it assembles the instruction. Examples: ALPHA1 BRXH REG1,REG3,BETA1 BETA1 BRXLE 1,2,ALPHA1 When assembled, the object code for the instruction labeled ALPHA1, in hexadecimal, is 84132 where: 84 is the operation code 1 is register REG1 3 is register REG3 2 is the immediate data I2 RX Format The operand fields of RX-format instructions designate one or two registers, including an index register, and a virtual storage address (coded as an implicit address or an explicit address), with the following exception: In BC branching instructions, a 4-bit branching mask (see 7 and TEN in the instructions labeled LAMBDAn below) with a value between 0 and 15, replaces the first register specification. Chapter 4. Machine Instruction Statements 95

Examples of Coded Machine Instructions<br />

When assembled, the object code for the instruction labeled DELTA1, in<br />

hexadecimal, is:<br />

BF3EA4<br />

where:<br />

BF is the operation code<br />

3 is register R<br />

E is mask M<br />

A is base register B<br />

4 is displacement D from base register B<br />

RSI Format<br />

The operand fields of RSI-format instructions designate two registers and a 16-bit<br />

immediate operand.<br />

┌────────┬────┬────┬─────────────────┐<br />

│Op Code │ R │ R │ I │<br />

└────────┴────┴────┴─────────────────┘<br />

8 12 16 31<br />

Symbols used to represent registers (See REG1 below) are assumed to be<br />

equated to absolute values between 0 and 15.<br />

The immediate value is treated as a signed binary integer representing the number<br />

of halfwords to branch relative to the current location.<br />

The branch target may be specified as a label in which case the assembler<br />

calculates the immediate value and performs some checking of the value.<br />

The branch target may also be specified as an absolute value in which case the<br />

assembler issues a warning before it assembles the instruction.<br />

Examples:<br />

ALPHA1 BRXH REG1,REG3,BETA1<br />

BETA1 BRXLE 1,2,ALPHA1<br />

When assembled, the object code for the instruction labeled ALPHA1, in<br />

hexadecimal, is<br />

84132<br />

where:<br />

84 is the operation code<br />

1 is register REG1<br />

3 is register REG3<br />

2 is the immediate data I2<br />

RX Format<br />

The operand fields of RX-format instructions designate one or two registers,<br />

including an index register, and a virtual storage address (coded as an implicit<br />

address or an explicit address), with the following exception:<br />

In BC branching instructions, a 4-bit branching mask (see 7 and TEN in the<br />

instructions labeled LAMBDAn below) with a value between 0 and 15,<br />

replaces the first register specification.<br />

Chapter 4. Machine Instruction Statements 95

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!