360 Assembly/360 Instructions/DR

< 360 Assembly < 360 Instructions

DR - Divide by Register - Opcode 1D

Format

DR 2,7

The specific syntax is

DR target register, source register.
RR Instruction (2 bytes)
Byte 1 Byte 2
target register source register
(8 bits)
Opcode
1D
(4 bits)

0..F
(4 bits)

0..F

Availability

The DR instruction is available on all models of the 360, 370 and z/System.

Operation

The DR instruction divides the dividend - 64-bit signed value stored in pair of registers T and T+1, where T is target register number (T shall contain most significant part and T+1 shall contain least significant part), by the divisor - 32-bit signed value in the source register. The target register number T shall be even. The instruction places quotient to register T and remainder to register T+1, both as 32-bit signed values.

The divisor shall not be zero. The quotient shall fit into limits of 32-bit signed value (-2147483648 till 2147483647).

The DR instruction performs so-called T-division when quotient is truncated to zero; the remainder sign is equal to the dividend sign, if both values are not equal to 0; in other words, (remainder * dividend >= 0).

The Condition Code field in the Program Status Word is not changed.

Exceptions and Faults

Example

Consider that register 4 contains 0, 5 - 13 and 11 - 4. The instruction "DR 4,11" will divide the contents of register 13 by 4, place the quotient (equals to 3) in register 4 and place the remainder (equals to 1) in register 5.

Previous Instruction
DP
360 Assembly Instructions
{{{name}}}
Next Instruction
DSG
Previous Opcode
1C
Next Opcode
1E
360 Assembly Language
360 Family Introduction · Basic FAQ · 360 Family · 360 Architecture
360 Instruction Set 360 Instructions · Branch Instructions · Data Transfer Instructions · Control Flow Instructions · Arithmetic Instructions · Logic Instructions · Shift and Rotate Instructions · Other Instructions
Syntaxes and Assemblers 360 Assemblers· Pseudo Instructions
Instruction Extensions Floating Point · High-Level Languages
This article is issued from Wikibooks. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.