Re: A86: Question...
[Prev][Next][Index][Thread]
Re: A86: Question...
Yes you can, but not the way you described. Here's some sample code:
ld hl,Flags
ld a,0
ld (hl),a ;Sets all bits to 0
ld a,255
ld (hl),a ;Sets all bits to 1
set n,(hl) ;Sets the nth bit to one. n = 0 to 7
res n,(hl) ;Sets the nth bit to zero.
bit n,(hl)
jr z,somewhere ;If the nth bit = 0, then jump
bit n,(hl)
jr nz,somewhere ;If the nth bit = 1, then jump
Flags: .db 0 ;You only need one byte for 8 bits of
data
---
Andy Johnson
"Change is inevitable...
except from vending machines"
On Thu, 05 Mar 1998 20:06:49 -0500 "A. El-Helw"
<ahmedre@worldnet.att.net> writes:
>
>
>Hello Everyone,
> I am going to start a new project [actually, I have already :]
> and I have
>a question... suppose I wanted to store 8 numbers [either 1 or 0] in a
>variable.. could I do this?
<snip>
_____________________________________________________________________
You don't need to buy Internet access to use free Internet e-mail.
Get completely free e-mail from Juno at http://www.juno.com
Or call Juno at (800) 654-JUNO [654-5866]
References: