假如你想写系统软件,两本书入门书籍 — 谭浩强的《C 语言程序设计》和王爽的《汇编语言》是必学的。谭老的 C 语言表达已十分完善,李老师的选编倒有一个小缺点—命令没有英文全名,也许他觉得如今学习编程的朋友们也不背单词,好似新生代作家看不懂英文原作一般。但是我认为记牢命令的英语全名,就不易弄混,印像会更深入,因此我将王爽书中出现的英文简称的全名列举出去,便于入门的好朋友能够更好地记牢他们。
8086CPU 给予下列几类命令。
一、数据信息传送指令
例如,mov(move)、push、pop、pushf(push flags)、popf(pop flags)、xchg(exchange)等全是数据信息传送指令,这种命令完成存储器和运行内存、存储器和寄存器中间的单独数据信息传输。
二、算术运算命令
例如,add、sub(substract)、adc(add with carry)、sbb(substract with borrow)、inc(increase)、dec(decrease)、cmp(compare)、imul(integer multiplication)、idiv(integer divide)、aaa(ASCII add with adjust)等全是算术运算命令,这种命令完成存储器和运行内存中的信息计算。他们的实行結果危害标志寄存器的 sf、zf、of、cf、pf、af 位。
三、逻辑性命令
例如,and、or、not、xor(exclusive or)、test、shl(shift logic left)、shr(shift logic right)、sal(shift arithmetic left)、sar(shift arithmetic right)、rol(rotate left)、ror(rotate right)、rcl(rotate left through carry)、rcr(rotate right through carry)等全是逻辑性命令。除开 not 命令外,他们的实行結果都危害标志寄存器的有关标志位。
此帖掩藏的內容
四、迁移命令
可以改动 IP,或与此同时改动 CS 和 IP 的命令通称为迁移命令。迁移命令分成下列几种。
(1) 没有理由迁移命令,例如,jmp(jump);
(2) 标准迁移命令,例如,jcxz(jump if CX is zero)、je(jump if equal)、jb(jump if below)、ja(jump if above)、jnb(jump if not below)、jna(jump if not above)等;
(3) 循环系统命令,例如,loop;
(4) 全过程,例如,call、ret(return)、retf(return far);
(5) 终断,例如,int(interrupt)、iret(interrupt return)。
五、回收器程序控制
这种命令对标志寄存器或别的回收器情况开展设定,例如,cld(clear direction)、std(set direction)、cli(clear interrupt)、sti(set interrupt)、nop(no operation)、clc(clear carry)、cmc(carry make change)、stc(set carry)、hlt(halt)、wait、esc(escape)、lock 等全是回收器程序控制。
六、串解决命令
这种命令对运行内存中的大批量数据信息完成解决,例如,movsb(move string byte)、movsw(move string word)、cmps(compare string)、scas(scan string)、lods(load string)、stos(store string)等。若要运用这种命令便捷地开展大批量数据处理方法,则要和 rep(repeat)、repe(repeat if equal)、repne(repeat if not equal)等作为前缀命令相互配合应用。
附:8086CPU 存储器英语全名
1、通用寄存器
AX(accumulator)、BX(base)、CX(count)、DX(data)这种存储器可以字(16 位)或字节数(8 位)企业方式浏览;
SP(stack pointer)、BP(base pointer)、SI(source index)、DI(destination index),这种存储器只有以字(16 位)企业方式浏览。
2、专用型存储器
IP(instruction pointer)、SP(stack pointer);;
FLAGS 又被称为 PSW(program status word) 分成:
① 标准码
OF(overflow)、SF(sign)、ZF(zero)、CF(carry)、AF(auxiliary)、PF(parity)
② 操纵标示
DF(direction)
③ 系统软件标志位
TF(trap)、IF(interrupt)、IOPL(I/O privilege level)
3、段存储器
CS(code)、DS(data)、SS(stack)、ES(extra)
汇编语言指令的英语全名
一、数据信息传送指令
1. 通用性数据信息传送指令.
MOV—-> move
MOVSX—->extended move with sign data
MOVZX—->extended move with zero data
PUSH—->push
POP—->pop
PUSHA—->push all
POPA—->pop all
PUSHAD—->push all data
POPAD—->pop all data
BSWAP—->byte swap
XCHG—->exchange
CMPXCHG—->compare and change
XADD—->exchange and add
XLAT—->translate
2. I/O端口号传送指令.
IN—->input
OUT—->output
3. 目地详细地址传送指令.
LEA—->load effective address
LDS—->load DS
LES—->load ES
LFS—->load FS
LGS—->load GS
LSS—->load SS
4. 标示传送指令.
LAHF—->load AH from flag
SAHF—->save AH to flag
PUSHF—->push flag
POPF—->pop flag
PUSHD—->push dflag
POPD—->pop dflag
二、算术运算命令
ADD—->add
ADC—->add with carry
INC—->increase 1
AAA—->ascii add with adjust
DAA—->decimal add with adjust
SUB—->substract
SBB—->substract with borrow
DEC—->decrease 1
NEC—->negative
CMP—->compare
AAS—->ascii adjust on substract
DAS—->decimal adjust on substract
MUL—->multiplication
IMUL—->integer multiplication
AAM—->ascii adjust on multiplication
DIV—->divide
IDIV—->integer divide
AAD—->ascii adjust on divide
CBW—->change byte to word
CWD—->change word to double word
CWDE—->change word to double word with sign to EAX
CDQ—->change double word to quadrate word
三、或运算命令
AND—->and
OR—->or
XOR—->xor Exclusive OR
NOT—->not
TEST—->test
SHL—->shift left
SAL—->arithmatic shift left 算数
SHR—->shift right
SAR—->arithmatic shift right
ROL—->rotate left
ROR—->rotate right
RCL—->rotate left with carry
RCR—->rotate right with carry
四、串命令
MOVS—->move string
CMPS—->compare string
SCAS—->scan string
LODS—->load string
STOS—->store string
REP—->repeat
REPE—->repeat when equal
REPZ—->repeat when zero flag
REPNE—->repeat when not equal
REPNZ—->repeat when zero flag
REPC—->repeat when carry flag
REPNC—->repeat when not carry flag
五、程序流程迁移命令
1 > 没有理由迁移命令 (长迁移)
JMP—->jump
CALL—->call
RET—->return
RETF—->return far
2 > 标准迁移命令 (短迁移,-128 到 127 的间距内)
JAE—->jump when above or equal
JNB—->jump when not below
JB—->jump when below
JNAE—->jump when not above or equal
JBE—->jump when below or equal
JNA—->jump when not above
JG—->jump when greater
JNLE—->jump when not less or equal
JGE—->jump when greater or equal
JNL—->jump when not less
JL—->jump when less
JNGE—->jump when not greater or equal
JLE—->jump when less or equal
JNG—->jump when not greater
JE—->jump when equal
JZ—->jump when has zero flag
JNE—->jump when not equal
JNZ—->jump when not has zero flag
JC—->jump when has carry flag
JNC—->jump when not has carry flag
JNO—->jump when not has overflow flag
JNP—->jump when not has parity flag
JPO—->jump when parity flag is odd
JNS—->jump when not has sign flag
JO—->jump when has overflow flag
JP—->jump when has parity flag
JPE—->jump when parity flag is even
JS—->jump when has sign flag
3 > 循环系统程序控制 (短迁移)
LOOP—->loop
LOOPE—->loop equal
LOOPZ—->loop zero
LOOPNE—->loop not equal
LOOPNZ—->loop not zero
JCXZ—->jump when CX is zero
JECXZ—->jump when ECX is zero
4 > 终断命令
INT—->interrupt
INTO—->overflow interrupt
IRET—->interrupt return
5 > CPU程序控制
HLT—->halt
WAIT—->wait
ESC—->escape
LOCK—->lock
NOP—->no operation
STC—->set carry
CLC—->clear carry
CMC—->carry make change
STD—->set direction
CLD—->clear direction
STI—->set interrupt
CLI—->clear interrupt
六、伪指令
DW—->definw word
PROC—->procedure
ENDP—->end of procedure
SEGMENT—->segment
ASSUME—->assume
ENDS—->end segment
END—->end
Move)
MOVC (Move Code)
MOVX (Move External)
XCH (Exchange)
PUSH
POP
AJMP (Absolute Jump)
LJMP (Long Jump)
SJMP (Short Jump)
JMP (Jump Indirect)
JZ (Jump Zero)
JNZ (Jump Not Zero)
JC (Jump if Carry)
JNC (Jump if Not Carry)
JB (Jump if Bit is set)
JNB (Jump if Not Bit)
JBC (If Bit is set and Clear Bit)
CJNE (Compare and Jump if Not Equal)
DJNZ (Decrement and Jump if Not Zero)
ACALL (Absolute Call)
LCALL (Long Call)
RET (Return)
NOP (No Operation)
ADD
ADDC (Add with Carry)
SUBB (Substract with Borrow)
MUL (Multiply)
DIV (Divide)
INC (Increment)
DEC (Decrement)
ANL (Logical AND)
ORL (Logical OR)
XRL (Logical Exclusive OR)
CPL (Complement)
CLR (Clear)
SEBT (Set Bit)
RL (Rotate Left)
RR (Rotate Right)
RLC (Rotate Left throught the Carry flag)
RRC (Rotate Right throught the Carry flag)
XCHD
SWAP
DA (Decimal Adjust)
ORG (Origin)
DB (Define Byte)
DW (Define Word)
EQU (Equal)
DATA
XDATA (External Data)
BIT
END
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。