A83: Re: Re: hl / (hl) ???


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

A83: Re: Re: hl / (hl) ???




Gah, correction:
if you did ld hl, Table+4, the value of (hl) would be 5, not 4. :P

----- Original Message ----- 
From: "Kouri" <Kouri@ucdavis.edu>
To: <assembly-83@lists.ticalc.org>
Sent: Thursday, January 27, 2000 11:44
Subject: A83: Re: hl / (hl) ???



Let's say you had a table like this:
Table: .db 1, 2, 3, 4, 5, 6
Now if you did this:
ld hl,Table
ld a,(hl)
Now hl points to the Table label. This means that the value stored in hl is the address of Table.
The value in a is 1, because that's the contents of what hl points to.
If you did this:
ld hl,Table+4
the value of (hl) would be 4.

Another example:
Lives: .db 3
If you did this:
ld hl,Lives
dec (hl)
The actual value of hl wouldn't change. But now Lives would look like this in memory:
Lives: .db 2
I hope that helped.

----- Original Message ----- 
From: "Marc Puts" <marcputs@hetnet.nl>
To: <assembly-83@lists.ticalc.org>
Sent: Thursday, January 27, 2000 09:09
Subject: A83: hl / (hl) ???



Sorry I'm asking so much, but I think it's the best way to learn ASM!

What's the difference between hl and (hl) ?


Thanx,
  __  __
 |  \/  |
 | \  / | __ _ _ __ ___
 | |\/| |/ _` | '__/ __|
 | |  | | (_| | | | (__
 |_|  |_|\__,_|_|  \___|


 








References: