Shi
Loading...
Searching...
No Matches
shi.hpp File Reference
#include <stddef.h>
#include <stdint.h>
#include <string.h>
#include <tuple>
#include <type_traits>
#include <functional>
Include dependency graph for shi.hpp:

Go to the source code of this file.

Classes

struct  Shi_init
 Init struct. More...
 
struct  Word
 Word. More...
 
struct  shi::remove_cvref< T >
 
struct  shi::is_reference_wrapper< T >
 
struct  shi::is_reference_wrapper< std::reference_wrapper< U > >
 
struct  shi::Init
 Init struct. More...
 
struct  shi::Word
 Word. More...
 

Namespaces

namespace  shi
 
namespace  shi::literals
 

Macros

#define SHI_STACK_SIZE   256
 Data-stack size (must be a multiple of 4 bytes)
 
#define SHI_ERASED_WORD   0xFFFFFFFF
 Most flash types are 0xFF erased.
 
#define SHI_ENABLE_NUMBER_PREFIX   1
 Enables the prefixes $, # and % for numbers.
 
#define SHI_ENABLE_PRINT   1
 Enables printing messages for errors.
 
#define SHI_ENABLE_REDEFINITION   0
 Enables redefining words.
 
#define SHI_ENABLE_STORE   1
 
#define SHI_ENABLE_TICK   1
 
#define SHI_ENABLE_TIMES   1
 
#define SHI_ENABLE_TIMES_DIV   1
 
#define SHI_ENABLE_TIMES_DIV_MOD   1
 
#define SHI_ENABLE_PLUS   1
 
#define SHI_ENABLE_PLUS_STORE   1
 
#define SHI_ENABLE_PLUS_LOOP   1
 
#define SHI_ENABLE_COMMA   1
 
#define SHI_ENABLE_MINUS   1
 
#define SHI_ENABLE_DIV   1
 
#define SHI_ENABLE_DIV_MOD   1
 
#define SHI_ENABLE_ZERO_LESS   1
 
#define SHI_ENABLE_ZERO_EQUAL   1
 
#define SHI_ENABLE_ONE_PLUS   1
 
#define SHI_ENABLE_ONE_MINUS   1
 
#define SHI_ENABLE_TWO_STORE   1
 
#define SHI_ENABLE_TWO_TIMES   1
 
#define SHI_ENABLE_TWO_DIV   1
 
#define SHI_ENABLE_TWO_FETCH   1
 
#define SHI_ENABLE_TWO_DROP   1
 
#define SHI_ENABLE_TWO_DUP   1
 
#define SHI_ENABLE_TWO_OVER   1
 
#define SHI_ENABLE_TWO_SWAP   1
 
#define SHI_ENABLE_COLON   1
 
#define SHI_ENABLE_SEMI   1
 
#define SHI_ENABLE_LESS   1
 
#define SHI_ENABLE_EQUAL   1
 
#define SHI_ENABLE_MORE   1
 
#define SHI_ENABLE_TO_BODY   1
 
#define SHI_ENABLE_TO_IN   1
 
#define SHI_ENABLE_TO_R   1
 
#define SHI_ENABLE_Q_DUP   1
 
#define SHI_ENABLE_FETCH   1
 
#define SHI_ENABLE_ABS   1
 
#define SHI_ENABLE_ALIGN   1
 
#define SHI_ENABLE_ALIGNED   1
 
#define SHI_ENABLE_ALLOT   1
 
#define SHI_ENABLE_AND   1
 
#define SHI_ENABLE_BASE   1
 
#define SHI_ENABLE_BEGIN   1
 
#define SHI_ENABLE_C_STORE   1
 
#define SHI_ENABLE_C_COMMA   1
 
#define SHI_ENABLE_C_FETCH   1
 
#define SHI_ENABLE_CELL_PLUS   1
 
#define SHI_ENABLE_CELLS   1
 
#define SHI_ENABLE_CHAR_PLUS   1
 
#define SHI_ENABLE_CHARS   1
 
#define SHI_ENABLE_CONSTANT   1
 
#define SHI_ENABLE_CREATE   1
 
#define SHI_ENABLE_DECIMAL   1
 
#define SHI_ENABLE_DEPTH   1
 
#define SHI_ENABLE_DO   1
 
#define SHI_ENABLE_DOES   1
 
#define SHI_ENABLE_DROP   1
 
#define SHI_ENABLE_DUP   1
 
#define SHI_ENABLE_ELSE   1
 
#define SHI_ENABLE_EXECUTE   1
 
#define SHI_ENABLE_EXIT   1
 
#define SHI_ENABLE_FILL   1
 
#define SHI_ENABLE_FIND   1
 
#define SHI_ENABLE_FM_DIV_MOD   1
 
#define SHI_ENABLE_HERE   1
 
#define SHI_ENABLE_I   1
 
#define SHI_ENABLE_IF   1
 
#define SHI_ENABLE_IMMEDIATE   1
 
#define SHI_ENABLE_INVERT   1
 
#define SHI_ENABLE_J   1
 
#define SHI_ENABLE_LEAVE   1
 
#define SHI_ENABLE_LITERAL   1
 
#define SHI_ENABLE_LOOP   1
 
#define SHI_ENABLE_LSHIFT   1
 
#define SHI_ENABLE_M_TIMES   1
 
#define SHI_ENABLE_MAX   1
 
#define SHI_ENABLE_MIN   1
 
#define SHI_ENABLE_MOD   1
 
#define SHI_ENABLE_MOVE   1
 
#define SHI_ENABLE_NEGATE   1
 
#define SHI_ENABLE_OR   1
 
#define SHI_ENABLE_OVER   1
 
#define SHI_ENABLE_POSTPONE   1
 
#define SHI_ENABLE_R_FROM   1
 
#define SHI_ENABLE_R_FETCH   1
 
#define SHI_ENABLE_RECURSE   1
 
#define SHI_ENABLE_REPEAT   1
 
#define SHI_ENABLE_ROT   1
 
#define SHI_ENABLE_RSHIFT   1
 
#define SHI_ENABLE_S_TO_D   1
 
#define SHI_ENABLE_SIGN   1
 
#define SHI_ENABLE_SM_DIV_REM   1
 
#define SHI_ENABLE_SOURCE   1
 
#define SHI_ENABLE_STATE   1
 
#define SHI_ENABLE_SWAP   1
 
#define SHI_ENABLE_THEN   1
 
#define SHI_ENABLE_U_LESS   1
 
#define SHI_ENABLE_UM_TIMES   1
 
#define SHI_ENABLE_UM_DIV_MOD   1
 
#define SHI_ENABLE_UNLOOP   1
 
#define SHI_ENABLE_UNTIL   1
 
#define SHI_ENABLE_VARIABLE   1
 
#define SHI_ENABLE_WHILE   1
 
#define SHI_ENABLE_XOR   1
 
#define SHI_ENABLE_BRACKET_LEFT   1
 
#define SHI_ENABLE_BRACKET_TICK   1
 
#define SHI_ENABLE_BRACKET_RIGHT   1
 
#define SHI_ENABLE_ZERO_NE   1
 
#define SHI_ENABLE_ZERO_MORE   1
 
#define SHI_ENABLE_TWO_TO_R   1
 
#define SHI_ENABLE_TWO_R_FROM   1
 
#define SHI_ENABLE_TWO_R_FETCH   1
 
#define SHI_ENABLE_NE   1
 
#define SHI_ENABLE_Q_DO   1
 
#define SHI_ENABLE_ACTION_OF   1
 
#define SHI_ENABLE_AGAIN   1
 
#define SHI_ENABLE_BUFFER_COLON   1
 
#define SHI_ENABLE_CASE   1
 
