Download iAPX 88 Registers (16-bit)

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts
no text concepts found
Transcript
CS-401
Computer Architecture & Assembly
Language Programming
Lecture-3
Introduction to Assembly Language
Lets revise the last lecture
Basic Computer Organization
iAPX 88 Registers (16-bit)
iAPX 88 Registers (16-bit)
General Purpose
AX
BX
CX
DX
iAPX 88 Registers (16-bit)
General Purpose
16-bit
AX
AH
8-bit
AL
8-bit
iAPX 88 Registers (16-bit)
General Purpose
16-bit
BX
BH
8-bit
BL
8-bit
iAPX 88 Registers (16-bit)
General Purpose
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)
SI
DI
IP
SP
BP
Pointer / Index / Base
SI Source Index
DI Destination Index
IP Instruction Pointer
SP Stack Pointer
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
Arithmetic and Logic Instructions
and
ax,1234
; AND 1234 with ax
add
bx,0534
; ADD 0534 to bx
add
bx
bx,[1200] ; ADD data at address 1200 to
add
to ax
ax,[1234] ; ADD data from address 1234
iAPX 88 Registers (16-bit)
Segment
CS
DS
SS
ES
CS Code Segment
DS Data Segment
SS Stack Segment
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
Move 10 to BX
ADD BX to AX
Move 15 to BX
ADD BX to AX
mov
mov
add
mov
add
ax,5
bx,10
ax,bx
bx,15
ax,bx
General Instruction Format
instruction
instruction
instruction
dest, src
dest
src
Assembler
NASM
The Netwide Assembler
Linker
ALINK
Debugger
AFD
Advanced Full Screen Debug
EX01.ASM
[ORG 0X100]
mov
mov
Add
Mov
Add
ax,5
bx,10
ax,bx
bx,15
ax,bx
Mov ax,0x4c00
Int 0x21
EX01.LST
Word Representation
4 Byte Word
MSB
LSB
Representation in Memory
Representation 1
Little Endian Notation
MSB
0
Big Endian Notation
LSB
1
2
3
Representation 2
MSB
LSB
0
1
2
3