mirror of
https://github.com/hsoft/collapseos.git
synced 2024-09-06 23:48:44 +10:00
I think that when I added NL, I had troubles having access to CRLF's address at boot time, which is why I had this system. But now that CRLF is easily accessible during BOOT, we can simplify. (and that will help us in the hopefully-upcoming change, which is quite nice...)
12 lines
431 B
Plaintext
12 lines
431 B
Plaintext
: EMIT
|
|
( 0x53==(emit) override )
|
|
0x53 RAM+ @ ?DUP IF EXECUTE ELSE (emit) THEN ;
|
|
: (print) C@+ ( a len ) 0 DO C@+ EMIT LOOP DROP ;
|
|
: BS 8 EMIT ; : LF 10 EMIT ; : CR 13 EMIT ;
|
|
: CRLF CR LF ; : SPC 32 EMIT ;
|
|
: NL 0x0a RAM+ @ ( NLPTR ) EXECUTE ;
|
|
: (uflw) LIT" stack underflow" ERR ;
|
|
XCURRENT @ _xapply ORG @ 0x06 ( stable ABI uflw ) + !
|
|
: (oflw) LIT" stack overflow" ERR ;
|
|
XCURRENT @ _xapply ORG @ 0x13 ( stable ABI oflw ) + !
|