Mathematics



Ignoring Floating Point Arithmatic, there are two types which are used either explicitly or implicitly in high level commercial applications, and these are:

Decimal Arihmatic.

Used extensively in financial applications, and is performed on data held in memory.

Binary Arithmatic

This is used for array processing and address manipulation; and is performed on data held in Registers. Subscipting in COBOL or PLI is an implicit use of Binary Arithmatic.

Some Arithmatic instructions.


Decimal Arithmatic

Instruction

Description

AP

Add a number at one memory location to a number at another location.

DP

Divide a number at one memory location by a number at another location.

MP

Multiply a number at one memory location with a number at another location.

SP

Subtract a number at one memory location from a number at another location.

 

Binary Arithmatic

Instruction

Description

A, AH

Add the contents of a 4 or 2 byte memory location to the contents of a Register.

AR

Add the contents of two Registers.

D, DR

Divide the contents of a Register by the contents of a 4-byte memory location, or divide the contents of two registers.

M, MH

Multiply the contents of of a Register by the contents of a 4 or 2 byte memory location.

MR

Multiply the contents of two Registers.

S, SH

Subtract the contents of a 4 or 2 byte memory location from the contents of a Register.

SR

Subtract the contents of two Registers.

Copyright © Legac-e Education 2015-