BASIC - Pseudo Operations

C64Studio supports a few pseudo ops, hidden in meta commentsThese pseudo ops are supported:




#BINDATA <filename>,<length>,<offset>,<start line>,<line step>

This pseudo op allows to insert binary content as DATA lines.

This pseudo op needs a few more parameters to let you control the output. If the length is given empty the full file is used.
The length of the line is the maximum possible for proper manual entry (e.g. 80 for C64, not 254)


Example: Include music data, the full length, but skip the first 2 bytes (load address). Generate DATA starting with line number 1000, increase the line numbers by 1.


#BINDATA "music.bin",,2,1000,1


#CHARDATA <filename>,<offset>,<length>,<start line>,<line step>

This pseudo op allows to insert character data content as DATA lines.

This pseudo op needs a few more parameters to let you control the output. If the length is given empty the full file is used.
The length of the line is the maximum possible for proper manual entry (e.g. 80 for C64, not 254)


Example: Include character data, 10 characters, but skip the first 2 characters. Generate DATA starting with line number 1000, increase the line numbers by 1.


#CHARDATA "charset.charsetproject",2,10,1000,1


#INCLUDE <filename>

#INCLUDE works similar to assembly's !src pseudo op. It expects a filename which will be included at the current location.


main.bas content:

10 PRINT "HELLO" #INCLUDE "GREETING.BAS" 30 PRINT "THIS IS THE END"

greeting.bas content:

20 PRINT "WORLD"



Which results in the final output:


10 PRINT "HELLO" 20 PRINT "WORLD" 30 PRINT "THIS IS THE END"



#SPRITEDATA <filename>,<offset>,<length>,<start line>,<line step>

This pseudo op allows to insert sprite data content as DATA lines.

This pseudo op needs a few more parameters to let you control the output. If the length is given empty the full file is used.
The length of the line is the maximum possible for proper manual entry (e.g. 80 for C64, not 254)


Example: Include sprite data, 10 sprites, but skip the first 2 sprites. Generate DATA starting with line number 1000, increase the line numbers by 1.


#SPRITEDATA "sprites.spriteproject",2,10,1000,1