mirror of
https://github.com/irmen/prog8.git
synced 2024-12-27 20:33:39 +00:00
77 lines
1.2 KiB
Plaintext
77 lines
1.2 KiB
Plaintext
|
|
%output basic ; create a c-64 program with basic SYS call to launch it
|
|
|
|
|
|
%import c64lib ; searched in several locations and with .ill file extension added
|
|
|
|
~ main
|
|
{
|
|
memory screen2 = $0401
|
|
memory screen3 = $0402
|
|
memory .word screenw = $0500
|
|
|
|
; ascii to petscii, 0 terminated
|
|
var .str hello = "hello everyone out there."
|
|
|
|
; ascii to petscii, with length as first byte
|
|
var .strp hellopascalstr = "Hello!\0x00\x01\x02d ag\0x01."
|
|
|
|
; ascii to screen codes, 0 terminated
|
|
var .strs hello_screen = "Hello!\n guys123."
|
|
|
|
; ascii to screen codes, length as first byte
|
|
var .strps hellopascal_screen = "Hello! \n."
|
|
|
|
var .str hello2 = "@@\f\b\n\r\t@@"
|
|
|
|
start:
|
|
global2.make_screen_black()
|
|
|
|
A='?'
|
|
[$d020] = '?'
|
|
[$d021] = '?'
|
|
[$d022] = '?'
|
|
[$d023] = 'q'
|
|
c64.BGCOL0 = 'a'
|
|
screen2 = 'a'
|
|
screen3 = 'a'
|
|
screenw = '2'
|
|
A='?'
|
|
X='?'
|
|
Y='?'
|
|
A='\002'
|
|
X=A
|
|
A='\xf2'
|
|
X=A
|
|
c64.CHROUT('A')
|
|
A='\f'
|
|
X=A
|
|
A='\b'
|
|
X=A
|
|
A='\n'
|
|
X=A
|
|
A='\r'
|
|
X=A
|
|
A='\t'
|
|
A='0'
|
|
c64.CHROUT('0')
|
|
c64.CHROUT('1')
|
|
c64.CHROUT('2')
|
|
c64scr.print_string(hello)
|
|
return c64.CHROUT('!')
|
|
|
|
|
|
return
|
|
}
|
|
|
|
~ global2 {
|
|
|
|
make_screen_black:
|
|
c64.EXTCOL = 0
|
|
c64.BGCOL0 = 0
|
|
c64.COLOR = 3
|
|
Y = true
|
|
return
|
|
|
|
}
|