Math

Optimising mathematics

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

Last modified November 16, 2021: Optimise optimisation pages (b7101cb)