mirror of
https://github.com/nineties/planckforth
synced 2024-12-25 21:58:22 +01:00
Add typen
This commit is contained in:
parent
32027f66f3
commit
5241c8e2d8
1 changed files with 12 additions and 1 deletions
13
bootstrap.fs
13
bootstrap.fs
|
@ -1253,6 +1253,17 @@ decimal \ set default to decimal
|
|||
2drop
|
||||
;
|
||||
|
||||
\ Print string up to u characters
|
||||
: typen ( c-addr u -- )
|
||||
begin dup 0> while
|
||||
1- swap dup c@ dup unless
|
||||
2drop exit
|
||||
then
|
||||
emit 1+ swap
|
||||
repeat
|
||||
;
|
||||
|
||||
|
||||
\ Allocate a buffer for string literal
|
||||
bl bl * constant s-buffer-size \ 1024
|
||||
create s-buffer s-buffer-size allot
|
||||
|
@ -2521,7 +2532,7 @@ need-defined (read)
|
|||
do loop +loop unloop leave i j k
|
||||
|
||||
char [char] key emit spaces
|
||||
.s . .r u. u.r dec. hex. type
|
||||
.s . .r u. u.r dec. hex. type typen
|
||||
." s" bl '\n' cr space base decimal hex
|
||||
catch throw success
|
||||
: ; [ ] immediate create >body :noname does> variable constant
|
||||
|
|
Loading…
Reference in a new issue