HYUNDAI MicroElectonics
24
BEQ
( Branch if equal )
Function
: if (Z) = 1, then ( PC )
( PC ) + rel
Description : Branches if zero flag is “1”.
Flag
:
Mnemonic
OP Code
Bytes
Cycles
BEQ rel
F0
2
2/4
Example
:
115 E085 C4C0
LDA
#0C0H
; READ R0 PORT DATA
116 E087 3E07
LDY
#7H
; 8 TIMES LOOP COUNTER
117 E089 08
LOOP:
ASL
A
118 E08A 5003
BCC
KISTATUS
119 E08C BE
DEC
Y
; Y-1 -> Y
120 E08D F0FA
BEQ
LOOP
121 E08F C400
KISTATUS: LDA
#0
BIT
( Bit test )
Function
: ( Z )
( A )
( M )
( N )
( M
7
) , ( V )
( M
6
)
Description : Logical AND of the accumulator and the contents of memory.
The result effects zero flag(Z) and the bit7 of memory enter into negative flag(N), bit6 enter
into overflow flag(V).The accumulator and the contents of memory are unchanged.
Flag
: M
7
M
6
Mnemonic
OP Code
Bytes
Cycles
BIT dp
0C
2
4
BIT !abs
1C
3
5
Example
:
97 E06F C40F
LDA
#0FH
98 E071 0C5C
BIT
5CH
99 E073 F004
BEQ
JMP_NXT
100 E075 2130
SET1
30H.1
101 E077 2F02
BRA
MEMCOM1
102 E079 3130
JMP_NXT:
CLR1
30H.1
103 E07B FF
MEMCOM1:
NOP