Compiling disassembler by Steven Van Der Loef with GEN80

By Gregory

Master (178)

Gregory's picture

24-08-2021, 22:33

I've been trying to compile a disassembler with GEN80 (2.04), but I doesn't want to work.
The source file is in:

http://www.msxarchive.nl/pub/msx/mirrors/msx2.com/sources/st...
I just use the command:
gen80 disasv1.gen
Pass 1: errors 00
Pass 2: errors 00
*WARNING* ORGs used: 01
Symbol Table used: 03 K out of 14 K

Result of compilation is 2 files
DISASV1.com
DISASV1.SYM

when I run disasv1 FDD1 turns on, but don't know what it's looking for.
Any help?

Login or register to post comments

By Manuel

Ascended (18256)

Manuel's picture

24-08-2021, 23:49

Do you insist on assembling it yourself, or would you also happy with a binary? See https://www.msxcomputermagazine.nl/archief/mcm-18/ under Disass....

Maybe the program only runs with a single disk drive, try booting with CTRL pressed and then run it. Or check the article in MCM.

By Gregory

Master (178)

Gregory's picture

25-08-2021, 00:41

Manuel wrote:

Do you insist on assembling it yourself, or would you also happy with a binary? See https://www.msxcomputermagazine.nl/archief/mcm-18/ under Disass....

Maybe the program only runs with a single disk drive, try booting with CTRL pressed and then run it. Or check the article in MCM.

Yeah, I'd like to assemble it myself so I can learn something. Otherwise I'll never get to grips with this assembler thing.
I was trying it in bluemsx not on a real msx. The listing for this disassembler in MCCM is a basic listing with at the end a whole bunch of opcodes. I can disassemble the program with the program itself but then I just have the instructions, no labels,... makes it a lot thougher for a noob. I can always check the source against the disassembly I guess.

By Manuel

Ascended (18256)

Manuel's picture

25-08-2021, 07:55

It doesn't matter whether it's an emulator or real MSX: please check my advice.

By Briqunullus

Champion (433)

Briqunullus's picture

25-08-2021, 09:21

Although it's always a good learning experience to assemble such a program yourself, this one is a bit tough. If you read the article and inspect the listing, you'll notice a few things:

- this is not a .COM file to be run from MSX-DOS
- all binary data is POKE'd into memory and then moved to addrerss 0x5000 so it doesn't interfere with BASIC
- the source code doesn't include the routine for moving
- the source code doesn't include the routine to call the disassembler

If you want to assemble this yourself, you should make it into a BLOAD-able file. Add the header with 0xfe and start, end and run addresses. Take the moving routine from the BASIC listing and add it to your file as well. And finally strip the BASIC listing to get the routine to call the disassembler.

By Gregory

Master (178)

Gregory's picture

25-08-2021, 19:44

Briqunullus wrote:

Although it's always a good learning experience to assemble such a program yourself, this one is a bit tough. If you read the article and inspect the listing, you'll notice a few things:

- this is not a .COM file to be run from MSX-DOS
- all binary data is POKE'd into memory and then moved to addrerss 0x5000 so it doesn't interfere with BASIC
- the source code doesn't include the routine for moving
- the source code doesn't include the routine to call the disassembler

If you want to assemble this yourself, you should make it into a BLOAD-able file. Add the header with 0xfe and start, end and run addresses. Take the moving routine from the BASIC listing and add it to your file as well. And finally strip the BASIC listing to get the routine to call the disassembler.

Great info, thanks. I was wondering what was with all those calls to the 5000+ region. Guess I'll have to do some more studying on this.