Arithmetic operations with double-byte numbers

ZXNet echo conference «code.zx»

From Kirill Frolov To All 6 February 2006

Hello, mishutka mis> well, firstly, the BCD is far from slow and buggy, and secondly, it’s very good mis> convenient. mis> Regarding the z80 - heresy. > And please do not link to search engines What is called chewing and putting in your mouth? 5 liters Lapin Kulta. (because it has already been written ten times and is being searched on Google the first time. To repeat - tired).

From Slavik Tretiak To All 6 February 2006

Hello, mishutka BCD is far from slow and buggy, and secondly, it’s very convenient BDC is not convenient to use. BCD is good only in one case - if you need results very often (more often than performing calculations) output in readable form for person (i.e. in the 10th system) in all other cases the BCD is braking. Also, please do not link to search engines. i.e. The link I gave doesn't work? And also, regarding the link to the search engine. For example, in order to answer you more correctly and not lie with the multiplication, I didn’t I got lazy, pressed Ctrl+T and searched Google for "16 bit multiply z80" the second link is the classic document "Z80 Bits", which describes various multiplication and division options. (link in my previous post) After searching a little more, we find various options for calculating square roots (not exactly for the Z80, but everything is very accessible) http://www.pedrofreire.com/crea2_en.htm I spent 5 minutes on this. why don't you do the same? or do you need it so badly that you don’t want to spend 5 minutes looking for it?

From Slavik Tretiak To All 6 February 2006

Hello, mishutka ┌─- code ─── ; addition: hl = hl + de add16 add hl,de ret ; subtraction : hl = hl - de sub16 and a sbc hl,de ret ; multiply : a:hl = a * de mul16 ld c,0 ld h,c ld l,c add a,a jr nc,$+4 ld h,d ld l,e dup 7 add hl,hl rla jr nc,$+4 add hl,de add a,c edup ret └── code ─── In general, google.com is helpful. for example http://map.tni.nl/sources/external/z80bits.html PS why do you need a slow and buggy BCD?

From Mikhail Tebenkov To All 6 February 2006

Hello, All Gentlemen, if anyone has a similar library, please share or tell me where you can read you need addition, subtraction, multiplication and division and roots (square) and it will be just great if it is also in BCD format. And if anyone knows where you can read about the algorithms for these operations, special respect to that

From Mikhail Tebenkov To All 6 February 2006

Hello Sinus Well, firstly, the BCD is far from slow and buggy, and secondly, it’s very convenient. And Also please do not link to search engines

From Gavrilov Vitaly To All 6 February 2006

Hello Sinus You can ask me http://zxdocs.fatal.ru Coding section

From Wladimir Bulchukey To Mikhail Tebenkov 7 February 2006

Hello, Mikhail...! 06 Feb 06 17:35, Mikhail Tebenkov -> All: MT> Gentlemen Will your comrades come? :) MT> if anyone has a similar library, please share or MT> tell me where I can read about adding, subtracting, multiplying and MT> division and root (square) and it will be just great if there is also a format MT> BCD. And if anyone knows where you can read about the algorithms for these operations MT> special respect If there is a purely practical (and not academic) task, and specifically for Spectrum (not abstract Z80), it might make sense to use a calculator BASIC. Newspaper "Nicron", numbers 30, 31 and 33, section "Learning assembly language". http://trd.speccy.cz, Press, starting with N. With the best - Wlodek # wlblack()newmail.ru # http://wlodeks.narod.ru [ZX] [500:95/462@ZXNet] [2:5016 Forever] [Golyanovo] [Old Russians]

From Vyacheslav Vovk To All 16 February 2006

Hello, All But you can use the standard functions of the calculator through Rst 40

From Vladimir Kladov To All 17 February 2006

Hello elf I once said in some thread that I was looking for a book by V.L. Grigoriev. Accurate I don't remember the name right now, I'll have to look for the thread. The most important thing: there was a lot mathematical algorithms. For example, arithmetic operations with multibyte numbers. For the KR580, actually, but the Z80 is quite compatible. (I don’t remember if I was there trigonometry, but there was definitely BCD arithmetic).