mirror of
https://github.com/catseye/SixtyPical.git
synced 2024-06-07 06:29:32 +00:00
BASIC header not sixtypical's responsibility.
This commit is contained in:
parent
abe2279b46
commit
fe1acb11db
|
@ -265,11 +265,9 @@ TODO
|
|||
* Parse HEX values like $40A3
|
||||
* Initial values for reserved, incl. tables
|
||||
* Character tables ("strings" to everybody else)
|
||||
* External routines
|
||||
* Work out the analyses again and document them
|
||||
* `repeat jmp`
|
||||
* Addressing modes; rename instructions to match
|
||||
* Not responsible for BASIC header (cat externally)
|
||||
* Put data at end, no need for jmp main
|
||||
|
||||
Tests
|
||||
|
@ -485,10 +483,6 @@ We cannot absolute-indexed a word.
|
|||
| ora #8
|
||||
| ora screen
|
||||
| }
|
||||
= .org 0
|
||||
= .word $0801
|
||||
= .org $0801
|
||||
= .byte $10, $08, $c9, $07, $9e, $32, $30, $36, $31, $00, $00, $00
|
||||
= jmp main
|
||||
= score: .word 0
|
||||
= .alias screen 1024
|
||||
|
@ -548,10 +542,6 @@ We cannot absolute-indexed a word.
|
|||
| }
|
||||
| sta screen
|
||||
| }
|
||||
= .org 0
|
||||
= .word $0801
|
||||
= .org $0801
|
||||
= .byte $10, $08, $c9, $07, $9e, $32, $30, $36, $31, $00, $00, $00
|
||||
= jmp main
|
||||
= .alias screen 1024
|
||||
= main:
|
||||
|
@ -577,10 +567,6 @@ We cannot absolute-indexed a word.
|
|||
| }
|
||||
| sty screen
|
||||
| }
|
||||
= .org 0
|
||||
= .word $0801
|
||||
= .org $0801
|
||||
= .byte $10, $08, $c9, $07, $9e, $32, $30, $36, $31, $00, $00, $00
|
||||
= jmp main
|
||||
= .alias screen 1024
|
||||
= zero: .byte 0
|
||||
|
@ -612,10 +598,6 @@ Nested ifs.
|
|||
| lda #3
|
||||
| }
|
||||
| }
|
||||
= .org 0
|
||||
= .word $0801
|
||||
= .org $0801
|
||||
= .byte $10, $08, $c9, $07, $9e, $32, $30, $36, $31, $00, $00, $00
|
||||
= jmp main
|
||||
= main:
|
||||
= BEQ _label_3
|
||||
|
@ -653,10 +635,6 @@ Installing an interrupt handler (at the Kernal level, i.e. with CINV)
|
|||
| inc screen
|
||||
| jmp save_cinv
|
||||
| }
|
||||
= .org 0
|
||||
= .word $0801
|
||||
= .org $0801
|
||||
= .byte $10, $08, $c9, $07, $9e, $32, $30, $36, $31, $00, $00, $00
|
||||
= jmp main
|
||||
= .alias screen 1024
|
||||
= .alias cinv 788
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
#!/bin/sh
|
||||
|
||||
bin/sixtypical emit $1 > tmp.oph && ophis tmp.oph -o tmp.prg && x64 tmp.prg
|
||||
rm -f tmp.oph tmp.prg
|
||||
bin/sixtypical emit $1 > tmp.oph || exit 1
|
||||
cat lib/basic_head.oph tmp.oph > tmp2.oph
|
||||
ophis tmp2.oph -o tmp.prg || exit 1
|
||||
x64 tmp.prg
|
||||
rm -f tmp.oph tmp2.oph tmp.prg
|
||||
|
|
|
@ -84,6 +84,7 @@ noUseOfUndeclaredRoutines p@(Program decls routines) =
|
|||
mappedProgram == p
|
||||
where
|
||||
routineNames = declaredRoutineNames p
|
||||
-- TODO also check COPYROUTINE here
|
||||
checkInstr j@(JSR routName) =
|
||||
case routName `elem` routineNames of
|
||||
True -> j
|
||||
|
|
|
@ -4,15 +4,8 @@ module SixtyPical.Emitter where
|
|||
|
||||
import SixtyPical.Model
|
||||
|
||||
basicHeader =
|
||||
".org 0\n" ++
|
||||
".word $0801\n" ++
|
||||
".org $0801\n" ++
|
||||
".byte $10, $08, $c9, $07, $9e, $32, $30, $36, $31, $00, $00, $00\n" ++
|
||||
" jmp main\n"
|
||||
|
||||
emitProgram p@(Program decls routines) =
|
||||
basicHeader ++
|
||||
" jmp main\n" ++
|
||||
emitDecls p decls ++
|
||||
emitRoutines p routines
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user