BIN files to BASIC (txt) files

By AndrewSteel

Supporter (2)

AndrewSteel's picture

05-11-2019, 14:55

Hello everyone! Smile
I'm new to the forum, I have a MSX VG8010, since I was young my passion was programming in basic, and I always dreamed of reading the source codes of my favorite games LOL!
Now, with the possibility of being able to download files "cas" would be nice to be able to convert the "bin" parts of these files into basic, or into a text format with basic instructions.
Is there a way to do this? Thank you so much for the answers, and sorry for my English Wink oO

Login or register to post comments

By Sandy Brand

Master (190)

Sandy Brand's picture

05-11-2019, 22:06

Well, .bin files usually contain a combination of (Z80) assembly code and 'raw' data.

Assembly code is a very low level 'language' that the CPU can understand and execute, and can be thought of as a very detailed and explicitly way of telling what the CPU needs to do in very small steps (at the level of 'bits and bytes'). BASIC on the other hand is a high level language that is designed to be readable for human beings, and hides a lot of the internal complexities of the machine favoring a more clearer way to express the general flow of the program logic.

Assembly is generally much faster to execute (which was needed for running games), whereas BASIC needs to be 'interpreted' by a special program that can decode and execute the BASIC commands. This extra translation step generally makes it much slower.

Although, both languages have similar concepts such as loops, reading/writing data into memory/variables, conditional execution of logic, math operations, etc., there is no 'direct' translation possible, or at least not in a way that would produce easy to read BASIC code.

If you would like to get a glimpse of the code that ran your favorite games, then I would suggest to run them in an emulator and 'pausing' it with the built in debugger. The debugger will most likely show you a disassembly of the assembly code it is currently running (using a symbolic textual representation called 'Z80 mnemonics'), and you can then step through it one command at a time and 'see' the logic flow of the program.

Give it a try; it might look daunting at first, but it is certainly interesting to get a glimpse of what is going on inside the MSX Smile

By AndrewSteel

Supporter (2)

AndrewSteel's picture

14-11-2019, 12:23

Thanks! Smile