|
nanoFORTH v2.2
|
Functions | |
| void | set_pre (const char *code) |
| set embedded Forth code | |
| void | set_io (Stream *s) |
| initialize or redirect IO stream | |
| void | set_hex (U8 f) |
| enable/disable hex numeric radix | |
| void | set_ucase (U8 uc) |
| set case sensitiveness | |
| char | uc (char c) |
| void | mstat () |
| display MMU statistics | |
| char | vkey () |
| void | _console_input () |
Console IO Functions with Cooperative Threading support | |
| char | key () |
| Arduino's Serial.getchar(), yield to user tasks when waiting. | |
| void | d_chr (char c) |
| print a char to console | |
| void | d_adr (IU a) |
| print a 12-bit address | |
| void | d_ptr (U8 *p) |
| print a pointer | |
| void | d_num (DU n) |
| sent a number literal to console | |
| void | d_pin (U16 p, U16 v) |
| set pin a given pinMode (INPUT, OUTPUT) | |
| U16 | d_in (U16 p) |
| fetch from GPIO port | |
| void | d_out (U16 p, U16 v) |
| send output to GPIO ports | |
| U16 | a_in (U16 p) |
| fetch from analog port | |
| void | a_out (U16 p, U16 v) |
| send output to GPIO ports | |
| void | d_str (U8 *p) |
| handle dot string (byte-stream leading with length) | |
| void | d_nib (U8 n) |
| print a nibble | |
| void | d_u8 (U8 c) |
| print a 8-bit hex number | |
dot_* for Console Input/Output Routines | |
| void | d_mem (U8 *base, U8 *p0, IU sz, U8 delim) |
| void | d_name (U8 *p) |
| print 3 characters name | |
| void | d_name (U8 op, const char *lst, U8 space) |
Input buffer Functions | |
| U8 | number (U8 *str, DU *num) |
| void | clear_tib () |
| reset input buffer | |
| U8 | ok () |
| check whether input buffer is empty | |
| U8 * | get_token (U8 rst=0) |
| get a token from console input | |
| U8 | scan (U8 *tkn, const char *lst, IU *id) |
Variables | |
MMU controls | |
| U8 | dic [N4_RAM_SZ] |
| base of dictionary | |
| N4Task | vm { NULL, NULL } |
| VM context. | |
IO controls | |
| Stream * | io { &Serial } |
| default to Arduino Serial Monitor | |
| U8 | trc { 0 } |
| tracing control flag | |
| char * | _pre { NULL } |
| preload Forth code | |
| U8 * | _tib { &dic[N4_DIC_SZ+N4_STK_SZ] } |
| base of terminal input buffer | |
| U8 | _empty { 1 } |
| empty flag for terminal input buffer | |
| U8 | _hex { 0 } |
| numeric radix for display | |
| U8 | _ucase { 0 } |
| empty flag for terminal input buffer | |
| void N4Core::set_pre | ( | const char * | code | ) |
set embedded Forth code
| void N4Core::set_io | ( | Stream * | s | ) |
initialize or redirect IO stream
| void N4Core::set_hex | ( | U8 | f | ) |
enable/disable hex numeric radix
| void N4Core::set_ucase | ( | U8 | uc | ) |
set case sensitiveness
| char N4Core::uc | ( | char | c | ) |
< upper case for case-insensitive matching
| void N4Core::mstat | ( | ) |
display MMU statistics
show system memory allocation info
dictionary size
stack size
terminal input buf
| char N4Core::key | ( | ) |
Arduino's Serial.getchar(), yield to user tasks when waiting.
char IO from console i.e. RX/TX
| void N4Core::d_chr | ( | char | c | ) |
print a char to console
| void N4Core::d_adr | ( | IU | a | ) |
print a 12-bit address
| void N4Core::d_ptr | ( | U8 * | p | ) |
print a pointer
| void N4Core::d_num | ( | DU | n | ) |
sent a number literal to console
| void N4Core::d_str | ( | U8 * | p | ) |
handle dot string (byte-stream leading with length)
| void N4Core::d_nib | ( | U8 | n | ) |
print a nibble
| void N4Core::d_u8 | ( | U8 | c | ) |
print a 8-bit hex number
dump byte-stream between pointers with delimiter option
| base | display memory block reference memory pointer (start of dictionary) |
| p0 | starting memory pointer |
| sz | number of bytes to print |
| delim | delimiter, ' ' for space, 0 for none |
| void N4Core::d_name | ( | U8 * | p | ) |
print 3 characters name
display the opcode name
| op | display opcode & 3-char name opcode |
| lst | nanoForth string formatted list |
| space | delimiter to append at the end |
parse a literal from string
| tkn | process a literal from string given token string of a number |
| num | number pointer for return value |
| void N4Core::clear_tib | ( | ) |
| char N4Core::vkey | ( | ) |
fill input buffer from console char-by-char til CR or LF hit
capture preload Forth code
feed key() after preload exhausted
| void N4Core::_console_input | ( | ) |
| U8 N4Core::ok | ( | ) |
check whether input buffer is empty
display OK prompt if input buffer is empty
console prompt with stack dump
get a token from console input
capture a token from console input buffer
token pointer to input buffer
dot_string flag
read from console (with trailing blank)
skip leading spaces
find the end of comment
skip trailing spaces
search keyword in a nanoForth name field list
- one blank byte padded at the end of input string
scan token from a given string list
| tkn | find token in given string list token to be searched |
| lst | string list to be scanned |
| id | resultant index if found |
| U8 N4Core::dic |
base of dictionary
| N4Task N4Core::vm { NULL, NULL } |
VM context.
VM state.
| Stream * N4Core::io { &Serial } |
default to Arduino Serial Monitor
| U8 N4Core::trc { 0 } |
tracing control flag
tracing flag
| char* N4Core::_pre { NULL } |
preload Forth code
| U8 N4Core::_empty { 1 } |
empty flag for terminal input buffer
| U8 N4Core::_hex { 0 } |
numeric radix for display
| U8 N4Core::_ucase { 0 } |
empty flag for terminal input buffer