#define SHI_ENABLE_COMPILE_COMMA   1
 
#define SHI_ENABLE_ENDCASE   1
 
#define SHI_ENABLE_ENDOF   1
 
#define SHI_ENABLE_ERASE   1
 
#define SHI_ENABLE_FALSE   1
 
#define SHI_ENABLE_HEX   1
 
#define SHI_ENABLE_NIP   1
 
#define SHI_ENABLE_OF   1
 
#define SHI_ENABLE_PARSE_NAME   1
 
#define SHI_ENABLE_PICK   1
 
#define SHI_ENABLE_ROLL   1
 
#define SHI_ENABLE_TRUE   1
 
#define SHI_ENABLE_TUCK   1
 
#define SHI_ENABLE_U_MORE   1
 
#define SHI_ENABLE_UNUSED   1
 
#define SHI_ENABLE_VALUE   1
 
#define SHI_ENABLE_WITHIN   1
 
#define SHI_ENABLE_H_STORE   1
 
#define SHI_ENABLE_H_FETCH   1
 
#define SHI_ENABLE_INLINE   1
 
#define SHI_ENABLE_TO_TEXT_Q   1
 
#define SHI_ENABLE_TO_DATA_Q   1
 
#define SHI_ENABLE_TO_TEXT   1
 
#define SHI_ENABLE_TO_DATA   1
 

Typedefs

typedef void(* void_fp) ()
 
template<typename T >
using shi::remove_cvref_t = typename remove_cvref<T>::type
 

Functions

void shi_evaluate_asm (char const *str, size_t len)
 
void shi_variable_asm (char const *name, size_t len)
 
void shi_clear_asm ()
 
void_fp shi_tick_asm (char const *str, size_t len)
 
static void shi_push_number (int32_t t)
 
static void shi_push_double (int64_t t)
 
static void shi_push_struct (void *t, size_t n)
 
static int32_t shi_pop_number ()
 
static int64_t shi_pop_double ()
 
static void shi_pop_struct (void *t, size_t n)
 
static int32_t shi_top_number (size_t offset)
 
static int64_t shi_top_double (size_t offset)
 
static void shi_top_struct (void **t, size_t offset)
 
static size_t shi_depth ()
 
static size_t shi_size ()
 
void shi_init_asm (Shi_init *)
 
static void shi_init (Shi_init s)
 
static void shi_evaluate (char const *str)
 
static void shi_evaluate_len (char const *str, size_t len)
 
static void shi_variable (void *adr, char const *str)
 
static void shi_variable_len (void *adr, char const *str, size_t len)
 
static void shi_clear ()
 Clear stack.
 
static Word shi_tick (char const *str)
 
static Word shi_tick_len (char const *str, size_t len)
 
static void shi_word (Word w)
 
size_t shi::depth ()
 
size_t shi::size ()
 
template<typename T >
void shi::push (T &&t)
 
template<typename... Ts>
void shi::push (Ts &&... ts)
 
template<typename T = int32_t>
shi::pop ()
 
template<typename... Ts, typename = std::enable_if_t<(sizeof...(Ts) > 1)>>
std::tuple< Ts... > shi::pop ()
 
template<typename T = int32_t>
decltype(auto) shi::top (size_t offset=0)
 
void shi::shi_init_asm (Init &)
 
void shi::init (Init s)
 
void shi::evaluate (char const *str)
 
void shi::evaluate (char const *str, size_t len)
 
template<typename T >
void shi::variable (T adr, char const *str)
 
template<typename T >
void shi::variable (T adr, char const *str, size_t len)
 
void shi::clear ()
 Clear stack.
 
void_fp shi::tick (char const *str)
 
void_fp shi::tick (char const *str, size_t len)
 
void shi::literals::operator""_s (char const *str, size_t len)
 
auto shi::literals::operator""_v (char const *str, size_t len)
 
template<typename T , T... Cs>
Word shi::literals::operator""_w ()
 

