GrimeZ80 assembly errors

Subjects related to all or many CPU's... such as issues relating to multi-CPU Linkers and assemblers like VASM, Source editors like Notepad++ etc
If your post is relating to an emulator, post in that platforms post (eg CPC for Winape)
Post Reply
mrcook
Posts: 10
Joined: Thu Apr 25, 2019 8:14 pm

GrimeZ80 assembly errors

Post by mrcook » Wed May 08, 2019 7:18 pm

Hi Keith,

This evening I was playing around with your GrimeZ80 source and while trying to assemble the binaries (using VASM), a couple of the systems were having issues. I first used the code from github, but then also tried the "UpdatedSource" code found in the archive from your download page.

BuildGMB and BuildGBC throw errors:

Code: Select all

$ vasmz80 GrimeZ80.asm -chklabels -nocase -Dvasm=1 -Fbin -o grime.bin -L grime.txt

error 2002 in line 42 of "../SrcGB/GB_V1_VDPMemory.asm": Opcode not supported by z80 (stop)
	included from line 1 of "read"
	called from line 12 of "../SrcALL/V1_VdpMemory.asm"
	included from line 1 of "read"
	called from line 1986 of "GrimeZ80.asm"
>	stop

error 2002 in line 76 of "../SrcGB/GB_V1_VDPMemory.asm": Opcode not supported by z80 (ldi)
	included from line 1 of "read"
	called from line 12 of "../SrcALL/V1_VdpMemory.asm"
	included from line 1 of "read"
	called from line 1986 of "GrimeZ80.asm"
>        ldi      (hl),a
The "ldi" also happens for lines 112, 114, and 116, but there's also the "***maximum number of errors reached!***" message.

Any ideas?

User avatar
akuyou
Posts: 563
Joined: Mon Apr 22, 2019 3:19 am
Contact:

Re: GrimeZ80 assembly errors

Post by akuyou » Wed May 08, 2019 9:30 pm

I just redownladed the source, and it seems to compile OK my end.

You're missing a swith on the VASM command line, you need " -gbz80" to enable the extra 'non z80' commands of the Gameboy CPU,

I also can't see the 'BuildGBC' or 'DBuildGMB' symbol definitions, if you're defining them in the source code or something then that's fine (I assume you are, as otherwise the GB_V1_VDPMemory.asm shouldn't be included)

Here's the command I use

Code: Select all

\Utils\Vasm\vasmZ80_OldStyle_win32.exe %1  -chklabels -nocase -gbz80 -Dvasm=1 -DBuildGBC=1 -Fbin -o \RelGB\cart.gbc -L \RelGB\Listing.txt
Chibi Akuma(s) Comedy-Horror 8-bit Bullet Hell shooter! // 「チビ悪魔」可笑しいゴシックSTG ! // Work in Progress: ChibiAliens

Interested in CPU's :Z80,6502,68000,6809,ARM,8086,RISC-V
Learning: 65816,ARM,8086,6809

mrcook
Posts: 10
Joined: Thu Apr 25, 2019 8:14 pm

Re: GrimeZ80 assembly errors

Post by mrcook » Wed May 08, 2019 9:43 pm

Okay, it works as you say after adding the "-gbz80". Thanks Keith!

As for the "BuildGBC", yes I was uncommenting that, as it says to do at the top of GrimeZ80.asm :)

User avatar
akuyou
Posts: 563
Joined: Mon Apr 22, 2019 3:19 am
Contact:

Re: GrimeZ80 assembly errors

Post by akuyou » Wed May 08, 2019 9:58 pm

The
;Uncomment one of the lines below to select your compilation target
section of the ASM file was really for compiling with WinApe, which can't compile the GBZ80 commands anyway.

GrimeZ80, as it currently stands, won't actually compile on Winape, because of some syntax differences between VASM and WINAPE... For anyone interested It seems it can be fixed with some changes: (only tested on CPC)

1.PAUSE function needs to be renamed to DoPause (Winape uses Pause statement for something else it seems)

2.BRACKETS removed from formulas like "ld l,(ScreenHeight/2)+1"

3. One of the comment lines is too long for winape
Chibi Akuma(s) Comedy-Horror 8-bit Bullet Hell shooter! // 「チビ悪魔」可笑しいゴシックSTG ! // Work in Progress: ChibiAliens

Interested in CPU's :Z80,6502,68000,6809,ARM,8086,RISC-V
Learning: 65816,ARM,8086,6809

Post Reply

Return to “General Assembly Programming”