INTEL汇编指令集.docx
《INTEL汇编指令集.docx》由会员分享,可在线阅读,更多相关《INTEL汇编指令集.docx(75页珍藏版)》请在冰点文库上搜索。
INTEL汇编指令集
INTEL汇编指令集
IntelAssembleInstructionSet
CONTENT
Intel8086FamilyArchitecture
InstructionClockCycleCalculation
8088/8086EffectiveAddress(EA)Calculation
TaskStateCalculation
FLAGS-Intel8086FamilyFlagsRegister
MSW-MachineStatusWord(286+only)
8086/80186/80286/80386/80486InstructionSet
AAA-AsciiAdjustforAddition
AAD-AsciiAdjustforDivision
AAM-AsciiAdjustforMultiplication
AAS-AsciiAdjustforSubtraction
ADC-AddWithCarry
ADD-ArithmeticAddition
AND-LogicalAnd
ARPL-AdjustedRequestedPrivilegeLevelofSelector(286+PM)
BOUND-ArrayIndexBoundCheck(80188+)
BSF-BitScanForward(386+)
BSR-BitScanReverse(386+)
BSWAP-ByteSwap(486+)
BT-BitTest(386+)
BTC-BitTestwithCompliment(386+)
BTR-BitTestwithReset(386+)
BTS-BitTestandSet(386+)
CALL-ProcedureCall
CBW-ConvertBytetoWord
CDQ-ConvertDoubletoQuad(386+)
CLC-ClearCarry
CLD-ClearDirectionFlag
CLI-ClearInterruptFlag(disable)
CLTS-ClearTaskSwitchedFlag(286+privileged)
CMC-ComplementCarryFlag
CMP-Compare
CMPS-CompareString(Byte,WordorDoubleword)
CMPXCHG-CompareandExchange
CWD-ConvertWordtoDoubleword
CWDE-ConvertWordtoExtendedDoubleword(386+)
DAA-DecimalAdjustforAddition
DAS-DecimalAdjustforSubtraction
DEC-Decrement
DIV-Divide
ENTER-MakeStackFrame(80188+)
ESC-Escape
HLT-HaltCPU
IDIV-SignedIntegerDivision
IMUL-SignedMultiply
IN-InputByteorWordFromPort
INC-Increment
INS-InputStringfromPort(80188+)
INT-Interrupt
INTO-InterruptonOverflow
INVD-InvalidateCache(486+)
INVLPG-InvalidateTranslationLook-AsideBufferEntry(486+)
IRET/IRETD-InterruptReturn
Jxx-JumpInstructionsTable
JCXZ/JECXZ-JumpifRegister(E)CXisZero
JMP-UnconditionalJump
LAHF-LoadRegisterAHFromFlags
LAR-LoadAccessRights(286+protected)
LDS-LoadPointerUsingDS
LEA-LoadEffectiveAddress
LEAVE-RestoreStackforProcedureExit(80188+)
LES-LoadPointerUsingES
LFS-LoadPointerUsingFS(386+)
LGDT-LoadGlobalDescriptorTable(286+privileged)
LIDT-LoadInterruptDescriptorTable(286+privileged)
LGS-LoadPointerUsingGS(386+)
LLDT-LoadLocalDescriptorTable(286+privileged)
LMSW-LoadMachineStatusWord(286+privileged)
LOCK-LockBus
LODS-LoadString(Byte,WordorDouble)
LOOP-DecrementCXandLoopifCXNotZero
LOOPE/LOOPZ-LoopWhileEqual/LoopWhileZero
LOOPNZ/LOOPNE-LoopWhileNotZero/LoopWhileNotEqual
LSL-LoadSegmentLimit(286+protected)
LSS-LoadPointerUsingSS(386+)
LTR-LoadTaskRegister(286+privileged)
MOV-MoveByteorWord
MOVS-MoveString(ByteorWord)
MOVSX-MovewithSignExtend(386+)
MOVZX-MovewithZeroExtend(386+)
MUL-UnsignedMultiply
NEG-Two'sComplementNegation
NOP-NoOperation(90h)
NOT-One'sComplimentNegation(LogicalNOT)
OR-InclusiveLogicalOR
OUT-OutputDatatoPort
OUTS-OutputStringtoPort(80188+)
POP-PopWordoffStack
POPA/POPAD-PopAllRegistersontoStack(80188+)
POPF/POPFD-PopFlagsoffStack
PUSH-PushWordontoStack
PUSHA/PUSHAD-PushAllRegistersontoStack(80188+)
PUSHF/PUSHFD-PushFlagsontoStack
RCL-RotateThroughCarryLeft
RCR-RotateThroughCarryRight
REP-RepeatStringOperation
REPE/REPZ-RepeatEqual/RepeatZero
REPNE/REPNZ-RepeatNotEqual/RepeatNotZero
RET/RETF-ReturnFromProcedure
ROL-RotateLeft
ROR-RotateRight
SAHF-StoreAHRegisterintoFLAGS
SAL/SHL-ShiftArithmeticLeft/ShiftLogicalLeft
SAR-ShiftArithmeticRight
SBB-SubtractwithBorrow/Carry
SCAS-ScanString(Byte,WordorDoubleword)
SETAE/SETNB-SetifAboveorEqual/SetifNotBelow(386+)
SETB/SETNAE-SetifBelow/SetifNotAboveorEqual(386+)
SETBE/SETNA-SetifBeloworEqual/SetifNotAbove(386+)
SETE/SETZ-SetifEqual/SetifZero(386+)
SETNE/SETNZ-SetifNotEqual/SetifNotZero(386+)
SETL/SETNGE-SetifLess/SetifNotGreaterorEqual(386+)
SETGE/SETNL-SetifGreaterorEqual/SetifNotLess(386+)
SETLE/SETNG-SetifLessorEqual/SetifNotgreaterorEqual(386+)
SETG/SETNLE-SetifGreater/SetifNotLessorEqual(386+)
SETS-SetifSigned(386+)
SETNS-SetifNotSigned(386+)
SETC-SetifCarry(386+)
SETNC-SetifNotCarry(386+)
SETO-SetifOverflow(386+)
SETNO-SetifNotOverflow(386+)
SETP/SETPE-SetifParity/SetifParityEven(386+)
SETNP/SETPO-SetifNoParity/SetifParityOdd(386+)
SGDT-StoreGlobalDescriptorTable(286+privileged)
SIDT-StoreInterruptDescriptorTable(286+privileged)
SHL-ShiftLogicalLeft
SHR-ShiftLogicalRight
SHLD/SHRD-DoublePrecisionShift(386+)
SLDT-StoreLocalDescriptorTable(286+privileged)
SMSW-StoreMachineStatusWord(286+privileged)
STC-SetCarry
STD-SetDirectionFlag
STI-SetInterruptFlag(EnableInterrupts)
STOS-StoreString(Byte,WordorDoubleword)
STR-StoreTaskRegister(286+privileged)
SUB-Subtract
TEST-TestForBitPattern
VERR-VerifyRead(286+protected)
VERW-VerifyWrite(286+protected)
WAIT/FWAIT-EventWait
WBINVD-Write-BackandInvalidateCache(486+)
XCHG-Exchange
XLAT/XLATB-Translate
XOR-ExclusiveOR
TEXT
Intel8086FamilyArchitecture
GeneralPurposeRegistersSegmentRegisters
AH/ALAX(EAX)AccumulatorCSCodeSegment
BH/BLBX(EBX)BaseDSDataSegment
CH/CLCX(ECX)CounterSSStackSegment
DH/DLDX(EDX)DataESExtraSegment
(FS)386andnewer
(Exx)indicates386+32bitregister(GS)386andnewer
PointerRegistersStackRegisters
SI(ESI)SourceIndexSP(ESP)StackPointer
DI(EDI)DestinationIndexBP(EBP)BasePointer
IPInstructionPointer
StatusRegisters
FLAGSStatusFlags(seeFLAGS)
SpecialRegisters(386+only)
CR0ControlRegister0DR0DebugRegister0
CR2ControlRegister2DR1DebugRegister1
CR3ControlRegister3DR2DebugRegister2
DR3DebugRegister3
TR4TestRegister4DR6DebugRegister6
TR5TestRegister5DR7DebugRegister7
TR6TestRegister6
TR7TestRegister7
RegisterDefaultSegmentValidOverrides
BPSSDS,ES,CS
SIorDIDSES,SS,CS
DIstringsESNone
SIstringsDSES,SS,CS
-seeCPUDETECTINGInstructionTiming
InstructionClockCycleCalculation
Someinstructionsrequireadditionalclockcyclesduetoa"Next
InstructionComponent"identifiedbya"+m"intheinstruction
clockcyclelistings.Thisisduetotheprefetchqueuebeing
purgeonacontroltransfers.Belowisthegeneralrulefor
calculating"m":
88/86notapplicable
286"m"isthenumberofbytesinthenextinstruction
386"m"isthenumberofcomponentsinthenextinstruction
(theinstructioncoding(eachbyte),plusthedataand
thedisplacementareallconsideredcomponents)
8088/8086EffectiveAddress(EA)Calculation
DescriptionClockCycles
Displacement6
BaseorIndex(BX,BP,SI,DI)5
Displacement+(BaseorIndex)9
Base+Index(BP+DI,BX+SI)7
Base+Index(BP+SI,BX+DI)8
Base+Index+Displacement(BP+DI,BX+SI)11
Base+Index+Displacement(BP+SI+disp,BX+DI+disp)12
-add4cyclesforwordoperandsatoddaddresses
-add2cyclesforsegmentoverride
-80188/80186timingsdifferfromthoseofthe8088/8086/80286
TaskStateCalculation
"TS"isdefinedasswitchingfromVM/486or80286TSStooneof
thefollowing:
+---------------------------------------+
|NewTask|
+-------+-------+-------+-------+-------+
+---------------+486TSS|486TSS|386TSS|386TSS|286TSS|
|OldTask|(VM=0)|(VM=1)|(VM=0)|(VM=1)||
+---------------+-------+-------+-------+-------+-------+
386TSS(VM=0)|||309|226|282|
+-------+-------+-------+-------+-------+
386TSS(VM=1)|||314|231|287|
+-------+-------+-------+-------+-------+
386CPU/286TSS|||307|224|280|
+-------+-------+-------+-------+-------+
486CPU/286TSS|199|177|||180|
+---------------------------------------+
Miscellaneous
-alltimingsareforbestcaseanddonottakeintoaccountwait
states,instructionalignment,thestateoftheprefetchqueue,
DMArefreshcycles,cachehits/missesorexceptionprocessing.
-toconvertclockstonanosecondsdivideonemicrosecondbythe
processorspeedinMegaHertz:
(1000MHz/(nMHz))=Xnanoseconds
-see8086Architecture
FLAGS-Intel8086FamilyFlagsRegister
|11|10|F|E|D|C|B|A|9|8|7|6|5|4|3|2|1|0|
|||||||||||||||||+---CFCarryFlag
||||||||||||||||+---1
|||||||||||||||+---PFParityFlag
||||||||||||||+---0
|||||||||||||+---AFAuxiliaryFlag
||||||||||||+---0
|||||||||||+---ZFZeroFlag
||||||||||+---SFSignFlag
|||||||||+---TFTrapFlag(SingleStep)
||||||||+---IFInterruptFlag
|||||||+---DFDirectionFlag
||||||+---OFOverflowflag
||||+-----IOPLI/OPrivilegeLevel(286+only)
|||+-----NTNestedTaskFlag(286+only)
||+-----0
|+-----RFResumeFlag(386+only)
+------VMVirtualModeFlag(386+only)
-seePUSHFPOPFSTICLISTDCLD
MSW-MachineStatusWord(286+only)
|31|30-5|4|3|2|1|0|MachineStatusWord
||||||+----ProtectionEnable(PE)
|||||+-----MathPresent(MP)
||||+------Emulation(EM)
|||+-------TaskSwitched(TS)
||+--------ExtensionType(ET)
|+----------Reserved
+-------------Paging(PG)
Bit0PEProtectionEnable,switchesprocessorbetween
protectedandrealmode
Bit1MPMathPresent,controlsfunc