Delta AH500 — 6.2.2 Explanation of Arithmetic Instructions

Chapter 6 Applied Instructions API 0109 Symbol: S 1 : Minuend Word/Double word S 2 : SubtrAH500end Word/Double word D : Difference Word/Double word Explanation: 1. The binary-coded decimal value in S 2 is subtracted from the binary-coded decimal value in S 1 , and the difference is stored in D . 2. Only the instruction DB- can use the 32-bit counter. 3. The binary-coded decimal value is represented by the hexadecimal number, and every digit is within the range between 0 and 9. 4. The subtraction of 16-bit binary-coded decimal values:

 When the binary-coded decimal values in S 1 and S 2 are 9999 and 9998 respectively, S 1 minus S 2 leaves the binary-coded decimal value 0001, and 0001 is stored in D .  When the binary-coded decimal values in S 1 and S 2 are 0001 and 9999 respectively, S 1 minus S 2 leaves the binary-coded decimal value -9998, and the binary-coded decimal value 0002 is stored in D .  When the binary-coded decimal values in S 1 and S 2 are 0001 and 0004 respectively, S 1 minus S 2 leaves the binary-coded decimal value -0003, and the binary-coded decimal value 9997 is stored in D . 5. The subtraction of 32-bit binary-coded decimal values:

 When the binary-coded decimal values in S 1 and S 2 are 99999999 and 99999998 respectively, S 1 minus S 2 leaves the binary-coded decimal value 00000001, and 00000001 is stored in D .  When the binary-coded decimal values in S 1 and S 2 are 00000001 and 99999999 respectively, S 1 minus S 2 leaves the binary-coded decimal value -99999998, and the binary-coded decimal value 00000002 is stored in D .  When the binary-coded decimal values in S 1 and S 2 are 00000001 and 00000004 respectively, S 1 minus S 2 leaves the binary-coded decimal value -00000003, and the binary-coded decimal value 99999997 is stored in D .

6-55 Instruction code Operand Function D B- P S , S , D 1 2 Subtraction of binary-coded decimal numbers Device X Y M S T C HC D L SM SR E PR K 16# “$” DF S 1             S 2             D           Pulse instruction 16-bit instruction (7 steps) 32-bit instruction (7 steps) AH500 AH500 AH500