Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do you support custom opcodes? #145

Open
GZYangKui opened this issue Nov 5, 2023 · 4 comments
Open

Do you support custom opcodes? #145

GZYangKui opened this issue Nov 5, 2023 · 4 comments

Comments

@GZYangKui
Copy link

I am implementing an emulator and would like to customize some exclusive operation codes for the emulator. Do you currently support custom operation codes?

@GrantMTG
Copy link

GrantMTG commented Nov 5, 2023

Define Constant Byte doesn't work for you?

@GZYangKui
Copy link
Author

I have defined a constant with a value equal to $55 in my emulator, which is a debugging instruction. Then, when I embed this constant into the program and compile using dasm, the following error will occur:

BMAN. s (8): error: Unknown Mnemonic 'DEBUG'
BMAN. s (18): error: Unknown Mnemonic 'DEBUG'

DEBUG EQU $ff
RESET:
SEI; Reset PPU Disable NMI, turn off background and sprites
LDA # 0
STA PPU_ CTRL_ REG2
STA PPU_ CTRL_ REG1
CLD; The NES 6502 CPU has no BCD mode, reset the flag just in case
LDX # $FF; Set the stack pointer to the initial position
TXS
DEBUG

@neilsf
Copy link
Contributor

neilsf commented Nov 6, 2023 via email

@GrantMTG
Copy link

GrantMTG commented Nov 6, 2023

A macro is nice and clean, but you shouldn't need it for one line. Just use the equate and make sure the DC.B is not in coilumn 1.

DEBUG EQU is not the same and DC.B.

Assuming DEBUG isn't a reserved word

DEBUG EQU $FF

DC.B DEBUG

would also work. Whichever you prefer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants