mirror of
https://github.com/irmen/prog8.git
synced 2024-12-25 23:29:55 +00:00
fix launching of Vice
This commit is contained in:
parent
849bfde515
commit
d1b750ea55
26
compiler/examples/hello.p8
Normal file
26
compiler/examples/hello.p8
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
%import c64lib
|
||||||
|
%import c64utils
|
||||||
|
|
||||||
|
~ main {
|
||||||
|
|
||||||
|
sub start() {
|
||||||
|
|
||||||
|
; set screen colors and activate lowercase charset
|
||||||
|
c64.EXTCOL = 5
|
||||||
|
c64.BGCOL0 = 0
|
||||||
|
c64.COLOR = 1
|
||||||
|
c64.VMCSB = %10111
|
||||||
|
|
||||||
|
; use kernel routine to write text (sorry, loops don't work in asm yet)
|
||||||
|
c64.CHROUT('H')
|
||||||
|
c64.CHROUT('e')
|
||||||
|
c64.CHROUT('l')
|
||||||
|
c64.CHROUT('l')
|
||||||
|
c64.CHROUT('o')
|
||||||
|
c64.CHROUT('!')
|
||||||
|
c64.CHROUT('\n')
|
||||||
|
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -13,8 +13,10 @@ sub start() {
|
|||||||
uword address
|
uword address
|
||||||
memory uword memaddr = $c000
|
memory uword memaddr = $c000
|
||||||
uword[2] wordarray
|
uword[2] wordarray
|
||||||
|
ubyte[2] ubytearray
|
||||||
byte b1
|
byte b1
|
||||||
memory byte mb1 = $c991
|
memory byte mb1 = $c991
|
||||||
|
memory ubyte mub1 = $c992
|
||||||
|
|
||||||
|
|
||||||
str stringvar = "??????????\n\n\nnext line\r\r\rnext line after carriagereturn"
|
str stringvar = "??????????\n\n\nnext line\r\r\rnext line after carriagereturn"
|
||||||
@ -70,8 +72,31 @@ sub start() {
|
|||||||
; Y = c64.CHRIN() ; ok!
|
; Y = c64.CHRIN() ; ok!
|
||||||
; v1 = c64.CHRIN() ; ok !
|
; v1 = c64.CHRIN() ; ok !
|
||||||
|
|
||||||
|
|
||||||
|
c64.CHROUT(X)
|
||||||
|
c64.CHROUT(b1) ; @todo fix compiler crash expression identifierref should be a vardef, not null
|
||||||
|
c64.CHROUT(char1) ; @todo fix compiler crash "
|
||||||
|
c64.CHROUT(mb1) ; @todo fix compiler crash "
|
||||||
|
c64.CHROUT(mub1) ; @todo fix compiler crash "
|
||||||
|
c64.CHROUT(ubytearray[1]) ; @todo fix compiler crash null cannot be cast to non-null type prog8.ast.VarDecl
|
||||||
|
c64.CHROUT(ubytearray[X]) ; @todo fix compiler crash "
|
||||||
|
c64.CHROUT(wordarray[1]) ; @todo fix compiler crash "
|
||||||
|
|
||||||
|
testsub(X) ; @todo fix compiler crash
|
||||||
|
testsub(b1) ; @todo fix compiler crash
|
||||||
|
testsub(char1) ; @todo fix compiler crash
|
||||||
|
testsub(mb1) ; @todo fix compiler crash
|
||||||
|
testsub(mub1) ; @todo fix compiler crash
|
||||||
|
testsub(ubytearray[1]) ; @todo fix compiler crash
|
||||||
|
testsub(ubytearray[X]) ; @todo fix compiler crash
|
||||||
|
testsub(wordarray[1]) ; @todo fix compiler crash
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
sub testsub(arg: ubyte) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -36,6 +36,7 @@ fun main(args: Array<String>) {
|
|||||||
|
|
||||||
val startTime = System.currentTimeMillis()
|
val startTime = System.currentTimeMillis()
|
||||||
val filepath = Paths.get(moduleFile).normalize()
|
val filepath = Paths.get(moduleFile).normalize()
|
||||||
|
val programname: String
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// import main module and process additional imports
|
// import main module and process additional imports
|
||||||
@ -125,6 +126,7 @@ fun main(args: Array<String>) {
|
|||||||
|
|
||||||
val assembly = AsmGen(compilerOptions, intermediate, heap).compileToAssembly()
|
val assembly = AsmGen(compilerOptions, intermediate, heap).compileToAssembly()
|
||||||
assembly.assemble(compilerOptions)
|
assembly.assemble(compilerOptions)
|
||||||
|
programname = assembly.name
|
||||||
|
|
||||||
val endTime = System.currentTimeMillis()
|
val endTime = System.currentTimeMillis()
|
||||||
println("\nTotal compilation+assemble time: ${(endTime-startTime)/1000.0} sec.")
|
println("\nTotal compilation+assemble time: ${(endTime-startTime)/1000.0} sec.")
|
||||||
@ -137,10 +139,9 @@ fun main(args: Array<String>) {
|
|||||||
|
|
||||||
if(startEmu) {
|
if(startEmu) {
|
||||||
println("\nStarting C64 emulator...")
|
println("\nStarting C64 emulator...")
|
||||||
val program = "foo"
|
val monitorfile = "$programname.mon_list"
|
||||||
val monitorfile = "foo.mon_list"
|
|
||||||
val cmdline = listOf("x64", "-moncommands", monitorfile,
|
val cmdline = listOf("x64", "-moncommands", monitorfile,
|
||||||
"-autostartprgmode", "1", "-autostart-warp", "-autostart", program)
|
"-autostartprgmode", "1", "-autostart-warp", "-autostart", programname+".prg")
|
||||||
ProcessBuilder(cmdline).inheritIO().start()
|
ProcessBuilder(cmdline).inheritIO().start()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user