honeylisp/neutgs/init.fnl

39 lines
974 B
Fennel

(local Ssc (require :ssc))
(import-macros {:sss ! : compile} :ssc.macros)
(local ssc (Ssc {:boot-org 0xc00}))
(compile ssc
(require :ssc.iigs.toolbox)
(asm pascalhex (db 5) hexbuf (bytes " "))
(fn printnum (num)
(long! (ref hexbuf) (HexIt num))
(WriteString (far-ref pascalhex)))
(fn add (lhs rhs) (+ lhs rhs))
(global word UserID)
(fn main ()
(TLStartUp)
(set! UserID (MMStartUp))
(IMStartUp)
(TextStartUp)
; (if (= 1 1) (printnum 1) (printnum 2))
; (if (or (< 3 2) (not= 5 10)) (printnum 3) (printnum 4))
(if (and (or (= 1 2) (< 3 4)) ;
(not (or (> 10 3) (<= 6 5))))
(printnum 0xdead) (printnum 0xbeef))
(let (x 5 y 10 test1 (< x y) test2 (> x y))
(printnum test1) (printnum test2)
(if test1 (printnum 0x1234) (printnum 0x5678))
(if test2 (printnum 0x1234) (printnum 0x5678)))
(TextShutDown)
(IMShutDown)
(MMShutDown UserID)
(TLShutDown)))
(ssc:assemble)