Sunday, December 20, 2020

64-bit Addition on four retro CPUs -- 6800, 6801, 6809, and 68000

The key to doing 64-bit addition and subtraction on a CPU without a native 64-bit add is finding and using some means of catching and using the carry/borrow from the less significant parts. Once you have that figured out, you're home free.

Well, except for the problem of where you get the numbers from and where you store the result. 

We can relieve ourselves of a lot of copying and other maintenance by using a stack for the parameters.