Changed round prompt .s and numbers.
This commit is contained in:
@ -3,7 +3,7 @@
|
|||||||
also streams also WebServer also WiFi
|
also streams also WebServer also WiFi
|
||||||
vocabulary web-interface also web-interface definitions
|
vocabulary web-interface also web-interface definitions
|
||||||
|
|
||||||
: n. ( n -- ) <# #s #> type ; : ip# dup 255 and n. [char] . emit 256 / ;
|
: ip# dup 255 and n. [char] . emit 256 / ;
|
||||||
: ip. ( n -- ) ip# ip# ip# 255 and . ;
|
: ip. ( n -- ) ip# ip# ip# 255 and . ;
|
||||||
|
|
||||||
r|
|
r|
|
||||||
|
|||||||
@ -1,6 +1,5 @@
|
|||||||
( ANSI Codes )
|
( ANSI Codes )
|
||||||
vocabulary ansi ansi definitions
|
vocabulary ansi ansi definitions
|
||||||
: n. ( n -- ) base @ swap decimal <# #s #> type base ! ;
|
|
||||||
: esc 27 emit ; : bel 7 emit ;
|
: esc 27 emit ; : bel 7 emit ;
|
||||||
: clear-to-eol esc ." [0K" ;
|
: clear-to-eol esc ." [0K" ;
|
||||||
: scroll-down esc ." D" ;
|
: scroll-down esc ." D" ;
|
||||||
|
|||||||
@ -161,6 +161,7 @@ variable hld
|
|||||||
: u. ( u -- ) <# #s #> type space ;
|
: u. ( u -- ) <# #s #> type space ;
|
||||||
: . ( w -- ) base @ 10 xor if u. exit then str type space ;
|
: . ( w -- ) base @ 10 xor if u. exit then str type space ;
|
||||||
: ? ( a -- ) @ . ;
|
: ? ( a -- ) @ . ;
|
||||||
|
: n. ( n -- ) base @ swap decimal <# #s #> type base ! ;
|
||||||
|
|
||||||
( Strings )
|
( Strings )
|
||||||
: parse-quote ( -- a n ) [char] " parse ;
|
: parse-quote ( -- a n ) [char] " parse ;
|
||||||
@ -200,11 +201,12 @@ variable hld
|
|||||||
( Examine Memory )
|
( Examine Memory )
|
||||||
: dump ( a n -- )
|
: dump ( a n -- )
|
||||||
cr 0 do i 16 mod 0= if cr then dup i + c@ . loop drop cr ;
|
cr 0 do i 16 mod 0= if cr then dup i + c@ . loop drop cr ;
|
||||||
|
: raw.s depth 0 max for aft sp@ r@ cells - @ . then next ;
|
||||||
|
|
||||||
( Input )
|
( Input )
|
||||||
variable echo
|
variable echo -1 echo !
|
||||||
: ?echo ( n -- ) echo @ if emit else drop then ;
|
: ?echo ( n -- ) echo @ if emit else drop then ;
|
||||||
: ?echo-prompt echo @ if ." --> " then ;
|
: ?echo-prompt echo @ if >r >r raw.s r> r> ." --> " then ;
|
||||||
: accept ( a n -- n ) ?echo-prompt 0 swap begin 2dup < while
|
: accept ( a n -- n ) ?echo-prompt 0 swap begin 2dup < while
|
||||||
key
|
key
|
||||||
dup nl = if ?echo drop nip exit then
|
dup nl = if ?echo drop nip exit then
|
||||||
|
|||||||
@ -1,7 +1,4 @@
|
|||||||
( Variable useful but non-critical words )
|
( Words built after boot )
|
||||||
|
|
||||||
: .s ." <" depth <# #s #> type ." > "
|
|
||||||
depth 0 max for aft sp@ r@ cells - @ . then next cr ;
|
|
||||||
: assert ( f -- ) 0= throw ;
|
: assert ( f -- ) 0= throw ;
|
||||||
|
|
||||||
internals definitions
|
internals definitions
|
||||||
@ -10,5 +7,6 @@ internals definitions
|
|||||||
forth definitions also internals
|
forth definitions also internals
|
||||||
: str= ( a n a n -- f) >r swap r@ <> if rdrop 2drop 0 exit then r> mem= ;
|
: str= ( a n a n -- f) >r swap r@ <> if rdrop 2drop 0 exit then r> mem= ;
|
||||||
: startswith? ( a n a n -- f ) >r swap r@ < if rdrop 2drop 0 exit then r> mem= ;
|
: startswith? ( a n a n -- f ) >r swap r@ < if rdrop 2drop 0 exit then r> mem= ;
|
||||||
|
: .s ." <" depth n. ." > " raw.s cr ;
|
||||||
only forth definitions
|
only forth definitions
|
||||||
|
|
||||||
|
|||||||
@ -38,7 +38,7 @@ transfer{
|
|||||||
(do) (?do) (+loop)
|
(do) (?do) (+loop)
|
||||||
parse-quote digit $@
|
parse-quote digit $@
|
||||||
see. see-loop >name-length exit=
|
see. see-loop >name-length exit=
|
||||||
see-one
|
see-one raw.s
|
||||||
tib-setup input-limit
|
tib-setup input-limit
|
||||||
}transfer
|
}transfer
|
||||||
forth definitions
|
forth definitions
|
||||||
|
|||||||
Reference in New Issue
Block a user