lec12_x86isa.pdf

(438 KB) Pobierz
Intel x86 Instruction Set Architecture
Computer Organization and Assembly Languages
p
g z
y
g g
Yung-Yu Chuang
2008/12/15
with slides by Kip Irvine
Data Transfers Instructions
MOV
instruction
• Move from source to destination. Syntax:
MOV
d ti ti
destination, source
• Source and destination have the same size
• N more than one memory operand permitted
No
h
d
i d
• CS, EIP, and IP cannot be the destination
• No immediate to segment moves
3
MOV
instruction
.data
count BYTE 100
wVal WORD 2
.code
mov bl,count
mov ax,wVal
V l
mov count,al
mov al,wVal
mov ax count
ax,count
mov eax,count
; error
; error
; error
4
Exercise . . .
Explain why each of the following
MOV
statements are
invalid:
.data
bVal BYTE
100
bVal2 BYTE
?
wVal WORD
2
dVal DWORD 5
.code
mov ds,45
; a.
mov esi,wVal
; b.
mov eip,dVal
i dV l
; c.
mov 25,bVal
; d.
mov bVal2 bVal
bVal2,bVal
; e
e.
5
Zgłoś jeśli naruszono regulamin