APPENDIX
lxxvi
JUNE 2001 Ver 1.00
16-BIT operation
Bit Manipulation
No.
Mnemonic
Op
Code
Byte
No
Cycle
No
Operation
Flag
NVGBHIZC
1
ADDW dp
1D
2
5
16-Bits add without Carry
YA
←
( YA ) ( dp +1 ) ( dp )
Compare YA contents with memory pair contents :
(YA)
(dp+1)(dp)
Decrement memory pair
( dp+1)( dp)
←
( dp+1) ( dp) - 1
Increment memory pair
( dp+1) ( dp)
←
( dp+1) ( dp ) + 1
Load YA
YA
←
( dp +1 ) ( dp )
Store YA
( dp +1 ) ( dp )
←
YA
16-Bits subtract without carry
YA
←
( YA ) - ( dp +1) ( dp)
NV--H-ZC
2
CMPW dp
5D
2
4
N-----ZC
3
DECW dp
BD
2
6
N-----Z-
4
INCW dp
9D
2
6
N-----Z-
5
LDYA dp
7D
2
5
N-----Z-
6
STYA dp
DD
2
5
--------
7
SUBW dp
3D
2
5
NV--H-ZC
No.
Mnemonic
Op
Code
8B
8B
0C
Byte
No
3
3
2
Cycle
No
4
4
4
Operation
Flag
NVGBHIZC
1
2
3
AND1 M.bit
AND1B M.bit
BIT dp
Bit AND C-flag : C
←
( C )
∧
( M .bit )
Bit AND C-flag and NOT : C
←
( C )
∧
~( M .bit )
Bit test A with memory :
Z
←
( A )
∧
( M ) , N
←
( M
7
) , V
←
( M
6
)
Clear bit : ( M.bit )
←
“0”
Clear A bit : ( A.bit )
←
“0”
Clear C-flag : C
←
“0”
Clear G-flag : G
←
“0”
Clear V-flag : V
←
“0”
Bit exclusive-OR C-flag : C
←
( C )
⊕
( M .bit )
Bit exclusive-OR C-flag and NOT : C
←
( C )
⊕
~(M .bit)
Load C-flag : C
←
( M .bit )
Load C-flag with NOT : C
←
~( M .bit )
Bit complement : ( M .bit )
←
~( M .bit )
Bit OR C-flag : C
←
( C )
∨
( M .bit )
Bit OR C-flag and NOT : C
←
( C )
∨
~( M .bit )
Set bit : ( M.bit )
←
“1”
Set A bit : ( A.bit )
←
“1”
Set C-flag : C
←
“1”
Set G-flag : G
←
“1”
Store C-flag : ( M .bit )
←
C
Test and clear bits with A :
A - ( M ) , ( M )
←
( M )
∧
~( A )
Test and set bits with A :
A - ( M ) , ( M )
←
( M )
∨
( A )
-------C
-------C
MM----Z-
4
BIT !abs
1C
3
5
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
CLR1 dp.bit
CLRA1 A.bit
CLRC
CLRG
CLRV
EOR1 M.bit
EOR1B M.bit
LDC M.bit
LDCB M.bit
NOT1 M.bit
OR1 M.bit
OR1B M.bit
SET1 dp.bit
SETA1 A.bit
SETC
SETG
STC M.bit
y1
2B
20
40
80
AB
AB
CB
CB
4B
6B
6B
x1
0B
A0
C0
EB
2
2
1
1
1
3
3
3
3
3
3
3
2
2
1
1
3
4
2
2
2
2
5
5
4
4
5
5
5
4
2
2
2
6
--------
--------
-------0
--0-----
-0--0---
-------C
-------C
-------C
-------C
--------
-------C
-------C
--------
--------
-------1
--1-----
--------
22
TCLR1 !abs
5C
3
6
N-----Z-
23
TSET1 !abs
3C
3
6
N-----Z-