⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cpuops.s

📁 著名SFC模拟器Snes9x的源代码。
💻 S
📖 第 1 页 / 共 4 页
字号:
/* * Snes9x - Portable Super Nintendo Entertainment System (TM) emulator. * * (c) Copyright 1996 - 2001 Gary Henderson (gary@daniver.demon.co.uk) and *                           Jerremy Koot (jkoot@snes9x.com) * * Super FX C emulator code  * (c) Copyright 1997 - 1999 Ivar (Ivar@snes9x.com) and *                           Gary Henderson. * Super FX assembler emulator code (c) Copyright 1998 zsKnight and _Demo_. * * DSP1 emulator code (c) Copyright 1998 Ivar, _Demo_ and Gary Henderson. * C4 asm and some C emulation code (c) Copyright 2000 zsKnight and _Demo_. * C4 C code (c) Copyright 2001 Gary Henderson (gary@daniver.demon.co.uk). * * DOS port code contains the works of other authors. See headers in * individual files. * * Snes9x homepage: www.snes9x.com * * Permission to use, copy, modify and distribute Snes9x in both binary and * source form, for non-commercial purposes, is hereby granted without fee, * providing that this license information and copyright notice appear with * all copies and any derived work. * * This software is provided 'as-is', without any express or implied * warranty. In no event shall the authors be held liable for any damages * arising from the use of this software. * * Snes9x is freeware for PERSONAL USE only. Commercial users should * seek permission of the copyright holders first. Commercial use includes * charging money for Snes9x or software derived from Snes9x. * * The copyright holders request that bug fixes and improvements to the code * should be forwarded to them so everyone can benefit from the modifications * in future versions. * * Super NES and Super Nintendo Entertainment System are trademarks of * Nintendo Co., Limited and its subsidiary companies. */#include "asmstruc.h"#include "asmaddr.h"#include "asmops.h"#include "getset.S"/* ADC */Op69M1:	Immediate8 ADC	Adc8 IMM8Op69M0:	Immediate16 ADC2	Adc16 IMM16Op65M1:	Direct8 ADC2	call S9xGetByte	Adc8 DIR8Op65M0:	Direct8 ADC	call S9xGetWord	Adc16 DIR16	Op75M1:	DirectIndexedX8 ADC	call S9xGetByte	Adc8 DIX8Op75M0:	DirectIndexedX8 ADC2	call S9xGetWord	Adc16 DIX16Op72M1:	DirectIndirect8 ADC	call S9xGetByte	Adc8 DI8Op72M0:	DirectIndirect8 ADC2	call S9xGetWord	Adc16 DI16Op61M1:	DirectIndexedIndirect8 ADC	call S9xGetByte	Adc8 DII8Op61M0:	DirectIndexedIndirect8 ADC2	call S9xGetWord	Adc16 DII16Op71M1:	DirectIndirectIndexed8 ADC	call S9xGetByte	Adc8 DIIY8Op71M0:	DirectIndirectIndexed8 ADC2	call S9xGetWord	Adc16 DIIY16Op67M1:	DirectIndirectLong8 ADC	call S9xGetByte	Adc8 DIL8Op67M0:	DirectIndirectLong8 ADC2	call S9xGetWord	Adc16 DIL16Op77M1:	DirectIndirectIndexedLong8 ADC	call S9xGetByte	Adc8 DIIL8Op77M0:	DirectIndirectIndexedLong8 ADC2	call S9xGetWord	Adc16 DIIL8Op6DM1:	Absolute8 ADC	call S9xGetByte	Adc8 ABS8Op6DM0:	Absolute8 ADC2	call S9xGetWord	Adc16 ABS16Op7DM1:	AbsoluteIndexedX8 ADC	call S9xGetByte	Adc8 ABSX8Op7DM0:	AbsoluteIndexedX8 ADC2	call S9xGetWord	Adc16 ABSX16Op79M1:	AbsoluteIndexedY8 ADC	call S9xGetByte	Adc8 ABSY8Op79M0:	AbsoluteIndexedY8 ADC2	call S9xGetWord	Adc16 ABSY16Op6FM1:	AbsoluteLong8 ADC	call S9xGetByte	Adc8 ABSL8Op6FM0:	AbsoluteLong8 ADC2	call S9xGetWord	Adc16 ABSL16Op7FM1:	AbsoluteLongIndexedX8 ADC	call S9xGetByte	Adc8 ALX8Op7FM0:	AbsoluteLongIndexedX8 ADC2	call S9xGetWord	Adc16 ALX16Op63M1:	StackRelative8 ADC	call S9xGetByte	Adc8 SREL8Op63M0:	StackRelative8 ADC2	call S9xGetWord	Adc16 SREL16Op73M1:	StackRelativeIndirectIndexed8 ADC	call S9xGetByte	Adc8 SRII8Op73M0:	StackRelativeIndirectIndexed8 ADC2	call S9xGetWord	Adc16 SRII16/* AND */Op29M1:	Immediate8 AND	And8 IMM8Op29M0:	Immediate16 AND	And16 IMM16Op25M1:	Direct8 AND	call S9xGetByte	And8 DIR8Op25M0:	Direct8 AND2	call S9xGetWord	And16 DIR16Op35M1:	DirectIndexedX8 AND	call S9xGetByte	And8 DIX8Op35M0:	DirectIndexedX8 AND2	call S9xGetWord	And16 DIX16Op32M1:	DirectIndirect8 AND	call S9xGetByte	And8 DI8Op32M0:	DirectIndirect8 AND2	call S9xGetWord	And16 DI16Op21M1:	DirectIndexedIndirect8 AND	call S9xGetByte	And8 DII8Op21M0:	DirectIndexedIndirect8 AND2	call S9xGetWord	And16 DII16Op31M1:	DirectIndirectIndexed8 AND	call S9xGetByte	And8 DIIY8Op31M0:	DirectIndirectIndexed8 AND2	call S9xGetWord	And16 DIIY16Op27M1:	DirectIndirectLong8 AND	call S9xGetByte	And8 DIL8Op27M0:	DirectIndirectLong8 AND2	call S9xGetWord	And16 DIL16Op37M1:	DirectIndirectIndexedLong8 AND	call S9xGetByte	And8 DIIL8Op37M0:	DirectIndirectIndexedLong8 AND2	call S9xGetWord	And16 DIIL16Op2DM1:	Absolute8 AND	call S9xGetByte	And8 ABS8Op2DM0:	Absolute8 AND2	call S9xGetWord	And16 ABS16Op3DM1:	AbsoluteIndexedX8 AND	call S9xGetByte	And8 ABSX8Op3DM0:	AbsoluteIndexedX8 AND2	call S9xGetWord	And16 ABSX16Op39M1:	AbsoluteIndexedY8 AND	call S9xGetByte	And8 ABSY8Op39M0:	AbsoluteIndexedY8 AND2	call S9xGetWord	And16 ABSY16Op2FM1:	AbsoluteLong8 AND	call S9xGetByte	And8 ABSL8Op2FM0:	AbsoluteLong8 AND2	call S9xGetWord	And16 ABSL16Op3FM1:	AbsoluteLongIndexedX8 AND	call S9xGetByte	And8 ALX8Op3FM0:	AbsoluteLongIndexedX8 AND2	call S9xGetWord	And16 ALX16Op23M1:	StackRelative8 AND	call S9xGetByte	And8 SREL8Op23M0:	StackRelative8 AND2	call S9xGetWord	And16 SREL16Op33M1:	StackRelativeIndirectIndexed8 AND	call S9xGetByte	And8 SRII8Op33M0:	StackRelativeIndirectIndexed8 AND2	call S9xGetWord	And16 SRII16/* ASL */Op0AM1:	movb AL, %al#ifdef VAR_CYCLES	addl $6, CYCLES#endif	salb %al	movb %al, AL	SetZNC	jmp MainAsmLoopOp0AM0:	movw AA, %ax#ifdef VAR_CYCLES	addl $6, CYCLES#endif	salw %ax	movw %ax, AA	setnz _Zero	setc _Carry	movb %ah, _Negative	jmp MainAsmLoop	Op06M1:	Direct8 ASL	Asl8 DIR8Op06M0:	Direct8 ASL2	Asl16 DIR16Op16M1:	DirectIndexedX8 ASL	Asl8 DIXOp16M0:	DirectIndexedX8 ASL2	Asl16 DIXOp0EM1:	Absolute8 ASL	Asl8 ABSOp0EM0:	Absolute8 ASL2	Asl16 ABSOp1EM1:	AbsoluteIndexedX8 ASL	Asl8 ABSXOp1EM0:	AbsoluteIndexedX8 ASL2	Asl16 ABSX/* BIT */Op89M1:	Immediate8 BIT	andb AL, %al	movb %al, _Zero	jmp MainAsmLoopOp89M0:	Immediate16 BIT	andw AA, %ax	setnz _Zero	jmp MainAsmLoopOp24M1:	Direct8 BIT	Bit8 DIROp24M0:	Direct8 BIT	Bit16 DIROp34M1:	DirectIndexedX8 BIT	Bit8 DIXOp34M0:	DirectIndexedX8 BIT2	Bit16 DIXOp2CM1:	Absolute8 BIT	Bit8 ABSOp2CM0:	Absolute8 BIT2	Bit16 ABSOp3CM1:	AbsoluteIndexedX8 BIT	Bit8 ABSXOp3CM0:	AbsoluteIndexedX8 BIT2	Bit16 ABSX/* CMP */OpC9M1:	Immediate8 CMP	Cmp8 IMMOpC9M0:	Immediate16 CMP	Cmp16 IMMOpC5M1:	Direct8 CMP	call S9xGetByte	Cmp8 DIROpC5M0:	Direct8 CMP2	call S9xGetWord	Cmp16 DIROpD5M1:	DirectIndexedX8 CMP	call S9xGetByte	Cmp8 DIXOpD5M0:	DirectIndexedX8 CMP2	call S9xGetWord	Cmp16 DIXOpD2M1:	DirectIndirect8 CMP	call S9xGetByte	Cmp8 DIOpD2M0:	DirectIndirect8 CMP2	call S9xGetWord	Cmp16 DIOpC1M1:	DirectIndexedIndirect8 CMP	call S9xGetByte	Cmp8 DIIOpC1M0:	DirectIndexedIndirect8 CMP2	call S9xGetWord	Cmp16 DIIOpD1M1:	DirectIndirectIndexed8 CMP	call S9xGetByte	Cmp8 DIIYOpD1M0:	DirectIndirectIndexed8 CMP2	call S9xGetWord	Cmp16 DIIYOpC7M1:	DirectIndirectLong8 CMP	call S9xGetByte	Cmp8 DILOpC7M0:	DirectIndirectLong8 CMP2	call S9xGetWord	Cmp16 DILOpD7M1:	DirectIndirectIndexedLong8 CMP	call S9xGetByte	Cmp8 DIILOpD7M0:	DirectIndirectIndexedLong8 CMP2	call S9xGetWord	Cmp16 DIILOpCDM1:	Absolute8 CMP	call S9xGetByte	Cmp8 ABSOpCDM0:	Absolute8 CMP2	call S9xGetWord	Cmp16 ABSOpDDM1:	AbsoluteIndexedX8 CMP	call S9xGetByte	Cmp8 ABSXOpDDM0:	AbsoluteIndexedX8 CMP2	call S9xGetWord	Cmp16 ABSXOpD9M1:	AbsoluteIndexedY8 CMP	call S9xGetByte	Cmp8 ABSYOpD9M0:	AbsoluteIndexedY8 CMP2	call S9xGetWord	Cmp16 ABSYOpCFM1:	AbsoluteLong8 CMP	call S9xGetByte	Cmp8 ABSLOpCFM0:	AbsoluteLong8 CMP2	call S9xGetWord	Cmp16 ABSLOpDFM1:	AbsoluteLongIndexedX8 CMP	call S9xGetByte	Cmp8 ALXOpDFM0:	AbsoluteLongIndexedX8 CMP2	call S9xGetWord	Cmp16 ALXOpC3M1:	StackRelative8 CMP	call S9xGetByte	Cmp8 SRELOpC3M0:	StackRelative8 CMP2	call S9xGetWord	Cmp16 SRELOpD3M1:	StackRelativeIndirectIndexed8 CMP	call S9xGetByte	Cmp8 SRIIOpD3M0:	StackRelativeIndirectIndexed8 CMP2	call S9xGetWord	Cmp16 SRII/* CPX */OpE0X1:	Immediate8 CPX	Cpx8 IMMOpE0X0:	Immediate16 CPX	Cpx16 IMMOpE4X1:	Direct8 CPX	call S9xGetByte	Cpx8 DIROpE4X0:	Direct8 CPX2	call S9xGetWord	Cpx16 DIROpECX1:	Absolute8 CPX	call S9xGetByte	Cpx8 ABSOpECX0:	Absolute8 CPX2	call S9xGetWord	Cpx16 ABS/* CPY */OpC0X1:	Immediate8 CPY	Cpy8 IMMOpC0X0:	Immediate16 CPY	Cpy16 IMMOpC4X1:	Direct8 CPY	call S9xGetByte	Cpy8 DIROpC4X0:	Direct8 CPY2	call S9xGetWord	Cpy16 DIROpCCX1:	Absolute8 CPY	call S9xGetByte	Cpy8 ABSOpCCX0:	Absolute8 CPY2	call S9xGetWord	Cpy16 ABS/* DEC */Op3AM1:	movb AL, %al#ifdef VAR_CYCLES	addl $6, CYCLES#endif	decb %al#ifdef CPU_SHUTDOWN	movl $0, WaitAddress#endif	movb %al, AL	SetZN	jmp MainAsmLoopOp3AM0:#ifdef VAR_CYCLES	addl $6, CYCLES#endif	decw AA	setnz _Zero	movb AH, %al#ifdef CPU_SHUTDOWN	movl $0, WaitAddress#endif	movb %al, _Negative	jmp MainAsmLoopOpC6M1:	Direct8 DEC	Dec8 DIROpC6M0:	Direct8 DEC2	Dec16 DIROpD6M1:	DirectIndexedX8 DEC	Dec8 DIXOpD6M0:	DirectIndexedX8 DEC2	Dec16 DIXOpCEM1:	Absolute8 DEC	Dec8 ABSOpCEM0:	Absolute8 DEC2	Dec16 ABSOpDEM1:	AbsoluteIndexedX8 DEC	Dec8 ABSXOpDEM0:	AbsoluteIndexedX8 DEC2	Dec16 ABSX/* EOR */Op49M1:	Immediate8 EOR	Eor8 IMMOp49M0:	Immediate16 EOR	Eor16 IMMOp45M1:	Direct8 EOR	call S9xGetByte	Eor8 DIROp45M0:	Direct8 EOR2	call S9xGetWord	Eor16 DIROp55M1:	DirectIndexedX8 EOR	call S9xGetByte	Eor8 DIXOp55M0:	DirectIndexedX8 EOR2	call S9xGetWord	Eor16 DIXOp52M1:	DirectIndirect8 EOR	call S9xGetByte	Eor8 DIOp52M0:	DirectIndirect8 EOR2	call S9xGetWord	Eor16 DIOp41M1:	DirectIndexedIndirect8 EOR	call S9xGetByte	Eor8 DIIOp41M0:	DirectIndexedIndirect8 EOR2	call S9xGetWord	Eor16 DIIOp51M1:	DirectIndirectIndexed8 EOR	call S9xGetByte	Eor8 DIIYOp51M0:	DirectIndirectIndexed8 EOR2	call S9xGetWord	Eor16 DIIYOp47M1:	DirectIndirectLong8 EOR	call S9xGetByte	Eor8 DILOp47M0:	DirectIndirectLong8 EOR2	call S9xGetWord	Eor16 DILOp57M1:	DirectIndirectIndexedLong8 EOR	call S9xGetByte	Eor8 DIILOp57M0:	DirectIndirectIndexedLong8 EOR2	call S9xGetWord	Eor16 DIILOp4DM1:	Absolute8 EOR	call S9xGetByte	Eor8 ABSOp4DM0:	Absolute8 EOR2	call S9xGetWord	Eor16 ABSOp5DM1:	AbsoluteIndexedX8 EOR	call S9xGetByte	Eor8 ABSXOp5DM0:	AbsoluteIndexedX8 EOR2	call S9xGetWord	Eor16 ABSXOp59M1:	AbsoluteIndexedY8 EOR	call S9xGetByte	Eor8 ABSYOp59M0:	AbsoluteIndexedY8 EOR2	call S9xGetWord	Eor16 ABSYOp4FM1:	AbsoluteLong8 EOR	call S9xGetByte	Eor8 ABSLOp4FM0:	AbsoluteLong8 EOR2	call S9xGetWord	Eor16 ABSLOp5FM1:	AbsoluteLongIndexedX8 EOR	call S9xGetByte	Eor8 ALXOp5FM0:	AbsoluteLongIndexedX8 EOR2	call S9xGetWord	Eor16 ALXOp43M1:	StackRelative8 EOR	call S9xGetByte	Eor8 SRELOp43M0:	StackRelative8 EOR2	call S9xGetWord	Eor16 SRELOp53M1:	StackRelativeIndirectIndexed8 EOR	call S9xGetByte	Eor8 SRIIOp53M0:	StackRelativeIndirectIndexed8 EOR2	call S9xGetWord	Eor16 SRII/* INC */Op1AM1:	movb AL, %al#ifdef VAR_CYCLES	addl $6, CYCLES#endif	incb %al#ifdef CPU_SHUTDOWN	movl $0, WaitAddress#endif	movb %al, AL	SetZN	jmp MainAsmLoopOp1AM0:#ifdef VAR_CYCLES	addl $6, CYCLES#endif	incw AA	setnz _Zero	movb AH, %ah#ifdef CPU_SHUTDOWN	movl $0, WaitAddress#endif	movb %ah, _Negative	jmp MainAsmLoopOpE6M1:	Direct8 INC	Inc8 DIROpE6M0:	Direct8 INC2	Inc16 DIR	OpF6M1:	DirectIndexedX8 INC	Inc8 DIXOpF6M0:	DirectIndexedX8 INC2	Inc16 DIXOpEEM1:	Absolute8 INC	Inc8 ABSOpEEM0:	Absolute8 INC2	Inc16 ABSOpFEM1:	AbsoluteIndexedX8 INC	Inc8 ABSXOpFEM0:	AbsoluteIndexedX8 INC2	Inc16 ABSX/* LDA */OpA9M1:	Immediate8 LDA	Lda8 IMMOpA9M0:	Immediate16 LDA	Lda16 IMMOpA5M1:	Direct8 LDA	call S9xGetByte	Lda8 DIROpA5M0:	Direct8 LDA2	call S9xGetWord	Lda16 DIROpB5M1:	DirectIndexedX8 LDA	call S9xGetByte	Lda8 DIXOpB5M0:	DirectIndexedX8 LDA2	call S9xGetWord	Lda16 DIXOpB2M1:	DirectIndirect8 LDA	call S9xGetByte	Lda8 DIOpB2M0:	DirectIndirect8 LDA2	call S9xGetWord	Lda16 DIOpA1M1:	DirectIndexedIndirect8 LDA	call S9xGetByte	Lda8 DIIOpA1M0:	DirectIndexedIndirect8 LDA2	call S9xGetWord	Lda16 DIIOpB1M1:	DirectIndirectIndexed8 LDA	call S9xGetByte	Lda8 DIIYOpB1M0:	DirectIndirectIndexed8 LDA2	call S9xGetWord	Lda16 DIIYOpA7M1:	DirectIndirectLong8 LDA	call S9xGetByte	Lda8 DILOpA7M0:	DirectIndirectLong8 LDA2	call S9xGetWord	Lda16 DILOpB7M1:	DirectIndirectIndexedLong8 LDA	call S9xGetByte	Lda8 DIILOpB7M0:	DirectIndirectIndexedLong8 LDA2	call S9xGetWord	Lda16 DIILOpADM1:	Absolute8 LDA	call S9xGetByte	Lda8 ABSOpADM0:	Absolute8 LDA2	call S9xGetWord	Lda16 ABSOpBDM1:	AbsoluteIndexedX8 LDA	call S9xGetByte	Lda8 ABSXOpBDM0:	AbsoluteIndexedX8 LDA2	call S9xGetWord	Lda16 ABSXOpB9M1:	AbsoluteIndexedY8 LDA	call S9xGetByte	Lda8 ABSYOpB9M0:	AbsoluteIndexedY8 LDA2	call S9xGetWord	Lda16 ABSYOpAFM1:	AbsoluteLong8 LDA	call S9xGetByte	Lda8 ABSLOpAFM0:	AbsoluteLong8 LDA2	call S9xGetWord	Lda16 ABSLOpBFM1:	AbsoluteLongIndexedX8 LDA	call S9xGetByte	Lda8 ALXOpBFM0:	AbsoluteLongIndexedX8 LDA2	call S9xGetWord	Lda16 ALXOpA3M1:	StackRelative8 LDA	call S9xGetByte	Lda8 SRELOpA3M0:	StackRelative8 LDA2	call S9xGetWord	Lda16 SRELOpB3M1:	StackRelativeIndirectIndexed8 LDA	call S9xGetByte	Lda8 SRIIOpB3M0:	StackRelativeIndirectIndexed8 LDA2	call S9xGetWord	Lda16 SRII/* LDX */OpA2X1:	Immediate8 LDX	Ldx8 IMMOpA2X0:	Immediate16 LDX	Ldx16 IMMOpA6X1:	Direct8 LDX	call S9xGetByte	Ldx8 DIROpA6X0:	Direct8 LDX2	call S9xGetWord	Ldx16 DIROpB6X1:	DirectIndexedY8 LDX	call S9xGetByte	Ldx8 DIYOpB6X0:	DirectIndexedY8 LDX2	call S9xGetWord	Ldx16 DIYOpAEX1:	Absolute8 LDX	call S9xGetByte	Ldx8 ABS

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -