HYUNDAI MicroElectonics
40
INC
( Increment )
Function
: M
( M )
1
Description : Increment the contents of accumulator, register or memory by 1.
Flag
:
Mnemonic
OP Code
Bytes
Cycles
INC A
88
1
2
INC dp
89
2
4
INC dp + X
99
2
5
INC !abs
98
3
5
INC X
8F
1
2
INC Y
9E
1
2
Example
:
383 C17C 8915
INC
CHCNT
384 C17E C515
LDA
CHCNT
385 C180 4414
CMP
#20
386 C182 7003
BNE
ADCC1
387 C184 E40015
LDM
CHCNT,#0
388 C187 C515
ADCC1:
LDA
CHCNT
INCW
( Increment word - 16 bit )
Function
: ( dp+1 ) ( dp ) = ( dp+1 ) ( dp ) + 1
Description : Increment the contents of 16bit memory pair by 1.
Flag
:
Mnemonic
OP Code
Bytes
Cycles
INCW dp
9D
2
6
Example
:
504 C218 9D03
INCW
DPL
; INCREMENT (DPL+1)(DPL)
505 C21A C401
LDA
#01H
506 C21C 4504
CMP
DPH
507 C21E 70F3
BNE
TXLP1
508 C220 C4A0
LDA
#0A0H
509 C222 4503
CMP
DPL
510 C224 70E
BNE
TXLP1
;clear until 1a0h address
511 C226 6F
RET