Re: A86: 24-bit variable


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

Re: A86: 24-bit variable




Yes, that would be a 24-bit variable:

 ld hl,(var+1); load lower bytes -- 16
 ld a,(var)	; load high byte -- 13
		; AHL=var -- 29 t-states

--or--

 ld hl,var	; point to the var	-- 10
 ld a,(hl)	; load the high byte -- 7
 inc hl	; move to middle byte -- 6
 ld d,(hl)	; load the middle byte -- 7
 inc hl	; move to low byte -- 6
 ld e,(hl)	; load the low byte -- 7
 ex de,hl	; exchange pointer and data -- 4
		; DE=var+2, AHL=(var) -- 47 t-states

--or--

 ld ix,var	; point to the var -- 14
 ld a,(ix+0) 	; load the high byte -- 19
 ld h,(ix+1) 	; load the middle byte -- 19
 ld l,(ix+2)	; load the low byte -- 19
 		; IX=var, AHL=(var) -- 71 t-states

...

var:
 .db 0,0,0

At 04:09 PM 8/30/98 -0400, you wrote:
>    How would I make a 24-bit variable that I could load  into ahl? Could I
>do: variable:     .db 0,0,0
> Thanks,
> --------------
>Jbrett
>tbarwick@esn.net
>http://ww2.esn.net/~tbarwick
>    

--
David Phillips
mailto:electrum@tfs.net
ICQ: 13811951
AOL/AIM: Electrum32


Follow-Ups: References: