Assembly Language Programming - CS401 Power Point Slides Lecture 03
This document discusses assembly language programming on the iAPX 88 microprocessor. It describes the iAPX 88 registers including the general purpose, pointer/index/base, flag, and segment registers. It also outlines the basic instruction groups for data movement, arithmetic/logic, and program control. Finally, it provides a simple assembly language example to add two numbers stored in the AX and BX registers.
Download as PPT, PDF, TXT or read online on Scribd
100%(1)100% found this document useful (1 vote)
262 views
Assembly Language Programming - CS401 Power Point Slides Lecture 03
This document discusses assembly language programming on the iAPX 88 microprocessor. It describes the iAPX 88 registers including the general purpose, pointer/index/base, flag, and segment registers. It also outlines the basic instruction groups for data movement, arithmetic/logic, and program control. Finally, it provides a simple assembly language example to add two numbers stored in the AX and BX registers.
AX A Accumulator Register BX B Base Register CX C Counter Register DX D Destination Register iAPX 88 Registers (16-bit) Pointer / Index / Base
SI DI iAPX 88 Registers (16-bit) Pointer / Index / Base SI SI Source Index DI DI Destination Index IP IP Instruction Pointer SP SP Stack Pointer BP BP Base Pointer iAPX 88 Registers (16-bit) Flag Register - - - - O D I T S Z - A - P - C C = Carry S = Sign Bit P = Parity T = Trap Flag A= Auxiliary Carry I = Interrupt Flag Z= Zero Bit D = Direction Flag O = Overflow Registers Program Counter Instruction Pointer
Function: Address of next instruction to be executed
Instruction Groups Data Movement Instructions Arithmetic / Logic Instructions Program Control Instructions Special Instructions
Data Movement
mov ax,bx ; move data from bx to ax
lda 0234 ; load 0234 into ; accumulator
and ax,1234 ; AND 1234 with ax
add bx,0534 ; ADD 0534 to bx
add bx,[1200] ; ADD data at address 1200 to bx
add ax,[1234] ; ADD data from address 1234 to ax Arithmetic and Logic Instructions iAPX 88 Registers (16-bit) Segment
CS CS Code Segment DS DS Data Segment SS SS Stack Segment ES ES Extra Segment iAPX 88 Registers (16-bit) General Purpose
AX AH,AL BX BH,BL CX CH,CL DX DH,DL A Simple Program
Move 5 to AX mov ax,5 Move 10 to BX mov bx,10 ADD BX to AX add ax,bx Move 15 to BX mov bx,15 ADD BX to AX add ax,bx General Instruction Format
instruction dest, src instruction dest instruction src
Assembler
NASM
The Netwide Assembler
Linker
ALINK
Debugger
AFD
Advanced Full Screen Debug
EX01.ASM [ORG 0X100]
mov ax,5 mov bx,10 Add ax,bx Mov bx,15 Add ax,bx
Mov ax,0x4c00 Int 0x21 EX01.LST Word Representation 4 Byte Word
Representation in Memory MSB LSB MSB LSB LSB MSB 0 1 2 3 0 1 2 3 Representation 1 Representation 2 Little Endian Notation Big Endian Notation