Chaos Assembler

By thegeps

Master (254)

thegeps's picture

21-01-2019, 23:53

Is possible to include bin files in Chaos Assembler? Or I have to change assembler?
Another question:
I have a bin file generated by a MSX tool (a basic tool I've created to edit maps for my scrolling routine) and "extracted" using openMSX diskmanipulator. So I think this file has a header. When included, have I to remove the header or these bytes are forever gone? And Have I to put a org before the inclusion to set where put binary data?

Login or register to post comments

By Grauw

Ascended (8384)

Grauw's picture

22-01-2019, 00:06

Most assemblers with an INCBIN directive allow you to specify a second parameter to indicate a number of bytes to skip. Whether it has a header depends on how you saved it (e.g. with BSAVE from Basic). If you know what data to expect, you could use a hex editor to check if one is there.

If Chaos Assembler does not support INCBIN, you could also write a little script which turns the binary into an assembler file with db statements, and include that.

By thegeps

Master (254)

thegeps's picture

22-01-2019, 00:58

I saved it with bsave. Hex editor? I know none, but I suppose that I can edit a file to remove the header with it. And maybe do a copy and paste in the CA editor and simply add db... Am I wrong? Can you suggest me a Hex editor to download?

By santiontanon

Paladin (821)

santiontanon's picture

22-01-2019, 05:11

Do you use Windows, Mac or Linux? For Mac I use 0xED, which is good enough for me. In Linux, you can use vim + xdd directly without having to install any additional editor. No idea for Windows Smile

By thegeps

Master (254)

thegeps's picture

22-01-2019, 08:59

Umfortunately I use Windows Sad I'll try to find something

By Pencioner

Paladin (931)

Pencioner's picture

22-01-2019, 09:00

with linux you can do skip bytes without using editor (if you know exactly how much bytes you need to skip) using the dd command like that:
dd if=input_file.bin of=output_file.bin bs=1 skip=7
here you skip 7 bytes of input_file.bin and save result to output_file.bin

By Sylvester

Champion (398)

Sylvester's picture

22-01-2019, 12:13

You can use https://hexed.it on all platforms :) I think it has all features for doing some small changes to files.

By thegeps

Master (254)

thegeps's picture

22-01-2019, 14:16

ty all Smile

By thegeps

Master (254)

thegeps's picture

22-01-2019, 14:31

uhm...
with hexed I was able to remove header bytes from bin file. But not to copy values and then paste them elsewhere... I need this function 'cause Chaos Assembler can't include binaries Sad

By thegeps

Master (254)

thegeps's picture

22-01-2019, 16:12

Ok, found a free hex editor that allow me to do copy and paste. I can go ahead Smile