num2txt (4bit to char)
ZXNet echo conference «code.zx»
From Evgeny Goljakov → To Alexander Bondarenko 5 June 2003
Hello Alexander.
Sat 7 Jun 02 Eugene Palenock -> Alexander Bondarenko:
I recommend this:
====
in: a=[#00-#0f]
out: a=["0"-"9","A"-"F"]
CP#0A
SBC A,#69
DAA
====
For a more detailed study, read I. Roshchin’s article for memory: mathematical
calculations on Z80, auxiliary
procedure, there is a link to the original source.
And then there’s what I wouldn’t do:
EP> If it's fast then so
EP> ld bc, 303fh
EP> ld a, d
EP> rra
EP> rra
EP> rra
EP> rra
EP> or a, b
EP> and a, c
EP> cp '9'+1+30h
EP> jp c, m1a
EP> add a, 7
EP> m1a: ld (buff+0), al
EP> ld a, d
EP> or a, b
EP> and a, c
EP> cp '9'+1+30h
EP> jp c, m1b
EP> add a, 7
EP> m1b: ld (buff+1), al
EP> ld a, eEP> rra
EP> rra
EP> rra
EP> rra
EP> or a, b
EP> and a, c
EP> cp '9'+1+30h
EP> jp c, m1c
EP> add a, 7
EP> m1c: ld (buff+2), al
EP> ld a, d
EP> or a, b
EP> and a, c
EP> cp '9'+1+30h
EP> jp c, m1d
EP> add a, 7
EP> m1d: ld (buff+3), al
EP> ret
EP> buff: db '1234
From Ivan Roshin → To All 11 June 2003
Hello, All!
Thu 5 Jun 2003 Evgeny Goljakov wrote to Alexander Bondarenko:
EG> I recommend this:
EG> ====
EG> in: a=[#00-#0f]
EG> out: a=["0"-"9","A"-"F"]
EG> CP #0A
EG> SBC A,#69
EG> DAA
EG> ====
EG> For a more detailed study, read the article by I. Roshchin on
EG> memory: mathematical calculations on Z80, auxiliary
EG> procedure, there is a link to the source.
If anyone needs it, I can post the latest version of this here
articles (“More about programming arithmetic operations”).
Volume - 35 KB ZIP.
Best regards, Ivan Roshchin.
From Vladimir Karpenko → To Ivan Roshin 13 June 2003
Hello Ivan
IR> If anyone needs it, I can upload the latest version of this here
IR> articles ("More about programming arithmetic operations").
IR> Volume - 35 KB ZIP.
Come on!
[ZX][Sprinter registered developer][rw1p2][NedoPC][A600HD]
Bye
From Alexander Bondarenko → To Ivan Roshin 16 June 2003
*Hello, Ivan!*
Catch my ideas about the subject "num2txt (4bit to char)", which I was talking about
at 11 Jun 2003 your footcloth to comrade. All.
EG>> For a more detailed study, read the article by I. Roshchin on
EG>> memory: mathematical calculations on Z80, auxiliary
EG>> procedure, there is a link to the source.
IR> If anyone needs it, I can upload the latest version of this here
IR> articles ("More about programming arithmetic operations").
IR> Volume - 35 KB ZIP.
Come on, come on - come in handy.
/That’s all, Ivan, you can scroll further.../