The Intel 8088 Architecture and Instruction Set
The Intel 8088 Architecture and Instruction Set
The Intel 8088 Architecture and Instruction Set
History
rupts/exceptions.
There are also three segment registers (CS, DS,
SS) which are used to allow the code, data and
stack to be located in any three 64 kByte segments
within a 1 megabyte (20-bit) address space as described below.
Instruction Set
Data Transfer
Transfer of 8 and 16-bit data is done using the MOV
instruction. Either the source or destination has to
be a register. The other operand can come from another register, from memory, from immediate data (a
value encoded in the instruction) or from a memory
location pointed at by register BX. For example, if
COUNT is the label of a memory location the following are possible:
Registers
A 16-bit stack pointer (SP) is used to implement a stack to support subroutine calls and inter-
PUSH
POP
AX
BX
; push contents of AX
; restore into BX
I/O Operations
CALL
...
readchar:
...
RET
readchar
Control Transfer
Pseudo-Ops
MOV
MOV
BX,COUNT
; load value of COUNT
BX,OFFSET COUNT ; load location of COUNT
Segment/Offset Addressing
;
;
;
;
Byte Order
When multi-byte values are stored in memory the
bytes are stored with the least-significant byte at
the lowest memory location (so-called little-endian
format). This is the opposite of the big-endian order used by Motorola processors.
Exercise:
done:
int
bx,offset msg
; bx points to string
al,[bx]
al,0
done
al,32
noprt
printc
;
;
;
;
;
;
bx
loop
20h
; return to DOS
printc:
push
push
mov
mov
int
pop
pop
ret
ax
dx
dl,al
ah,02H
21H
dx
ax
msg
This,9,31,32,is,20H,a string.,0
db
; push ax and dx
; use DOS to
; print character
; restore ax and dx
db
code ends
end
start