Cross compile asm with Glass for MSX without floppy drive

By blake

Rookie (17)

blake's picture

07-11-2021, 17:05

I have a noob question. I'm using Glass as assembler on a pc and created a small program that lives in memory from $C000-$C0E5. But the MSX1 does not have a floppy drive. I don't know how to get this binary loaded on a MSX1. So my idea was to load the program in openMSX using a Sony HB700P, mount the folder as floppy, bload the program and then save the program to virtual tape as a wav file with bsave"cas:test",&HC000,&HC0E5.

However, the MSX2 with floppy drive already has things in memory in this address space. Moreover, it seems a very inefficient workflow and maybe there is a better way? Does a bin2wav tool exist?

Login or register to post comments

By Manuel

Ascended (18788)

Manuel's picture

07-11-2021, 18:44

This should work fine. What is in that memory may just be the initial content of the RAM or residue of some other use of it.

By Grauw

Ascended (10581)

Grauw's picture

07-11-2021, 19:45

I am not familiar with the details of the .CAS file format, however can’t you put the CAS header in the assembly files and output CAS binaries directly? Like how you do it for .BIN files.

By treblig

Rookie (20)

treblig's picture

08-11-2021, 22:47

I use this as CAS header, where the "hellow" is the filename that you see when you load the file from cassette. I reversed engineered it by using the TAPE2CAS tool. Until now it always worked for me but I cannot guarantee that it is a generic, always working solution.

    ; CAS header with the filename
    db $1F, $A6, $DE, $BA, $CC, $13, $7D, $74
    db $D0, $D0, $D0, $D0, $D0, $D0, $D0, $D0, $D0, $D0
    db "hellow"
    db $1F, $A6, $DE, $BA, $CC, $13, $7D, $74
    dw FileStart
    dw FileEnd - 1
    dw Main

    ; org statement after the header
    org $C000

FileStart:
Main:
    ; Do something
FileEnd:

For comparison, here is the same source file with a header for a BIN file that can be loaded from e.g. floppy disk:

    ; BIN header
    db $FE
    dw FileStart
    dw FileEnd - 1
    dw Main

    ; org statement after the header
    org $C000

FileStart:
Main:
    ; Do something
FileEnd:

And a most simple cartridge header (and footer to fill the cartridge with FF):

    ; org statement before the header
    org $4000

    ; ROM header
    db "AB"
    dw Main
    dw 0, 0, 0, 0, 0, 0

RomSize equ $4000

FileStart:
Main:
    ; Do something
FileEnd:
    ds $4000 + RomSize - FileEnd, 255

By Grauw

Ascended (10581)

Grauw's picture

08-11-2021, 23:03

Great examples!

By treblig

Rookie (20)

treblig's picture

08-11-2021, 23:12

Thanks @Grauw. Is there a place maybe in the wiki where we can store this info?