06-20-2010, 12:33 AM
Since you are working in MACHINE CODE, you must be careful when including binary files. What is happening there is the program execution is entering the charset.bas file and executing it as machine code. Such case is equivalent to this:
Compile and run it, and your program will reset the computer, because after the PRINT, it's executing JP 0 (ROM START).
To ensure the execution never reaches the included data files, just place an END. This will exit your program gracefully:
This is useful, so you can include either ASM files, or even binary .bin files (object files) if they are relocatable, so you needn't compile them again (sort of binary libraries).
Code:
PRINT "HELLO WORLD"
ASM
db 195, 0, 0 ; This is JP 0 !!!
END ASM
To ensure the execution never reaches the included data files, just place an END. This will exit your program gracefully:
Code:
PRINT "HELLO WORLD"
END : REM Avoid entering the binary data
ASM
db 195, 0, 0 ; This is JP 0 !!!
END ASM