Variables

uint32_t shi_context
 
template<typename T >
constexpr bool shi::is_reference_wrapper_v {is_reference_wrapper<T>::value}
 

Detailed Description

Shi

Author
Vincent Hamp
Date
11/04/2019

Macro Definition Documentation

◆ SHI_ENABLE_ABS

#define SHI_ENABLE_ABS   1

◆ SHI_ENABLE_ACTION_OF

#define SHI_ENABLE_ACTION_OF   1

◆ SHI_ENABLE_AGAIN

#define SHI_ENABLE_AGAIN   1

◆ SHI_ENABLE_ALIGN

#define SHI_ENABLE_ALIGN   1

◆ SHI_ENABLE_ALIGNED

#define SHI_ENABLE_ALIGNED   1

◆ SHI_ENABLE_ALLOT

#define SHI_ENABLE_ALLOT   1

◆ SHI_ENABLE_AND

#define SHI_ENABLE_AND   1

◆ SHI_ENABLE_BASE

#define SHI_ENABLE_BASE   1

◆ SHI_ENABLE_BEGIN

#define SHI_ENABLE_BEGIN   1

◆ SHI_ENABLE_BRACKET_LEFT

#define SHI_ENABLE_BRACKET_LEFT   1

◆ SHI_ENABLE_BRACKET_RIGHT

#define SHI_ENABLE_BRACKET_RIGHT   1

◆ SHI_ENABLE_BRACKET_TICK

#define SHI_ENABLE_BRACKET_TICK   1

◆ SHI_ENABLE_BUFFER_COLON

#define SHI_ENABLE_BUFFER_COLON   1

◆ SHI_ENABLE_C_COMMA

#define SHI_ENABLE_C_COMMA   1

◆ SHI_ENABLE_C_FETCH

#define SHI_ENABLE_C_FETCH   1

◆ SHI_ENABLE_C_STORE

#define SHI_ENABLE_C_STORE   1

◆ SHI_ENABLE_CASE

#define SHI_ENABLE_CASE   1

◆ SHI_ENABLE_CELL_PLUS

#define SHI_ENABLE_CELL_PLUS   1

◆ SHI_ENABLE_CELLS

#define SHI_ENABLE_CELLS   1

◆ SHI_ENABLE_CHAR_PLUS

#define SHI_ENABLE_CHAR_PLUS   1

◆ SHI_ENABLE_CHARS

#define SHI_ENABLE_CHARS   1

◆ SHI_ENABLE_COLON

#define SHI_ENABLE_COLON   1

◆ SHI_ENABLE_COMMA

#define SHI_ENABLE_COMMA   1

◆ SHI_ENABLE_COMPILE_COMMA

#define SHI_ENABLE_COMPILE_COMMA   1

◆ SHI_ENABLE_CONSTANT

#define SHI_ENABLE_CONSTANT   1

◆ SHI_ENABLE_CREATE

#define SHI_ENABLE_CREATE   1

◆ SHI_ENABLE_DECIMAL

#define SHI_ENABLE_DECIMAL   1

◆ SHI_ENABLE_DEPTH

#define SHI_ENABLE_DEPTH   1

◆ SHI_ENABLE_DIV

#define SHI_ENABLE_DIV   1

◆ SHI_ENABLE_DIV_MOD

#define SHI_ENABLE_DIV_MOD   1

◆ SHI_ENABLE_DO

#define SHI_ENABLE_DO   1

◆ SHI_ENABLE_DOES

#define SHI_ENABLE_DOES   1

◆ SHI_ENABLE_DROP

#define SHI_ENABLE_DROP   1

◆ SHI_ENABLE_DUP

#define SHI_ENABLE_DUP   1

◆ SHI_ENABLE_ELSE

#define SHI_ENABLE_ELSE   1

◆ SHI_ENABLE_ENDCASE

#define SHI_ENABLE_ENDCASE   1

