32 bit math

By Bit Addict

Resident (34)

Bit Addict's picture

11-06-2016, 17:36

How to add and multiply two 32 bit numbers?

Login or register to post comments

By ARTRAG

Enlighted (6976)

ARTRAG's picture

12-06-2016, 00:27

look for a web page about z80 coding

By santiontanon

Paragon (1830)

santiontanon's picture

12-06-2016, 01:42

Exactly, for example: http://z80-heaven.wikidot.com/math

By popolony2k

Hero (544)

popolony2k's picture

12-06-2016, 17:49

If you want to have a "readable" idea about these math operations (ADD, SUB, MUL), check my BigInt implementation library. It supports 8, 16, 24, 32, 64 to infinite bits operation.

https://sourceforge.net/p/oldskooltech/code/HEAD/tree/msx/tr...

[]'s
PopolonY2k

By AxelStone

Prophet (3199)

AxelStone's picture

12-06-2016, 19:20

@popolony2k Really brilliant, and can be translated into MSX-C Wink

By popolony2k

Hero (544)

popolony2k's picture

14-06-2016, 03:10

Yes. In fact it will be more optimized if translated to MSX-C because the pointer deference method used in this Turbo Pascal code is not optimized (because the pointer operations are not optmized in this TP version), but I realized a way to turn pointer operations in this TP version to be so optimized as C languages. Soon I'll optimize this TP code and it will be a little bit faster.

There are a lot of unit tests around this implementation and it has been used in MSXDUMP disk editor for 24bit pointer operations used by Sunrise IDE low level functions.

[]'s
PopolonY2k