Re: A86: checking set flags


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

Re: A86: checking set flags





In a message dated 9/2/98 18:00:43, tbarwick@esn.net writes:

>I know this is probably a very easy question for all of you, but how do
>you check which system flags are set and which ones aren't.  Such as how
>would you check if 3,(iy+5) is set?
>
>Thanks,


there are 3 commands you need to know for bit manipulation (sounds much cooler
than it is!)

set, res, and bit:

set sets a particular bit (1)

ex:
	set 5,(iy+3)

res resets a particular bit (0)

ex:
	res 5,(iy+3)

bit tests a particular bit (z flag set if bit=0, reset if bit=1)

ex:
	bit 5,(iy+3)
	jp z,bit_is_zero
	jp nz,bit_is_one		;not efficient, but used for demonstration