Académique Documents
Professionnel Documents
Culture Documents
1. INTRODUCTION
2. CORE
3. ADRESSING MODES
4. PERIPHERALS
5. ST7 SOFTWARE TOOLS
6. ST7 HARDWARE TOOLS
7. STVD7
SOFTWARE DESCRIPTION
Source Program Format
substract
sub A, #$22
Operand
Label
Comment
Operation
INHERENT
The OP code fully specify all required information for the cpu
to process the operation (The inherent instructions are single
byte long).
Example
Example
Before Completion
A = Previous value
After Completion
LD A, #$55
A = $55
ADDRESSABLE SPACE: 00 to FF
INC variable
NEG variable
SRA variable
Example
If label is an 8 bit symbol defined as $86
Before Completion
$086
5A
After Completion
INC label
$086
5B
Example
If label is an 16 bit symbol defined as $F1D6
Before Completion
After Completion
A = $CB
A = $C1
$F1D6
0A
ADD A, LABEL
ADDRESSABLE SPACE: 00 to FF
CPL (X)
DEC (Y)
OR A, (X)
Example
Before Completion
X = $D4
$D4
0A
After Completion
CPL (X)
$D4
F5
Example
If label is an 8 bit symbol defined as $90
Before Completion
X = 03 and C=1
$90
$91
$92
$93
0A
1E
F6
A8
After Completion
C=0
RRC (label, X)
$90
$91
$92
$93
0A
1E
F6
D4
Example
If label is an 16 bit symbol defined as $2E6D
Before Completion
X = 02
$2E6D
$2E6E
$2E6F
$2E70
0A
1E
2F
A8
After Completion
X = $2F
LD X, (LABEL, X)
ADDRESSABLE SPACE: 00 to FF
TNZ [variable]
CLR [variable]
Example
If label is an 8 bit symbol defined as $4B
Before Completion
After Completion
$20
$20
4D
$4B
20
D4
SWAP [label]
$4B
20
10
Example
If label is an 8 bit symbol defined as $40
Before Completion
$40
$41
42
E5
$42E5
11
After Completion
LD A, [label.w]
A = $11
11
Example
If label is an 8 bit symbol defined as $C8
Before Completion
X = 04
After Completion
$0C8
FE
$0C8
FE
$0FE
$0FF
$100
$101
$102
0A
1E
F6
A8
B3
$0FE
$0FF
$100
$101
$102
0A
1E
F6
A8
00
CLR ([label], X)
12
Example
If label is an 8 bit symbol defined as $40
Before Completion
X = 01
$40
$41
After Completion
42
E5
LD A, ([label.w],X,)
$42E5
A = $84
11
84
13
.label
JRMI label
PC
PC
.label
40
JRMI [label]
.PC + 40
14
BIT MANIPULATION
variable
BSET variable, #2
1 1 0 0 0 1 0 0
$86
BRES [variable], #7
0 1 0 0 0 0 0 0
15
variable = $85
$85
F8
Relative jump to
label in range PC128 to PC+127
D4
$4B
20
Execute next
instruction
16
RLC
7 6 5 43 2 1 0
RRC
7 6 5 43 2 1 0
7 6 5 43 2 1 0
SRA
7 6 5 43 2 1 0
SRL
7 6 5 43 2 1 0
17
A D D R E S S IN G M O D E
S YN TA X E X A M P LE S
AD DR ESS R ANG E
In h e re n t
R C F ; M U L X ,A ; S W A P A ; C L R X ; W F I
N o t a p p lica b le
Im m e d ia te
B C P A , #$0F F ; X O R A , #% 01001110
N o t a p p lica b le
S h o rt D ire ct
L o n g D ire ct
C P Y , V A R IA B L E ; S B C A , V A R IA B L E
0000...F F F F
N o o ffse t In d e x e d
C P L (X ) ; D E C (Y ) ; O R A , (X )
00...F F
S h o rt In d e x e d
000...1F E
L o n g In d e x e d
A D D A , (V A R IA B L E , Y )
0000...F F F F
S h o rt In d ire ct
T N Z [va ria b le ]
00...F F
L o n g In d ire ct
A D C A , [va ria b le .w ]
0000...F F F F
S h o rt In d ire ct In d e x e d
000...1F E
L o n g In d ire ct In d e x e d
S U B A , ([va ria b le .w ], X )
R e la tive D ire ct
JR U G E la b e l ; C A L L R la b e l
R e la tive In d ire ct
JR N C [la b e l] ; JR H [la b e l]
0000...F F F F
P C -128/+ 127
P C -128/+ 128
B it D ire ct
B R E S va ria b le , #7
B it In d ire ct
B S E T [va ria b le ], #7
00...F F
R e la tive B it D ire ct
B T JT va ria b le , #3, la b e l
00...F F
00...F F
R e la tive B it In d ire ct
00...F F
18
Before Completion
X = 03 and Y = 04
LD
LD
X,(Label,X)
Y,([Label],Y)
LD A,([Label2.w],Y)
After Completion
X=?
Y=?
A=?
L ab el2:
L ab el:
M em o ry A d d ress
M em o ry C o n ten t
$009F
OO
$00A 0
A6
$00A 1
53
$00A 2
A0
$00A 3
B8
$00A 4
O1
$00A 5
O4
$00A 6
D3
$00A 7
61
19