2021-08-02 23:40:31 +00:00
|
|
|
(local Ssc (require :ssc))
|
|
|
|
(import-macros {:sss ! : compile} :ssc.macros)
|
|
|
|
|
2021-08-09 01:58:49 +00:00
|
|
|
(local ssc (Ssc {:boot-org 0xc00}))
|
2021-08-02 23:40:31 +00:00
|
|
|
(compile ssc
|
2021-08-06 01:30:08 +00:00
|
|
|
(require :ssc.iigs.toolbox)
|
|
|
|
|
2021-08-09 01:58:49 +00:00
|
|
|
(asm pascalhex (db 5) hexbuf (bytes " "))
|
2021-08-10 04:33:54 +00:00
|
|
|
|
2021-08-06 01:30:08 +00:00
|
|
|
(fn printnum (num)
|
2021-08-09 18:43:24 +00:00
|
|
|
(long! (ref hexbuf) (HexIt num))
|
|
|
|
(WriteString (far-ref pascalhex)))
|
2021-08-06 01:30:08 +00:00
|
|
|
|
2021-08-02 23:40:31 +00:00
|
|
|
(fn add (lhs rhs) (+ lhs rhs))
|
2021-08-10 17:23:09 +00:00
|
|
|
|
|
|
|
(global word UserID)
|
2021-08-02 23:40:31 +00:00
|
|
|
(fn main ()
|
2021-08-06 01:30:08 +00:00
|
|
|
(TLStartUp)
|
2021-08-10 17:23:09 +00:00
|
|
|
(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))
|
2021-08-12 02:34:07 +00:00
|
|
|
(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)))
|
2021-08-10 17:23:09 +00:00
|
|
|
(TextShutDown)
|
|
|
|
(IMShutDown)
|
|
|
|
(MMShutDown UserID)
|
|
|
|
(TLShutDown)))
|
|
|
|
|
2021-08-02 23:40:31 +00:00
|
|
|
|
|
|
|
(ssc:assemble)
|