mirror of
https://github.com/catseye/SixtyPical.git
synced 2025-01-26 14:32:33 +00:00
Emit externals, jsr, eg that uses Kernal.
This commit is contained in:
parent
9d1b0e8309
commit
abe2279b46
9
eg/hi.60pical
Normal file
9
eg/hi.60pical
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
external chrout 65490
|
||||||
|
routine main {
|
||||||
|
lda #72
|
||||||
|
jsr chrout
|
||||||
|
lda #73
|
||||||
|
jsr chrout
|
||||||
|
lda #13
|
||||||
|
jsr chrout
|
||||||
|
}
|
@ -1,12 +0,0 @@
|
|||||||
reserve word score
|
|
||||||
assign word screen 4000
|
|
||||||
routine main {
|
|
||||||
lda screen
|
|
||||||
tax
|
|
||||||
tay
|
|
||||||
cmp score
|
|
||||||
ldx score
|
|
||||||
txa
|
|
||||||
ldy score
|
|
||||||
tya
|
|
||||||
}
|
|
@ -1,19 +0,0 @@
|
|||||||
assign word fnord 4000
|
|
||||||
assign byte blerf 4002
|
|
||||||
|
|
||||||
reserve byte foo
|
|
||||||
reserve word bar
|
|
||||||
|
|
||||||
routine hello {
|
|
||||||
lda fnord
|
|
||||||
cmp blerf
|
|
||||||
lda foo
|
|
||||||
}
|
|
||||||
|
|
||||||
routine bye {
|
|
||||||
lda fnord
|
|
||||||
cmp bar
|
|
||||||
}
|
|
||||||
|
|
||||||
routine byee {
|
|
||||||
}
|
|
@ -24,6 +24,10 @@ emitDecl p (Assign name _ addr) = ".alias " ++ name ++ " " ++ (show addr)
|
|||||||
emitDecl p (Reserve name Byte) = name ++ ": .byte 0"
|
emitDecl p (Reserve name Byte) = name ++ ": .byte 0"
|
||||||
emitDecl p (Reserve name Word) = name ++ ": .word 0"
|
emitDecl p (Reserve name Word) = name ++ ": .word 0"
|
||||||
emitDecl p (Reserve name Vector) = name ++ ": .word 0"
|
emitDecl p (Reserve name Vector) = name ++ ": .word 0"
|
||||||
|
emitDecl p (External name addr) = ".alias " ++ name ++ " " ++ (show addr)
|
||||||
|
emitDecl p d = error (
|
||||||
|
"Internal error: sixtypical doesn't know how to " ++
|
||||||
|
"emit assembler code for '" ++ (show d) ++ "'")
|
||||||
|
|
||||||
emitRoutines _ [] = ""
|
emitRoutines _ [] = ""
|
||||||
emitRoutines p (rout:routs) =
|
emitRoutines p (rout:routs) =
|
||||||
@ -124,6 +128,9 @@ emitInstr p r (COPYROUTINE src (NamedLocation dst)) =
|
|||||||
emitInstr p r (JMPVECTOR (NamedLocation dst)) =
|
emitInstr p r (JMPVECTOR (NamedLocation dst)) =
|
||||||
"jmp (" ++ dst ++ ")"
|
"jmp (" ++ dst ++ ")"
|
||||||
|
|
||||||
|
emitInstr p r (JSR routineName) =
|
||||||
|
"jsr " ++ routineName
|
||||||
|
|
||||||
emitInstr p r i = error (
|
emitInstr p r i = error (
|
||||||
"Internal error: sixtypical doesn't know how to " ++
|
"Internal error: sixtypical doesn't know how to " ++
|
||||||
"emit assembler code for '" ++ (show i) ++ "'")
|
"emit assembler code for '" ++ (show i) ++ "'")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user