ASSEMBLY LANGUAGE
PROGRAMMING -
iNTRODUCTION
Farhan Sadaf
Lecturer, Dept. of CSE
Program Development Steps
• Defining the problem
• Representing Program Operation
• Flowchart (checkout the book’s examples)
• Structured Programming and Pseudocode Overview
• Three basic operations (sequence, decision, iteration)
• Finding the Right Instruction
• Writing the Program
2
CONSTRUCTING THE
MACHINE CODES FOR 8086
INSTRUCTIONS
3
Coding Template for 8086 instruction
Instruction codes for 8086 registers
5
MOD and R/M bit pattern for 8086
instruction
6
Appendix A
MOV, IN, OUT, ADD, ADC, INC, AAA, DAA,
SUB, DEC, CMP, MUL , DIV, AND, OR, NOT,
XOR, CALL, JMP, RET , LOOP
MOV SP, BX
MOV SP, BX
MOV CL, [BX]
MOV 43H[SI], DH
MOV CX, [437AH]
MOV CS:[BX], DL
Directives
EQE, DB, DW, DD
Program works with three general categories of data:
1. Constant
2. Variable
3. Address
Naming Address- Labels
NEXT: MOV AL, 02H
......
......
JMP NEXT
Multiply two 16-bit binary numbers
Data Arrangement in Memory
Program development
algorithms
References
Microprocessors and Interfacing: Programming and Hardware
Douglas V. Hall