This the multi-page printable view of this section.Click here to print.

Return to the regular view of this page.

Math

Optimising mathematics

Table of Contents

Basic Arithmetic

A=-B

A simple one, we want to set A to be -B.

The logical way is to load A with B then negate it:

78LDA,BSet A to B
ED44NEGNegate A to get A=-B

But a quicker and shorter way is:

AFXORAA=0
90SUBBA=0-B = -B