◆ SHI_ENABLE_ENDOF

#define SHI_ENABLE_ENDOF   1

◆ SHI_ENABLE_EQUAL

#define SHI_ENABLE_EQUAL   1

◆ SHI_ENABLE_ERASE

#define SHI_ENABLE_ERASE   1

◆ SHI_ENABLE_EXECUTE

#define SHI_ENABLE_EXECUTE   1

◆ SHI_ENABLE_EXIT

#define SHI_ENABLE_EXIT   1

◆ SHI_ENABLE_FALSE

#define SHI_ENABLE_FALSE   1

◆ SHI_ENABLE_FETCH

#define SHI_ENABLE_FETCH   1

◆ SHI_ENABLE_FILL

#define SHI_ENABLE_FILL   1

◆ SHI_ENABLE_FIND

#define SHI_ENABLE_FIND   1

◆ SHI_ENABLE_FM_DIV_MOD

#define SHI_ENABLE_FM_DIV_MOD   1

◆ SHI_ENABLE_H_FETCH

#define SHI_ENABLE_H_FETCH   1

◆ SHI_ENABLE_H_STORE

#define SHI_ENABLE_H_STORE   1

◆ SHI_ENABLE_HERE

#define SHI_ENABLE_HERE   1

◆ SHI_ENABLE_HEX

#define SHI_ENABLE_HEX   1

◆ SHI_ENABLE_I

#define SHI_ENABLE_I   1

◆ SHI_ENABLE_IF

#define SHI_ENABLE_IF   1

◆ SHI_ENABLE_IMMEDIATE

#define SHI_ENABLE_IMMEDIATE   1

◆ SHI_ENABLE_INLINE

#define SHI_ENABLE_INLINE   1

◆ SHI_ENABLE_INVERT

#define SHI_ENABLE_INVERT   1

◆ SHI_ENABLE_J

#define SHI_ENABLE_J   1

◆ SHI_ENABLE_LEAVE

#define SHI_ENABLE_LEAVE   1

◆ SHI_ENABLE_LESS

#define SHI_ENABLE_LESS   1

◆ SHI_ENABLE_LITERAL

#define SHI_ENABLE_LITERAL   1

◆ SHI_ENABLE_LOOP

#define SHI_ENABLE_LOOP   1

◆ SHI_ENABLE_LSHIFT

#define SHI_ENABLE_LSHIFT   1

◆ SHI_ENABLE_M_TIMES

#define SHI_ENABLE_M_TIMES   1

◆ SHI_ENABLE_MAX

#define SHI_ENABLE_MAX   1

◆ SHI_ENABLE_MIN

#define SHI_ENABLE_MIN   1

◆ SHI_ENABLE_MINUS

#define SHI_ENABLE_MINUS   1

◆ SHI_ENABLE_MOD

#define SHI_ENABLE_MOD   1

◆ SHI_ENABLE_MORE

#define SHI_ENABLE_MORE   1

◆ SHI_ENABLE_MOVE

#define SHI_ENABLE_MOVE   1

◆ SHI_ENABLE_NE

#define SHI_ENABLE_NE   1

◆ SHI_ENABLE_NEGATE

#define SHI_ENABLE_NEGATE   1

◆ SHI_ENABLE_NIP

#define SHI_ENABLE_NIP   1

◆ SHI_ENABLE_NUMBER_PREFIX

#define SHI_ENABLE_NUMBER_PREFIX   1

Enables the prefixes $, # and % for numbers.

◆ SHI_ENABLE_OF

#define SHI_ENABLE_OF   1

◆ SHI_ENABLE_ONE_MINUS

#define SHI_ENABLE_ONE_MINUS   1

◆ SHI_ENABLE_ONE_PLUS

#define SHI_ENABLE_ONE_PLUS   1

◆ SHI_ENABLE_OR

#define SHI_ENABLE_OR   1

◆ SHI_ENABLE_OVER

