-
Notifications
You must be signed in to change notification settings - Fork 79
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
Gameboy/Z80 architecture #188
base: master
Are you sure you want to change the base?
Conversation
…ey add and inc set different flags
…rms; but keep sub a, b etc for convenience
I love this PR, I know the tool is armips and not armipz80, but still a remarkable patch, what do you think @Kingcom ? |
I don't see an issue tab on the fork's page, so I guess I'll report it here. I've been using this fork for quite a while now, and I've gotten a good amount of use with it. However, it unfortunately doesn't seem to support all opcodes, which seems to mostly be indirect addressing related. For example, this line of Z80 code doesn't compile.
So I have to substitute it with this.
It is a valid instruction, per here: |
The following compiles fine for me:
Which outputs This opcode is also included in the instruction set tests: https://github.com/Prof9/armips/blob/gameboy/Tests/Z80/Z80%20Opcodes/Z80%20Opcodes.asm#L39 Side note: I originally created this fork as I was planning to work on some Game Boy projects, but ended up not going through with that. So I haven't really used this fork much personally. |
Thanks so much for the timely reply! I was missing the |
This adds the Z80 architecture and instruction set, as well as the Game Boy (Color) and Nintendo e-Reader instruction sets, which are based on Z80.
The following directives can be used:
.z80
- Full Z80 instruction set.gb
- Game Boy (Color) instruction set.ereader
- Nintendo e-Reader instruction setThe syntax is based on the official Z80 documentation and Pan Docs (for Game Boy), but I've also added some other aliases I've commonly seen. I also made some personal additions:
jp hl
,jp ix
, etc. are accepted as alternatives forjp (hl)
,jp (ix)
etc. Reason: unlike what the official syntax implies,pc
is set to the value of the register directly, and no memory access is done.sub a,b
,sub a,c
etc. are accepted as alternatives forsub b
,sub c
etc. This also applies forand
,xor
,or
andcp
. Reason:add
,adc
andsbc
all have the destination (a
) as part of their operand list, so this allows for better consistency with those opcodes.rst 0,n
andrst 8,n
shorthand for calling the e-Reader API functions more easily, so you don't have to write a.db
after everyrst
.