![background image](http://html.mh-extra.com/html/hyundai/gms800/gms800_instruction-manual_2196205039.webp)
Instruction Set
35
DAS
( Decimal adjust for subtraction )
Function
:
Before
After
C
H
A
7
~A
4
(hex)
A
3
~A
0
(hex)
ADDED
C
0
0
0 ~ 9
0 ~ 9
00
0
0
1
0 ~ 8
6 ~ F
FA ( = -06 )
0
1
0
7 ~ F
0 ~ 9
A0 ( = -60 )
1
1
1
6 ~ F
6 ~ F
9A ( = -66 )
1
Description : After subtraction, convert the hex. data of accumulator to decimal data.
Flag
:
Mnemonic
OP Code
Bytes
Cycles
DAS
CF
1
3
Example
:
416
;***************************
417
; DECIMAL SUBTRACTION *
418
;***************************
419 F870 A0
SETC
; set carry
420 F871 C456
LDA
#56H
; 56H -> A
421 F873 2487
SBC
#87H
; Acc. = 56H - 87H
422 F875 CF
DAS
; Acc= 69H
423 F876 E533
STA
DA_CNT
DBNE
( Decrement and branch if not equal )
Function
: ( M )
( M )
1 ,
if (Z)
0 , then ( PC )
( PC ) + rel
Description : Decrement the contents of memory by 1.
If the result is not zero, branch to specified address.
Flag
:
Mnemonic
OP Code
Bytes
Cycles
DBNE dp,rel
AC
3
5/7
DBNE Y,rel
7B
2
4/6
Example
:
755 C3AC E44619
LDM
DLYDAT,#46H
; 250u sec delay (clock = 4MHz)
756 C3AF AC19FD
DLYLP1:
DBNE
DLYDAT,DLYLP1
757 C3B2 6F
RET