how can we cross-compile to .cas and .dsk instead of .rom?

Page 2/2
1 |

By nitrofurano

Champion (300)

nitrofurano's picture

30-04-2016, 21:10

@NYYRIKKI:
thanks!
about DiskManager, i just need to try if the command line works fine on Wine, since there is no native GNU/Linux version (yet, afaik...), and he didn’t released its source yet (last time i contacted DiskManager author, he told being too uncomfortable with GNU/Linux, Unix and etc., what was quite sad, specially seeing how popular Unix-based operating systems are becoming today, and increasing overtime )
and thanks for the .cas info! Smile (i'm going to try it on Pasmo, for now - on ZXBasic i might need to calculate the bloadable size somehow)

@Manuel that was the idea that i asked! Wink

@Alcoholics_Anonymous it’s weird z88dk is using sf instead of github by default... :S

@Alcoholics_Anonymous, @zPasi, @Timmy - thanks for the info and feedback! Smile

By Manuel

Ascended (18777)

Manuel's picture

30-04-2016, 21:25

There's also wrdsk, of which source code is available. Can be compiled for any reasonable OS (including MSX-DOS).

By nitrofurano

Champion (300)

nitrofurano's picture

30-04-2016, 21:52

NYYRIKKI wrote:

You can use ie. this template:

	output "EXMPLE.CAS"
macro header
     db #1F, #A6, #DE, #BA, #CC, #13, #7D, #74
endmacro

	header
	db #D0,#D0,#D0,#D0,#D0,#D0,#D0,#D0,#D0,#D0
	db "EXMPLE"
	header
	dw begin,end,start
	
	org #c000
begin:
start:
	ret
end:

didn’t work on Pasmo (for which cross-compiler did you code it?), i needed to edit it... (which worked fine)
(i don’t know how to use macros (and specially on Pasmo, on this case), and some other specific issues as seen below)

;output "EXMPLE.CAS"
;pasmo exmple.asm exmple.cas

;macro header
; db #1F,#A6,#DE,#BA,#CC,#13,#7D,#74
;endmacro

org $BFDA ;($C000-38) (38=8+10+6+8+6)

; header
defb $1F,$A6,$DE,$BA,$CC,$13,$7D,$74

defb $D0,$D0,$D0,$D0,$D0,$D0,$D0,$D0,$D0,$D0
defb "EXMPLE"

; header
defb $1F,$A6,$DE,$BA,$CC,$13,$7D,$74

defw begin01,end01,start01

org $C000

begin01:
start01:
ret

end01:

; .cas file size must be multiple of 8 as well? some bytes for completing it...
defb $00

By NYYRIKKI

Enlighted (5918)

NYYRIKKI's picture

01-05-2016, 00:05

nitrofurano wrote:

didn’t work on Pasmo (for which cross-compiler did you code it?), i needed to edit it... (which worked fine)
(i don’t know how to use macros (and specially on Pasmo, on this case), and some other specific issues as seen below)

Yes, sorry... The example should compile at least on SjAsm, but indeed these things work differently from assembler to another.

Quote:

org $BFDA ; ($C000-38) (38=8+10+6+8+6)

This line is useless because you don't have any lables before you define ORG again.

Quote:

; .cas file size must be multiple of 8 as well? some bytes for completing it...

I don't think that the size matters unless you want to put more files to same CAS, but indeed to avoid "Input past end"-error there should be byte at end01 label. Maybe to be on safe side you should use DS 8 or something...

By nitrofurano

Champion (300)

nitrofurano's picture

01-05-2016, 00:18

NYYRIKKI wrote:
nitrofurano wrote:

didn’t work on Pasmo (for which cross-compiler did you code it?), i needed to edit it... (which worked fine)
(i don’t know how to use macros (and specially on Pasmo, on this case), and some other specific issues as seen below)

Yes, sorry... The example should compile at least on SjAsm, but indeed these things work differently from assembler to another.

thanks! syntaxes are often different among assemblers

Quote:
Quote:

org $BFDA ; ($C000-38) (38=8+10+6+8+6)

This line is useless because you don't have any lables before you define ORG again.

i needed to add it for not having a 48kb .cas file almost all filled up with 0x00 bytes

Quote:
Quote:

; .cas file size must be multiple of 8 as well? some bytes for completing it...

I don't think that the size matters unless you want to put more files to same CAS, but indeed to avoid "Input past end"-error there should be byte at end01 label. Maybe to be on safe side you should use DS 8 or something...

it shown error messages on OpenMSX without that

in overall, for starting, the whole information is being helpful for coding a kind of .rom to .cas converter (at least hopefully focusing most of the unpaged .rom files )

By NYYRIKKI

Enlighted (5918)

NYYRIKKI's picture

01-05-2016, 00:52

nitrofurano wrote:

i needed to add it for not having a 48kb .cas file almost all filled up with 0x00 bytes

Ok, syntaxes of assemblers may be different, but that is simply wrong... ORG statements should newer ever affect the file size. There is DS statement for that purpose. At this moment I would already recommend moving in to some other assembler.

Quote:

in overall, for starting, the whole information is being helpful for coding a kind of .rom to .cas converter (at least hopefully focusing most of the unpaged .rom files )

Ok, to get you started, you can look this video (Don't use Android if you want to see the commentary) Please note how ever that when using cassette only system, you don't have RAM SlotID in #F341-#F344

By Grauw

Ascended (10577)

Grauw's picture

01-05-2016, 02:25

NYYRIKKI wrote:

Ok, syntaxes of assemblers may be different, but that is simply wrong... ORG statements should newer ever affect the file size. There is DS statement for that purpose. At this moment I would already recommend moving in to some other assembler.

Meet Pasmo Smile.

By spacemoai1973

Master (165)

spacemoai1973's picture

01-05-2016, 11:09

Many assemblers do this, it is not so wrong as you imagine. TNIASM allows both styles.

By nitrofurano

Champion (300)

nitrofurano's picture

01-05-2016, 22:25

NYYRIKKI wrote:
nitrofurano wrote:

i needed to add it for not having a 48kb .cas file almost all filled up with 0x00 bytes

Ok, syntaxes of assemblers may be different, but that is simply wrong... ORG statements should newer ever affect the file size. There is DS statement for that purpose. At this moment I would already recommend moving in to some other assembler.

i think that CBios were all compiled on Pasmo, and i guess it wouldn’t be used if it was that bad - and anyway, for me it is very comfortable that i can always install Pasmo simply by entering "sudo apt-get install pasmo" on the terminal! Wink

Page 2/2
1 |