#define SHI_ENABLE_OVER   1

◆ SHI_ENABLE_PARSE_NAME

#define SHI_ENABLE_PARSE_NAME   1

◆ SHI_ENABLE_PICK

#define SHI_ENABLE_PICK   1

◆ SHI_ENABLE_PLUS

#define SHI_ENABLE_PLUS   1

◆ SHI_ENABLE_PLUS_LOOP

#define SHI_ENABLE_PLUS_LOOP   1

◆ SHI_ENABLE_PLUS_STORE

#define SHI_ENABLE_PLUS_STORE   1

◆ SHI_ENABLE_POSTPONE

#define SHI_ENABLE_POSTPONE   1

◆ SHI_ENABLE_PRINT

#define SHI_ENABLE_PRINT   1

Enables printing messages for errors.

◆ SHI_ENABLE_Q_DO

#define SHI_ENABLE_Q_DO   1

◆ SHI_ENABLE_Q_DUP

#define SHI_ENABLE_Q_DUP   1

◆ SHI_ENABLE_R_FETCH

#define SHI_ENABLE_R_FETCH   1

◆ SHI_ENABLE_R_FROM

#define SHI_ENABLE_R_FROM   1

◆ SHI_ENABLE_RECURSE

#define SHI_ENABLE_RECURSE   1

◆ SHI_ENABLE_REDEFINITION

#define SHI_ENABLE_REDEFINITION   0

Enables redefining words.

◆ SHI_ENABLE_REPEAT

#define SHI_ENABLE_REPEAT   1

◆ SHI_ENABLE_ROLL

#define SHI_ENABLE_ROLL   1

◆ SHI_ENABLE_ROT

#define SHI_ENABLE_ROT   1

◆ SHI_ENABLE_RSHIFT

#define SHI_ENABLE_RSHIFT   1

◆ SHI_ENABLE_S_TO_D

#define SHI_ENABLE_S_TO_D   1

◆ SHI_ENABLE_SEMI

#define SHI_ENABLE_SEMI   1

◆ SHI_ENABLE_SIGN

#define SHI_ENABLE_SIGN   1

◆ SHI_ENABLE_SM_DIV_REM

#define SHI_ENABLE_SM_DIV_REM   1

◆ SHI_ENABLE_SOURCE

#define SHI_ENABLE_SOURCE   1

◆ SHI_ENABLE_STATE

#define SHI_ENABLE_STATE   1

◆ SHI_ENABLE_STORE

#define SHI_ENABLE_STORE   1

◆ SHI_ENABLE_SWAP

#define SHI_ENABLE_SWAP   1

◆ SHI_ENABLE_THEN

#define SHI_ENABLE_THEN   1

◆ SHI_ENABLE_TICK

#define SHI_ENABLE_TICK   1

◆ SHI_ENABLE_TIMES

#define SHI_ENABLE_TIMES   1

◆ SHI_ENABLE_TIMES_DIV

#define SHI_ENABLE_TIMES_DIV   1

◆ SHI_ENABLE_TIMES_DIV_MOD

#define SHI_ENABLE_TIMES_DIV_MOD   1

◆ SHI_ENABLE_TO_BODY

#define SHI_ENABLE_TO_BODY   1

◆ SHI_ENABLE_TO_DATA

#define SHI_ENABLE_TO_DATA   1

◆ SHI_ENABLE_TO_DATA_Q

#define SHI_ENABLE_TO_DATA_Q   1

◆ SHI_ENABLE_TO_IN

#define SHI_ENABLE_TO_IN   1

◆ SHI_ENABLE_TO_R

#define SHI_ENABLE_TO_R   1

◆ SHI_ENABLE_TO_TEXT

#define SHI_ENABLE_TO_TEXT   1

◆ SHI_ENABLE_TO_TEXT_Q

#define SHI_ENABLE_TO_TEXT_Q   1

◆ SHI_ENABLE_TRUE

