MP Ch5 Introduction To 8085 Assembly Language Programming
MP Ch5 Introduction To 8085 Assembly Language Programming
MP Ch5 Introduction To 8085 Assembly Language Programming
Assembly Process
Convert assembly language file (.asm) into an executable file (.obj) for the LC-3 simulator.
First Pass:
* scan program file * find all labels and calculate the corresponding addresses; this is called the symbol table
Second Pass:
* convert instructions to machine language, using information from symbol table
7-2
Instruction Classification
Instruction: is a binary pattern designed inside p to perform a specific function. Instruction Set: is the entire group of instructions 8085 is upward compatible
1. 2. 3. 4.
Arithmetic operations
Perform arithmetic operations such as:
Addition adding any 8-bit numbers, mem loc, or reg. content can be added to the contents of the accumulator Subtraction - Subtracting any 8-bit numbers, mem loc, or reg. content can be subtracted from the contents of the accumulator (using 2s complement) Increment / Decrement
Logical operations
AND, OR, Exclusive OR:- ANDing, ORing, or XORing any 8-bit numbers, mem loc, or reg. content can be ANDed, ORed, or XORed with the contents of the accumulator Rotate: shifting the bits in the accumulator Compare: (=, <, >, with the contents of acc.) Complement: complementing the cont. of acc.
Branching Operations
(conditional and noncondithional) Jump: conditional jump, decision making, Z, CY flags. Call, return, and restart
Data format
MOV
ADD CMA
C, A
B ----
0100 1111
1000 0000 0010 1111
4FH
80H 2FH
opcode operand Binary code Hex code JMP 2085H 1100 0011 1000 0101 0010 0000 C3H 85H 20H
Data Format
FLOW CHART
Start
Add Numbers
Display Sum
End
; Load the Register A with 32H ; Load the Register B with 48H ; Add the 2 bytes and save res in A ; Display the acc. Contents at port 01H ; End
Hex Code 3E 32 06
48
MVI B,48H
ADD B OUT 01H HALT
80 D3 01 67
1. 2. 3.
4. 5.