Professional Documents
Culture Documents
ِ ْ
ق ُ
ز ْر و
َ ً ام ْ
ل ِ ب ز ْد
ني ِع ِّ َر
My Lord! Advance me in
Knowledge and true understanding
MICROPROCESSOR BASED
SYSTEM Lecture8
Dr. Shahrul Naim Sidek
snaim@iium.edu.my
Rev 1.0 Microprocessor Based System (MCT 2219) SBAH Jul’07
Software Architecture
1 2 3 4
NOTES
Hex address $1000 is set as the starting address for the following
instruction
The opcode for MOVE.L goes in address $1000 … and so on
NOTES
The value of $100 replaces the symbol in the binary code
The use of EQU directives is encouraged because
makes program more readable
Rev 1.0 makes programs easier to
Microprocessor maintain
Based System (MCT 2219) SBAH Jul’07
Instruction Set: Assembler Directives (cont)
FUNCTION (END)
Used at the end of the source program
Statements following the END directive are not processed by the assembler
EXAMPLE
NOTES
The label of the END directive (optional) represents the entry point for the
program
The address of the entry point is used by debuggers, loaders, conversion
utilities, and so on, to identify the starting address of the program
Rev 1.0 Microprocessor Based System (MCT 2219) SBAH Jul’07
Instruction Set: Assembler Directives (cont)
FUNCTION (DEFINE CONSTANT)
Place data constants WITHIN A PROGRAM
EXAMPLE
NOTES
For words and longwords, the assembler adjusts the address of the
constant to ensure proper alignment.
ASCII characters defined
Rev 1.0 as words
Microprocessor are left-justified
Based System (MCTwithin
2219) the word SBAH Jul’07
Instruction Set: Assembler Directives (cont)
FUNCTION (DEFINE STORAGE)
Reserves RAM storage for use during execution of the program.
EXAMPLE
NOTES
if the memory locations reserved for buffer are not initialized, they will
contain garbage data
Rev 1.0 Microprocessor Based System (MCT 2219) SBAH Jul’07
Instruction Set: Categories
• Data movement
Move operands (data) among memory locations or registers
• Integer arithmetic
Addition, subtraction, multiply, divide, ...
• Boolean
AND, OR, XOR, NOT, ...
• Shift and rotate
Arithmetic-shift, logical-shift, rotate
Data Movement Int. arithmetic Boolean Shift rotate Bit Binary coded
Manipulation decimal