Re: A86: mem help


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

Re: A86: mem help




In a message dated 5/1/99 3:14:24 PM Eastern Daylight Time, 
e1066@sherbtel.net writes:

> i have run across a problem while trying to make some graphic routines....
>  example...
>  
>  Sprite1:
>      .db %00000000
>      .db %00000000
>      .db %00000000
>      .db %00000000
>      .db %00000000
>      .db %00000000
>      .db %00000000
>      .db %00000000
>  ...i have this 8x8 sprite and have HL which is currently pointing to the
>  first byte of HL...so it is pointing to the "0" in the top left
>  corner...does the command "inc hl" make HL point to the second zero on the
>  top row or does it make it point to the top row?  if it makes it point to
>  the second row how would i make it point to the second...then third....then
>  fourth...and so on zero in each row....
>  
>  (i know these seems newbie-ish, but i've never been able to find any good
>  tutorials on how mem works...)

db stands for define byte, so each "row" in that sprite is one byte.  
therefore, incrementing hl would point it to the next row.  the reason there 
are multiple digits on each line is because the byte is being defined in 
binary, so each digit represents a bit.  nonetheless, there is no way to make 
hl point to a specific bit, so you have to go by bytes


>  
>  ...also can I clear just...
>      ld f,0
>      ....to clear all the flags that may be set....i want to clear the carry
>  flag...
>  
>  
if you want to clear just the carry flag, any logical operator will work
ex:
	or a
	and a
or anything else

if you want f to equal 0, try this routine:
	push af
	ex (sp),hl
	ld l,0
	ex (sp),hl
	pop af