#define SHI_ENABLE_TRUE   1

◆ SHI_ENABLE_TUCK

#define SHI_ENABLE_TUCK   1

◆ SHI_ENABLE_TWO_DIV

#define SHI_ENABLE_TWO_DIV   1

◆ SHI_ENABLE_TWO_DROP

#define SHI_ENABLE_TWO_DROP   1

◆ SHI_ENABLE_TWO_DUP

#define SHI_ENABLE_TWO_DUP   1

◆ SHI_ENABLE_TWO_FETCH

#define SHI_ENABLE_TWO_FETCH   1

◆ SHI_ENABLE_TWO_OVER

#define SHI_ENABLE_TWO_OVER   1

◆ SHI_ENABLE_TWO_R_FETCH

#define SHI_ENABLE_TWO_R_FETCH   1

◆ SHI_ENABLE_TWO_R_FROM

#define SHI_ENABLE_TWO_R_FROM   1

◆ SHI_ENABLE_TWO_STORE

#define SHI_ENABLE_TWO_STORE   1

◆ SHI_ENABLE_TWO_SWAP

#define SHI_ENABLE_TWO_SWAP   1

◆ SHI_ENABLE_TWO_TIMES

#define SHI_ENABLE_TWO_TIMES   1

◆ SHI_ENABLE_TWO_TO_R

#define SHI_ENABLE_TWO_TO_R   1

◆ SHI_ENABLE_U_LESS

#define SHI_ENABLE_U_LESS   1

◆ SHI_ENABLE_U_MORE

#define SHI_ENABLE_U_MORE   1

◆ SHI_ENABLE_UM_DIV_MOD

#define SHI_ENABLE_UM_DIV_MOD   1

◆ SHI_ENABLE_UM_TIMES

#define SHI_ENABLE_UM_TIMES   1

◆ SHI_ENABLE_UNLOOP

#define SHI_ENABLE_UNLOOP   1

◆ SHI_ENABLE_UNTIL

#define SHI_ENABLE_UNTIL   1

◆ SHI_ENABLE_UNUSED

#define SHI_ENABLE_UNUSED   1

◆ SHI_ENABLE_VALUE

#define SHI_ENABLE_VALUE   1

◆ SHI_ENABLE_VARIABLE

#define SHI_ENABLE_VARIABLE   1

◆ SHI_ENABLE_WHILE

#define SHI_ENABLE_WHILE   1

◆ SHI_ENABLE_WITHIN

#define SHI_ENABLE_WITHIN   1

◆ SHI_ENABLE_XOR

#define SHI_ENABLE_XOR   1

◆ SHI_ENABLE_ZERO_EQUAL

#define SHI_ENABLE_ZERO_EQUAL   1

◆ SHI_ENABLE_ZERO_LESS

#define SHI_ENABLE_ZERO_LESS   1

◆ SHI_ENABLE_ZERO_MORE

#define SHI_ENABLE_ZERO_MORE   1

◆ SHI_ENABLE_ZERO_NE

#define SHI_ENABLE_ZERO_NE   1

◆ SHI_ERASED_WORD

#define SHI_ERASED_WORD   0xFFFFFFFF

Most flash types are 0xFF erased.

◆ SHI_STACK_SIZE

#define SHI_STACK_SIZE   256

Data-stack size (must be a multiple of 4 bytes)

Typedef Documentation

◆ void_fp

typedef void(* void_fp) ()

Function Documentation

◆ shi_clear()

static void shi_clear ( )
inlinestatic

Clear stack.

Here is the call graph for this function:

◆ shi_clear_asm()

void shi_clear_asm ( )
Here is the caller graph for this function:

◆ shi_depth()

static size_t shi_depth ( )
inlinestatic

Returns the number of elements on the stack

Returns
Number of elements on stack
Here is the caller graph for this function:

◆ shi_evaluate()

static void shi_evaluate ( char const * str)
inlinestatic

