mirror of
https://github.com/dschmenk/PLASMA.git
synced 2025-04-07 01:38:18 +00:00
Fix create and friends
This commit is contained in:
parent
9aa0ab68ee
commit
5d6b9b1f7e
@ -32,12 +32,12 @@ predef _add_(a,b)#1, _inc_(a)#1, _inc2_(a)#1, _sub_(a,b)#1, _mul_(a,b)#1, _div_(
|
||||
predef _neg_(a)#1, _and_(a,b)#1, _or_(a,b)#1, _xor_(a,b)#1, _not_(a)#1
|
||||
predef _abs_(a)#1, _max_(a,b)#1, _min_(a,b)#1
|
||||
predef _cset_(a,b)#0, _cget_(a)#1, _wset_(a,b)#0, _wplusset_(a,b)#0, _wget_(a)#1
|
||||
predef _ffa_(a)#1, _lfa_(a)#1, _cfa_(a)#1, _pfa_(a)#1
|
||||
predef _ffa_(a)#1, _lfa_(a)#1, _cfa_(a)#1, _pfa_(a)#1, _allot_(a)#0
|
||||
predef _eq_(a,b)#1, _gt_(a,b)#1, _lt_(a,b)#1, _0lt_(a)#1, _0eq_(a)#1
|
||||
predef _branch_#0, _0branch_(a)#0, _if_#0, _else_#0, _then_#0
|
||||
predef _begin_#0, _again_#0, _until_#0, _while_#0, _repeat_#0
|
||||
predef _do_#0, _doloop_#0, _doplusloop_(a)#0, _plusloop_#0, _loop_#0, _leave_#0, _j_#1
|
||||
predef _create_#0, _builds_#0, _dodoes_#0, _filldoes_#0, _does_#0
|
||||
predef _buildcreate_#0, _builds_#0, _dodoes_#0, _filldoes_#0, _does_#0
|
||||
predef pfillw(a)#0, pfillb(a)#0, _colon_#0, _semi_#0
|
||||
predef _tors_(a)#0, _fromrs_#1, _toprs_#1, _execute_(a)#0, _lookup_#1
|
||||
predef _cmove_(a,b,c)#0, _move_(a,b,c)#0, _fill_(a,b,c)#0, _plasma_#0
|
||||
@ -185,7 +185,7 @@ byte = 0
|
||||
word = @d_fromrstk, @_toprs_, 0
|
||||
// PLASMA SYMBOL LOOKUP
|
||||
char d_lookup = "LOOKUP"
|
||||
byte = 0
|
||||
byte = imm_flag
|
||||
word = @d_toprstk, @_lookup_, 0
|
||||
// PLASMA LINKEAGE
|
||||
char d_plasma = "PLASMA"
|
||||
@ -218,7 +218,7 @@ word = @d_fill, @heapmark, 0
|
||||
// ALLOT
|
||||
char d_allot = "ALLOT"
|
||||
byte = 0
|
||||
word = @d_here, @heapalloc, 0
|
||||
word = @d_here, @_allot_, 0
|
||||
// BRANCH
|
||||
char d_branch = "(BRANCH)"
|
||||
byte = param_flag
|
||||
@ -298,7 +298,7 @@ word = @d_repeat, @_forget_, 0
|
||||
// CREATE
|
||||
char d_create = "CREATE"
|
||||
byte = imm_flag
|
||||
word = @d_forget, @_create_, 0
|
||||
word = @d_forget, @_buildcreate_, 0
|
||||
// BUILDS
|
||||
char d_builds = "<BUILDS"
|
||||
byte = imm_flag
|
||||
@ -800,9 +800,7 @@ def interpret#0
|
||||
else
|
||||
value, valid = isnum(inchars, inlen)
|
||||
if not valid
|
||||
if state & comp_flag
|
||||
warmstart
|
||||
fin
|
||||
warmstart
|
||||
puts("? No match\n")
|
||||
else
|
||||
if state & comp_flag
|
||||
@ -968,6 +966,9 @@ def _slit_#1
|
||||
IIP = IIP + ^IIP + 1
|
||||
return slit
|
||||
end
|
||||
def _allot_(a)#0
|
||||
heapalloc(a)
|
||||
end
|
||||
def _cmove_(a,b,c)#0
|
||||
memcpy(b, a, c)
|
||||
end
|
||||
@ -1003,6 +1004,10 @@ def _create_#0
|
||||
*bldptr = bldptr + 2; // Code ptr linked to PFA
|
||||
heapalloc(bldptr - vlist + 2)
|
||||
end
|
||||
def _buildcreate_#0
|
||||
_create_
|
||||
pfillw(0) // Allocate space for LFA
|
||||
end
|
||||
def stodci(str, dci)
|
||||
byte len, c
|
||||
|
||||
@ -1089,9 +1094,6 @@ end
|
||||
def _builds_#0
|
||||
if state & comp_itc_flag
|
||||
pfillw(@d_create)
|
||||
pfillw(@d_lit) // Allocate space for PFA to be filled in during _filldoes_
|
||||
pfillw(2)
|
||||
pfillw(@d_allot)
|
||||
else // comp_pbc_flag
|
||||
pfillb($54) // CALL
|
||||
pfillw(@_create_)
|
||||
|
Loading…
x
Reference in New Issue
Block a user