32 bit math

By Bit Addict

Resident (34)

Bit Addict의 아바타

11-06-2016, 17:36

How to add and multiply two 32 bit numbers?

Login or 등록 to post comments


Enlighted (6564)


12-06-2016, 00:27

look for a web page about z80 coding

By santiontanon

Paragon (1521)

santiontanon의 아바타

12-06-2016, 01:42

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

By popolony2k

Hero (544)

popolony2k의 아바타

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.



By AxelStone

Prophet (3057)

AxelStone의 아바타

12-06-2016, 19:20

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

By popolony2k

Hero (544)

popolony2k의 아바타

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.