您好,欢迎访问三七文档
当前位置:首页 > 电子/通信 > 综合/其它 > 2780X86汇编语言电子教案(3-2-全部)
——:zzzzzzCPUCPU1.2.3.4.5.3.380X86——12345——1MOVMOVSXMOVZXPUSHPOPPUSHA/PUSHADPOPA/POPADXCHG——11MOVMOVMOVDST,SRC(DST)←(SRC)zDSTCSzDSTSRCMzzzDSTSRC/DSSSESMCS——MOVAXBXMOVAHBHMOVAX[BX][SI]MOVBXXMOVMAST[BP][DI]ALMOVBL100MOVBYTEPTR[BX]2MOVDSAXMOVESXMOVAXDSMOVBXDAT1MOVDSES(MOVES100MOVEAX[EBX+ECX*4]——22MOVSXMOVSX386386MOVSXDST,SRC(DST)←(SRC)MOVSXREG1REG2MOVSXREGMEM8161632816321632MOVSX——33MOVZXMOVZX386386MOVZXDST,SRC(DST)←(SRC)MOVZXREG1REG2MOVZXREGMEMMOVSX0816321632MOVSXMOVZXMOVSX——44PUSH/POPPUSH/POPPUSHSRC16(SP)←(SP)-2((SP)+1,(SP))←(SRC)32(ESP)←(ESP)-4((ESP)+3,(ESP)+2,(ESP)+1,(ESP))←(SRC)POPDST16(DST)←((SP)+1,(SP))(SP)←(SP)+232(DST)←((ESP)+3,(ESP)+2(ESP)+1,(ESP))(ESP)←(ESP)+4——PCSP1.2.SSSPESP16SP32ESP——zzPUSHPUSHREGPUSHMEMPUSHDATAPUSHSEGREGPUSH8086zPOPPOPREGPOPMEMPOPSEGREGPOPDSTCSz——SPSP2/ESPESP2SPSP4/ESPESP41632163216163232PUSH/POP——(AX)=2107H,PUSHAXSP→SP→07H21H********PUSHAXPUSHAXPUSHAX——POPBXSP→SP→07H21H07H21H(BX)=2107HPOPBXPOPBX********POPBX——::PUSHX;XPUSHESPOPY;Y:(X)=1234H,(SS)=0FFA0H,ES)=2367H,(SP)=0100H,——100H::(SP)=100H(SP)=00FEH12H34H(X)=1234H12H34H00FEHES=(2367H)(SP)=00FCH23H67HY23H67H(SP)=PUSHXPUSHESPOPY——55PUSHA/PUPUSHA/PUSHADSHADPUSHAPUSHADPUSHA16AXCXDXBXSPBPSIDISPSP-16PUSHAD32EAXECXEDXEBXESPEBPESIEDIESPESP-16——66POPA/POPPOPA/POPADADPOPAPOPADPOPA16DISIBPSPBXDXCXAXSPSP+16POPAD32EDIESIEBPESPEBXEDXECXEAXESPESP+32PUSHAPOPA286PUSHADPOPAD386——z1.3.PUSHDS4.SUBAX,AXPUSHAX…………RET2.PUSHAXPUSHBX……POPBXPOPAX;——77XCHGXCHGXCHGOPR1,OPR2(OPR1)↔(OPR2)zOPR1OPR2zOPR1OPR2MzzOPR1OPR2//MOVAX,BX;AX↔BXMOVBUF,AX;BUF↔AXAXBXCXDXSPBPSIDIDSSSESMCS——AL2INOUTXLATEAXAXALINOUT/XLATXLATXLATXLATOPR16(AL)←((BX)+(AL))32(AL)←((EBX)+(AL))——MOVBX,OFFSETTABLE;(BX)=0040HMOVAL,3XLATTABLE(AL)=33Hzz(256)→(BX)()→(AL)(0)zOPR(BX)→30HF004031HF0041(AL)=332HF004233HF0043TABLE(DS)=F000H——31.LEAD,S;2.LDSD,S;DS3.LESD,S;ES1:BLOCK6DX():MOVBX,OFFSETBLOCKADDBX,10MOVDX,[BX]BLOCK10B1234H5678DX1234H4.LFSD,S;FS5.LGSD,S;GS6.LSSD,S;SS——LEAREG,SRC(REG)←SRCMOVBX,OFFSETBLOCKLEABX,BLOCK1616321616163232321632163216163232SRC——LEABX,BLOCKMOVBX,BLOCKBLOCK0100HBLOCK=3412HMOVBXBLOCKLEABXBLOCKLEABP[BX][DI+0F62H]BX=3412HBX=0100HBLOCK34H12H100HBX=0400HDI=003CHDS=0000HBP=0400H+003CH+0F62H=139EH——DSLDSREG,SRC(REG)←(SRC)(SREG)←(SRC+2)SREG←(SRC+4)z1632REGRRzSRCzzLFSLGSLSS386SRCSRC+4SRCSRC+2REG16REG32——LEABX,[BX+SI+0F62H]LEAMOVLDSSI,[10H]LESDI,[BX]TABLEDW40H,3000H,2000H(DS):1000H40H00H00H30HTABLEMOVBX,TABLE;(BX)=0040HMOVBX,OFFSETTABLE;(BX)=1000HLEABX,TABLE;(BX)=1000HLDSBX,TABLE;(BX)=0040H;(DS)=3000HLESBX,TABLE;(BX)=0040H;(ES)=3000HLSSESPTABLE;ESP=30000040H;(SS)=2000H00H20H——4LAHF/SAHFLAHF/SAHFPUSHF/PUSHFDPUSHF/PUSHFDPOPF/POPFDPOPF/POPFDAHLAHF(AH)←(FLAGS)AHSAHF(FLAG)←(AH)PUSHF/PUSHFDPUSHF:(SP)←(SP)-2((SP)+1,(SP))←(FLAGS)PUSHFD:(ESP)←(ESP)((ESP)+3,(ESP)+2(ESP)+1,(ESP))←(EFLAGSAND0FCFFFFH)——zzPOPF/POPFDPOPF:(FLAGS)←((SP)+1,(SP))(SP)←(SP)+2POPFD:(EFLAGS)←((ESP)+3,(ESP)+2(ESP)+1,(ESP))(ESP)←(ESP)+4——zLAHF/SAHF/5zPOPF/FLAGSzPOPFD/EFLAGS,VMRFIOPLVIFVIPTF=1PUSHFPOPFTF=1PUSHFPOPAXORAX,10H;TF1PUSHAXPOPF70SFTFZFAFPFCFIFDFOF——5CBWCWD/CWDECDQ4BSWAPCBWALAHAXCWD/CWDEAXDXDXAXCDQEAXEDXEDXEAXBSWAP486BSWAPR32R3232R32321423——(3)MOVSXMOVSXBX,ALMOVSXEAX,DXMOVZXMOVZXEAX,DXPUSHA/PUSHADAX,CX,DX,BX,SP,BP,SI,DI(SP)←(SP)-16EAX,ECX,EDX,EBX,ESP,EBP,ESI,EDI(ESP)←(ESP)-32POPA/POPADDI,SI,BP,SP,BX,DX,CX,AX(SP)←(SP)+16EDI,ESI,EBP,ESP,EBX,EDX,ECX,EAX(ESP)←(ESP)+32LFSFSLGSGSLSSSSPUSHFDPOPFD——CWDEEAXCDQ4EDX:EAXBSWAP32BSWAPEAX——1.1.zzzzzMRzMRR±±±RRM±±M——2.2.ADDDST,SRC(DST)←(SRC)+(DST)ADCDST,SRC(DST)←(SRC)+(DST)+CF1INCOPR(OPR)←(OPR)+1XADDDSTSRCTEMP←SRC+DSTSRC←DSTDST←TEMPzINCCFz386zXADD486SRCDST——CF/OF/ZF/SFCFOF10SF=100ZF=10CF=10OF=——00000111+1111101100000010(+7)+(-5)=+2OF=07+251=2CF=100000100+0000101100001111(+4)+(+11)=+15OF=04+11=15CF=000001001+0111110010000101:(+9)+(+124)=-123OF=1:9+124=133CF=010000111+1111010101111100(-121)+(-11)=+124OF=1135+245=124CF=1n=8bit(-128~127)(0~255)——808680286BXCXDXAXDX=0002HAX=0F365HBX=0005HCX=0E024H(1)ADDAX,CX(2)ADCDX,BX(1)AX=0D389HCF=1OF=0SF=1ZF=0(2)DX=0008HCF=0OF=0SF=0ZF=0803863232ADDEAXECX64——3.3.SUBDST,SRC(DST)←(DST)-(SRC)SBBDST,SRC(DST)←(DST)-(SRC)-CF1DECOPR(OPR)←(OPR)-1NEGOPR(OPR)←-(OPR)CMPOPR1,OPR2(OPR1)-(OPR2)——CMPXCHGDST,SRCACDSTAC=DSTZF1DSTSRCZF0ACDSTALAXEAXSRC81632DST486——8CMPXCHG8BDSTEDXEAXDSTEDXEAX=DSTZF1DSTECXEBXZF0EDXEAXDSTEDXEAX6464PentinumZFz386DECCF——CF/OF/ZF/SFCFOFNEGCF/OFCF0CF=0CF=1OF-128-32768OF=1OF=010CF=10OF=10CF=——SUB[SI+14H]0136HDS=3000HSI=0040H30054H=4336H4336-013601000011001101100000000100110110-01000011001101101111111011001010+010000100000000030054H=4200HSF=0ZF=0CF=0OF=0——xyzX,X+2Y,Y+2Z,Z+2w←x+y+24-zW,W+2wMOVAX,XMOVDX,X+2ADDAX,YADCDX,Y+2;x+yADDAX,24ADCDX,0;x+y+24SUBAX,ZSBBDX,Z+2;x+y+24-zMOVW,AXMOVW+2,DX;W,W+2——386MOVEAXXADDEAXYADDEAX24SUBEAXZMOVWEAX3864——1.1.MULSRC(AX)←(AL)*(SRC)(DX,AX)←(AX)*(SRC)EDXEAX←EAX*SRCIMULSRCMULzzAL(AX)EAXzAX(DX,AX)EDXEAXzSRCzCFOFzSRC386zSRCMR——CF/OF0011MUL:CF/OF=(AX)=16A5H(BX)=0611H(1)IMULBL;(AX)←(AL)*(BL);A5*11⇒5B*11=060B⇒F9F5;(AX)=0F9F5HCF=OF=1(2)MULBX;(DX,AX)←(AX)*(BX);16A5*0611=00895EF5;(DX)=0089H(AX)=5EF5HCF=OF=10011IMUL:CF/OF=——CFO
本文标题:2780X86汇编语言电子教案(3-2-全部)
链接地址:https://www.777doc.com/doc-4359619 .html