{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

lecture3-4pg - Reading Assignment EEL 4744C Microprocessor...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
1 Dr. Tao Li 1 EEL 4744C: Microprocessor Applications Lecture 3 Part 1 Assembly Language Programming and Debugging Dr. Tao Li 2 Microcontrollers and Microcomputers: Chapter 5 Or Software and Hardware Engineering (new version): Chapter 2.4, Chapter 5.3, Chapter 6 Plus CPU 12 Reference Manual: Chapters 1, 2, and 3 Reading Assignment Dr. Tao Li 3 Gives you a better appreciation of how the hardware works than high-level languages Resources are given by the programmer’s model These include registers , hardware resources in CPU, and memory used for data storage Look through the instructions in a category, find the mnemonic for the required operation, then find the correct addressing mode Assembly Language Dr. Tao Li 4 Converts (assembles) a source file into binary codes (machine codes) executed by the computer 1-to-1 correspondence between assembly language statements and the machine code in memory Assembly source code fields: 4 of these Label Field Operation Code Field Operand Field Comment Field The Assembler
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
2 Dr. Tao Li 5 Label field Optional and provides a symbolic memory reference Represents the address of the first byte of an instruction or a data element Also used to define constants Usually starts with an alphabetic character, may contain digits and other characters Operation code field Contains either a mnemonic for the operation or an assembler directive or pseudo-operation Mnemonics are assembled into code to be placed into memory Assembler directives or pseudo-operations are instructions to direct the assembler how to do its job Assembly Source Code Fields Dr. Tao Li 6 Operation code field (continued) In the following code example, the ORG (for origination) directive specifies where the code is located in memory When assembler sees the ORG directive, it sets the value of current location counter to $1000 Assembly Source Code Fields Use label to specify target address (relative address) ORG directive helps determine actual address Dr. Tao Li 7 Operand field Can be: names of registers , numeric/symbolic constants , labels , algebraic expressions to be evaluated by assembler The following 2 instructions load the A, B registers from memory location DATA1 and DATA1+1 Comment field Ignored during assembly May have source code lines that are only comments or blank For some assemblers, beginning of comment fields are denoted by “;” or “*” characters Assembly Source Code Fields Label Numeric constant Dr. Tao Li 8 Assembler directives or pseudo-operations field We have seen the ORG example There are others to define symbols, provide data in memory locations, reserve memory locations for data storage, define macros, etc.
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}