Addressing Modes
• Immediate
ADD R0, R0, #1 ADDL $1, %EAX
Copyright By PowCoder代写 加微信 powcoder
• Register
ADD R0, R0, R1 ADDL %EBX, %EAX
LD R0, LABEL MOVL LABEL, %EAX
LEA R0, LABEL LEAL LABEL, %EAX
Condition Codes (in EFLAGS)
SF — sign flag: result is negative when viewed as
2’s complement data type
ZF — zero flag: result is exactly zero
CF — carry flag: unsigned carry or borrow occurred
OF — overflow flag: 2’s complement overflow
PF — parity flag: even parity in result (even # of 1 bits)
(and other instruction-dependent meanings)
test yourself
#1 #2 #3 #4 #5 #6
A 010 010 010 110 110 110
B -000 -110 -111 -000 -011 -111
C 010 100 011 110 011 111
CF 0 1 1 0 0 1
OF 0 1 0 0 1 0
SF 0 1 0 1 0 1
unsigned ACS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com