RE: LZ: Another Question


[Prev][Next][Index][Thread]

RE: LZ: Another Question



Do you need to do hex conversions?


Ex. if i wanted the point 20,20 in HL would it be $2020 or $07E4 and if it is 
the first way how would i store the point 120,20 as $12020 or what? 


----------
From: 	owner-list-zshell@lists.ticalc.org on behalf of Jimmy Mardell
Sent: 	Wednesday, October 16, 1996 10:37 AM
To: 	list-zshell@lists.ticalc.org
Subject: 	Re: LZ: Another Question


Frank wrote:
>=20
> I know everyone is getting annoyed with me asking question so i have be=
en
> trying to figure this out myself but until i get the z80 book i need so=
me
> help.. i need some type of routine to read 2 coordinate in and store 1 =
in HL
> and one in DE for example
>=20
> .db $0405,$0608
>=20
> The routine should load $0405,hl and $0608,de ... i wrote some that kin=
da
> worked but i would like to see how an experience programmer would do it=
...
>=20
> Thanx


You should store those as words! Like this:


Words:
 .dw $0405,$0608


To read those, you can do like this:


 ld hl,Words
 ld de,(PROGRAM_ADDR)
 add hl,de
 push hl
 call LD_HL_MHL
 ex de,hl
 pop hl
 inc hl
 inc hl
 call LD_HL_MHL
 ex de,hl


Now HL should contain $0405 and DE $0608.


--=20
Jimmy M=E5rdell               "Trying to get a grip of life
mailto:mja@algonet.se         with all these fears i cannot hide
http://www.algonet.se/~mja     But how to keep an open mind
IRC: Yarin                      when i'm so fucked up i could die"