您好,欢迎访问三七文档
当前位置:首页 > 行业资料 > 其它行业文档 > 6502指令集(英文)
6502/6510/8500/8502Opcodematrix:imm=#$00zp=$00zpx=$00,Xzpy=$00,Yizx=($00,X)izy=($00),Yabs=$0000abx=$0000,Xaby=$0000,Yind=($0000)rel=$0000(PC-relative)x0x1x2x3x4x5x6x7x8x9xAxBxCxDxExF0xBRK7ORAizx6KILSLOizx8NOPzp3ORAzp3ASLzp5SLOzp5PHP3ORAimm2ASL2ANCimm2NOPabs4ORAabs4ASLabs6SLOabs61xBPLrel2*ORAizy5*KILSLOizy8NOPzpx4ORAzpx4ASLzpx6SLOzpx6CLC2ORAaby4*NOP2SLOaby7NOPabx4*ORAabx4*ASLabx7SLOabx72xJSRabs6ANDizx6KILRLAizx8BITzp3ANDzp3ROLzp5RLAzp5PLP4ANDimm2ROL2ANCimm2BITabs4ANDabs4ROLabs6RLAabs63xBMIrel2*ANDizy5*KILRLAizy8NOPzpx4ANDzpx4ROLzpx6RLAzpx6SEC2ANDaby4*NOP2RLAaby7NOPabx4*ANDabx4*ROLabx7RLAabx74xRTI6EORizx6KILSREizx8NOPzp3EORzp3LSRzp5SREzp5PHA3EORimm2LSR2ALRimm2JMPabs3EORabs4LSRabs6SREabs65xBVCrel2*EORizy5*KILSREizy8NOPzpx4EORzpx4LSRzpx6SREzpx6CLI2EORaby4*NOP2SREaby7NOPabx4*EORabx4*LSRabx7SREabx76xRTSADKILRRNOADRORRPLADROARJMADRORR6Cizx6Aizx8Pzp3Czp3Rzp5Azp5A4Cimm2R2Rimm2Pind5Cabs4Rabs6Aabs67xBVSrel2*ADCizy5*KILRRAizy8NOPzpx4ADCzpx4RORzpx6RRAzpx6SEI2ADCaby4*NOP2RRAaby7NOPabx4*ADCabx4*RORabx7RRAabx78xNOPimm2STAizx6NOPimm2SAXizx6STYzp3STAzp3STXzp3SAXzp3DEY2NOPimm2TXA2XAAimm2STYabs4STAabs4STXabs4SAXabs49xBCCrel2*STAizy6KILAHXizy6STYzpx4STAzpx4STXzpy4SAXzpy4TYA2STAaby5TXS2TASaby5SHYabx5STAabx5SHXaby5AHXaby5AxLDYimm2LDAizx6LDXimm2LAXizx6LDYzp3LDAzp3LDXzp3LAXzp3TAY2LDAimm2TAX2LAXimm2LDYabs4LDAabs4LDXabs4LAXabs4BxBCSrel2*LDAizy5*KILLAXizy5*LDYzpx4LDAzpx4LDXzpy4LAXzpy4CLV2LDAaby4*TSX2LASaby4*LDYabx4*LDAabx4*LDXaby4*LAXaby4*CxCPYimm2CMPizx6NOPimm2DCPizx8CPYzp3CMPzp3DECzp5DCPzp5INY2CMPimm2DEX2AXSimm2CPYabs4CMPabs4DECabs6DCPabs6DxBNErel2*CMPizy5*KILDCPizy8NOPzpx4CMPzpx4DECzpx6DCPzpx6CLD2CMPaby4*NOP2DCPaby7NOPabx4*CMPabx4*DECabx7DCPabx7ExCPXimm2SBCizx6NOPimm2ISCizx8CPXzp3SBCzp3INCzp5ISCzp5INX2SBCimm2NOP2SBCimm2CPXabs4SBCabs4INCabs6ISCabs6FxBEQrel2*SBCizy5*KILISCizy8NOPzpx4SBCzpx4INCzpx6ISCzpx6SED2SBCaby4*NOP2ISCaby7NOPabx4*SBCabx4*INCabx7ISCabx7*:add1cycleifpageboundaryiscrossed.add1cycleonbranchesiftaken.Logicalandarithmeticcommands:OpcodeimpimmzpzpxzpyizxizyabsabxabyindrelFunctionNVBDIZCORA$09$05$15$01$11$0D$1D$19A:=Aor{adr}**AND$29$25$35$21$31$2D$3D$39A:=A&{adr}**EOR$49$45$55$41$51$4D$5D$59A:=Aexor{adr}**ADC$69$65$75$61$71$6D$7D$79A:=A+{adr}****SBC$E9$E5$F5$E1$F1$ED$FD$F9A:=A-{adr}****CMP$C9$C5$D5$C1$D1$CD$DD$D9A-{adr}***CPX$E0$E4$ECX-{adr}***CPY$C0$C4$CCY-{adr}***DEC$C6$D6$CE$DE{adr}:={adr}-1**DEX$CAX:=X-1**DEY$88Y:=Y-1**INC$E6$F6$EE$FE{adr}:={adr}+1**INX$E8X:=X+1**INY$C8Y:=Y+1**ASL$0A$06$16$0E$1E{adr}:={adr}*2***ROL$2A$26$36$2E$3E{adr}:={adr}*2+C***LSR$4A$46$56$4E$5E{adr}:={adr}/2***ROR$6$6$76$6E$7E{adr}:={adr}/2+C****A6128Movecommands:OpcodeimpimmzpzpxzpyizxizyabsabxabyindrelFunctionNVBDIZCLDA$A9$A5$B5$A1$B1$AD$BD$B9A:={adr}**STA$85$95$81$91$8D$9D$99{adr}:=ALDX$A2$A6$B6$AE$BEX:={adr}**STX$86$96$8E{adr}:=XLDY$A0$A4$B4$AC$BCY:={adr}**STY$84$94$8C{adr}:=YTAX$AAX:=A**TXA$8AA:=X**TAY$A8Y:=A**TYA$98A:=Y**TSX$BAX:=S**TXS$9AS:=XPLA$68A:=+(S)**PHA$48(S)-:=APLP$28P:=+(S)******PHP$08(S)-:=PJump/Flagcommands:OpcodeimpimmzpzpxzpyizxizyabsabxabyindrelFunctionNVBDIZCBPL$10branchonN=0BMI$30branchonN=1BVC$50branchonV=0BVS$70branchonV=1BCC$90branchonC=0BCS$B0branchonC=1BNE$D0branchonZ=0BEQ$F0branchonZ=1BRK$00(S)-:=PC,P11PC:=($FFFE)RTI$40P,PC:=+(S)******JSR$20(S)-:=PCPC:={adr}RTS$60PC:=+(S)JMP$4C$6CPC:={adr}BIT$24$2CN:=b7V:=b6Z:=A&{adr}***CLC$18C:=00SEC$38C:=11CLD$D8D:=00SED$F8D:=11CLI$58I:=00SEI$78I:=11CLV$B8V:=00NOP$EAFlagsofthestatusregister:Theprocessorstatusregisterhas8bits,where7areusedasflags:N=negativeflag(1whenresultisnegative)V=overflowflag(1onsignedoverflow)#=unused(always1)B=breakflag(1wheninteruptwascausedbyaBRK)D=decimalflag(1whenCPUinBCDmode)I=IRQflag(when1,nointeruptswilloccur(exceptionsareIRQsforcedbyBRKandNMIs))Z=zeroflag(1whenallbitsofaresultare0)C=carryflag(1onunsignedoverflow)Hardwarevectors:$FFFA=NMIvector(NMI=notmaskableinterupts)$FFFC=Resetvector$FFFE=IRQvectorIllegalopcodes:OpcodeimpimmzpzpxzpyizxizyabsabxabyindrelFunctionNVBDIZCSLO$07$17$03$13$0F$1F$1B{adr}:={adr}*2A:=Aor{adr}***RLA$27$37$23$33$2F$3F$3B{adr}:={adr}rolA:=Aand{adr}***SRE$47$57$43$53$4F$5F$5B{adr}:={adr}/2A:=Aexor{adr}***RRA$67$77$63$73$6F$7F$7B{adr}:={adr}rorA:=Aadc{adr}****SAX$87$97$83$8F{adr}:=A&XLAX$A7$B7$A3$B3$AF$BFA,X:={adr}**DCP$C7$D7$C3$D3$CF$DF$DB{adr}:={adr}-1A-{adr}***ISC$E7$F7$E3$F3$EF$FF$FB{adr}:={adr}+1A:=A-{adr}****ANC$0BA:=A{imm}***ANC$2BA:=A{imm}***ALR$4BA:=(A{imm})/2***ARR$6BA:=(A{imm})/2****XAA²$8BA:=X{imm}**LAX²$ABA,X:=#{imm}**AXS$CBX:=A&X-#{imm}***SBC$EBA:=A-#{imm}****AHX¹$93$9F{adr}:=A&X&HSHY¹$9C{adr}:=Y&HSHX¹$9E{adr}:=X&HTAS¹$9BS:=A&X{adr}:=S&HLAS$BBA,X,S:={adr}&S**¹=unstableincertainmatters²=highlyunstable(resultsarenotpredictableonsomemachines)A=AkkumulatorX=X-RegisterY=Y-RegisterS=Stack-PointerP=Status-Register+(S)=Stack-Pointerrelativewithpre-increment(S)-=Stack-Pointerrelativewithpost-decrementCombinationsoftwooperationswiththesameaddressingmode:SLO{adr}=ASL{adr}+ORA{adr}RLA{adr}=ROL{adr}+AND{adr}SRE{adr}=LSR{adr}+EOR{adr}RRA{adr}=ROR{adr}+ADC{adr}SAX{adr}=storeA&Xinto{adr}LAX{adr}=LDA{adr}+LDX{adr}DCP{adr}=D
本文标题:6502指令集(英文)
链接地址:https://www.777doc.com/doc-7094967 .html