AVC기반 멀티미디어 프로세서 칩 개발
Download
Report
Transcript AVC기반 멀티미디어 프로세서 칩 개발
Lecture 11
Z80 Instruction
Hong Youpyo @ DGU
1
C vs Z80 Program Body
C Program
Z80 Program
#include <stdio.h>
Main ( ) {
.
.
.
}
ORG 0000H
.
.
.
END
2
Y. Hong
Two Types of Instruction
Pseudo-instruction
Assembler
(or Compiler) Directive : ORG,
END, …
Similar to #include in C.
Instruction
Normal
instructions : LD, OUT, JP,…
Similar to printf in C.
3
Y. Hong
Compiler and Assembler
Compiler
A tool that converts human-friendly language based
code to a binary code
Assembler
A tool that converts assembly code to a binary code
4
Y. Hong
compile
assemble
Z = A + Y;
High-level
Language
Assembly
Language
5
Machine
Language
Y. Hong
ORG
Format : ORG
ADRS
Example : ORG 8000H
6
Y. Hong
END
Format : END
7
Y. Hong
Addressing Mode
Immediate operand
Operand
is data itself (like a constant)
Direct address
Operand
is address (or register name) for the
real data
Indirect address
Operand
is the address of the address for the
real data
8
Y. Hong
LD (Load)
Format : LD target source
Ex) LD A, 00000001B
immediate operand
Ex) LD (8000H), A
( ) for an operand means
direct addressing.
9
Y. Hong
OUT
Format : OUT target source
Example : OUT (00000111B), A
10
Y. Hong