honeylisp/neutgs/init.fnl

46 lines
1,010 B
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)
(let (x 1)
(printnum x)
(set! x (+ x 1))
(printnum x))
(set! (long-at (ref hexbuf)) 0x6b636548)
(WriteString (far-ref pascalhex))
(long! (ref hexbuf) 0x74747542)
(WriteString (far-ref pascalhex))
(let (buf (ref hexbuf)
str (far-ref pascalhex))
(long! buf 0x6b726f42)
(WriteString str)
(word! (+ buf 2) 0x706f)
(WriteString str))
(printnum (hiword (long-at (far-ref pascalhex))))
(TextShutDown)
(IMShutDown)
(MMShutDown UserID)
(TLShutDown)))
(ssc:assemble)