EE180: Microprocessor Systems Lecture Notes 3


Two parts of a program
a.    Instruction – describes the logic. This consists of one or more procedures.
                             Main Program – first procedure to be executed
b.    Data – material on which the instructions work

Assembler - create the object module in sequence byte by byte and line by line basis.

Type of statements used in Assembly program
a.    Comments – to be ignored by the assembler
b.    Instructions – statement that will be translated into machine language
c.    Directives – “pseudo operation”  statement that gives directions to assembler

Instructions and Directives
a.    Has up to three parts : a name, an opcode, an operand
b.    Must have an opcode, but not all have a name or operand

Rules in specifying names
a.    May use letters, digits (0-9), and ?, @, _, $
b.    First character must not be digit

Rules for specifying numbers
a.    Decimal number – can type it directly. Ex: 990
b.    Hex Number – must type h at the end of the number. Ex: 990h
c.    Binary Number must type b at the end of the number



Directive for building programs (MASM)
Direct
Purpose
.MODEL
Specify the memory model
.STACK
Set up the stack
.DATA
Set up a data segment
.CODE
Set up a code segment
.STARTUP
Generate startup instructions for the main program
.EXIT
Generate exit instruction for the main program
Share:

No comments:

Post a Comment

Thanks for Suggestion / Comment!

God Bless!

Our Sponsor

Popular Post

Blog Archive