SBWC

VAX11

 

SBWC SUBTRACT WITH CARRY

 

Purpose

perform extended-precision subtraction

Format

opcode sub.rl, dif.ml

Operation

dif ß dif - sub - C;

 

Condition codes

N ß dif LSS 0;

Z ß dif EQL 0;

V ß {integer overflow};

C ß {borrow from most significant bit};

Exceptions

Integer overflow

Opcodes

D9       SBWC Subtract with Carry

Description

The subtrahend operand and the contents of the condition code C bit are subtracted from the difference operand and the difference operand is replaced by the result.

Notes

1. On overflow, the difference operand is replaced by the low order bits of the true result.

2. The two subtractions in the operation are performed simultaneously.

 

 

Example 1

 

.text

 

main: .word 0

 

      movl $10, r1

      movl $3, r2

      sbwc r2, r1 # r1 is 7

 

      movl $10, r1

      movl $3, r2

      bispsw $1

      sbwc r2, r1 # r1 is 6

 

      pushl $0

      calls $1, .exit

 

 

Example 2

 

.text

 

main: .word 0

 

      movl $0x80000000, r1

      movl $1, r2

      sbwc r2, r1       # V = 1

 

      movl $0x80000001, r1

      movl $1, r2

      bispsw $1

      sbwc r2, r1 # V = 1

 

      pushl $0

      calls $1, .exit