Evaluate

Parameters
strPointer to the null-terminated byte string
Here is the call graph for this function:

◆ shi_evaluate_asm()

void shi_evaluate_asm ( char const * str,
size_t len )
Here is the caller graph for this function:

◆ shi_evaluate_len()

static void shi_evaluate_len ( char const * str,
size_t len )
inlinestatic

Evaluate

Parameters
strPointer to the null-terminated byte string
lenLength of the null-terminated string
Here is the call graph for this function:

◆ shi_init()

static void shi_init ( Shi_init s)
inlinestatic

Initialize

Parameters
sInit struct
Here is the call graph for this function:

◆ shi_init_asm()

void shi_init_asm ( Shi_init * )
Here is the caller graph for this function:

◆ shi_pop_double()

static int64_t shi_pop_double ( )
inlinestatic

Remove double-cell number from the top of the stack

Returns
Double-cell number

◆ shi_pop_number()

static int32_t shi_pop_number ( )
inlinestatic

Remove number from the top of the stack

Returns
Number

◆ shi_pop_struct()

static void shi_pop_struct ( void * t,
size_t n )
inlinestatic

Remove user-defined type from the top of the stack

Parameters
tPointer to user-defined type
nSize of user-defined type

◆ shi_push_double()

static void shi_push_double ( int64_t t)
inlinestatic

Add double-cell number to the top of the stack

Parameters
tDouble-cell number to push

◆ shi_push_number()

static void shi_push_number ( int32_t t)
inlinestatic

Add number to the top of the stack

Parameters
tNumber to push
Here is the caller graph for this function:

◆ shi_push_struct()

static void shi_push_struct ( void * t,
size_t n )
inlinestatic

Add user-defined type to the top of the stack

Parameters
tPointer to user-defined type
nSize of user-defined type

◆ shi_size()

static size_t shi_size ( )
inlinestatic

Returns the number of elements on the stack

Returns
Number of elements on stack
Here is the call graph for this function:

◆ shi_tick()

static Word shi_tick ( char const * str)
inlinestatic

Tick

Parameters
strPointer to the null-terminated byte string
Returns
Word
Here is the call graph for this function:

◆ shi_tick_asm()

void_fp shi_tick_asm ( char const * str,
size_t len )
Here is the caller graph for this function:

◆ shi_tick_len()

static Word shi_tick_len ( char const * str,
size_t len )
inlinestatic

Tick

Parameters
strPointer to the null-terminated byte string
lenLength of the null-terminated string
Returns
Word
Here is the call graph for this function:

◆ shi_top_double()

static int64_t shi_top_double ( size_t offset)
inlinestatic

Get double-cell number from the stack

Parameters
offsetOffset in cells
Returns
Double-cell number

◆ shi_top_number()

static int32_t shi_top_number ( size_t offset)
inlinestatic

Get number from the stack

Parameters
offsetOffset in cells
Returns
Number

◆ shi_top_struct()

static void shi_top_struct ( void ** t,
size_t offset )
inlinestatic

Get user-defined type from the stack

Parameters
tPointer to user-defined type
offsetOffset in cells

◆ shi_variable()

static void shi_variable ( void * adr,
char const * str )
inlinestatic

Create reference to C variable

Parameters
adrAddress of variable
strPointer to the null-terminated byte string
Here is the call graph for this function:

◆ shi_variable_asm()

void shi_variable_asm ( char const * name,
size_t len )
Here is the caller graph for this function:

◆ shi_variable_len()

static void shi_variable_len ( void * adr,
char const * str,
size_t len )
inlinestatic

Create reference to C variable

Parameters
adrAddress of variable
strPointer to the null-terminated byte string
lenLength of the null-terminated string
Here is the call graph for this function:

◆ shi_word()

static void shi_word ( Word w)
inlinestatic

Call word

Parameters
wWord

Variable Documentation

◆ shi_context

uint32_t shi_context
extern