honeylisp/neutgs/init.fnl

44 lines
1.1 KiB
Plaintext
Raw Normal View History

(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)
2021-08-09 18:43:24 +00:00
(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)
2021-08-12 03:06:31 +00:00
(let (x 1 dx 2 lim (if (> dx 0) 10 -10) break [ssc.FALSE])
(while (and (< x lim) (not break))
(printnum x)
(set! x (+ x dx))
(if (= x 6) (set! break [ssc.TRUE]))))
(if (> (+ 1 2) (+ 3 4)) (printnum 0x1212) (printnum 0x3434))
(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)