KAL

Assembly Language

The following multiplies 2 by 3 and then adds 4:

ld ac,2

mul ac,3

add ac,4

In early computers, arithmetic was often performed in a part of the computer called the accumulator. In the code above, ac refers to the accumulator.

In the first line, 2 is loaded into the accumulator with ld ; then, in the second line, the accumulator is multipled by 3 with mul ; in the third line, 4 is added to the accumulator.


Send questions and comments to: Karen Lemone

What do these buttons mean?