mirror of
https://github.com/dschmenk/PLASMA.git
synced 2025-01-12 20:29:49 +00:00
Clean up the est of the sandbox demos.
This commit is contained in:
parent
d49ef63905
commit
f009c58de5
BIN
SANDBOX.PO
BIN
SANDBOX.PO
Binary file not shown.
@ -25,7 +25,7 @@ byte[] a2e = "//e"
|
|||||||
byte[] a2c = "//c"
|
byte[] a2c = "//c"
|
||||||
byte[] a3 = "///"
|
byte[] a3 = "///"
|
||||||
byte[] offsets = "Structure offsets:"
|
byte[] offsets = "Structure offsets:"
|
||||||
word struct[] = 1, 10, 100, 1000, 10000
|
word array[] = 1, 10, 100, 1000, 10000
|
||||||
word ptr
|
word ptr
|
||||||
byte spaces = " "
|
byte spaces = " "
|
||||||
//
|
//
|
||||||
@ -87,8 +87,8 @@ export def main(range)
|
|||||||
wend
|
wend
|
||||||
putln
|
putln
|
||||||
end
|
end
|
||||||
ptr = @struct
|
ptr = @array
|
||||||
main(@struct:6)
|
main(@array:6)
|
||||||
puti((ptr):6)
|
puti((ptr):6)
|
||||||
putln
|
putln
|
||||||
puti(ptr=>6)
|
puti(ptr=>6)
|
||||||
|
@ -217,7 +217,7 @@ const WPTR_TYPE = $40
|
|||||||
const PTR_TYPE = $60 // (BPTR_TYPE | WPTR_TYPE)
|
const PTR_TYPE = $60 // (BPTR_TYPE | WPTR_TYPE)
|
||||||
const XBYTE_TYPE = $22 // (BPTR_TYPE | BYTE_TYPE)
|
const XBYTE_TYPE = $22 // (BPTR_TYPE | BYTE_TYPE)
|
||||||
const XWORD_TYPE = $44 // (WPTR_TYPE | WORD_TYPE)
|
const XWORD_TYPE = $44 // (WPTR_TYPE | WORD_TYPE)
|
||||||
const XADDR_TYPE = $6E
|
const CONSTADDR_TYPE = $61 // (CONST_TYPE | PTR_TYPE)
|
||||||
const STR_TYPE = $80
|
const STR_TYPE = $80
|
||||||
//
|
//
|
||||||
// Keywords
|
// Keywords
|
||||||
@ -2110,7 +2110,7 @@ def emit_data(vartype, consttype, constval, constsize)
|
|||||||
emit_byte(constval)
|
emit_byte(constval)
|
||||||
else
|
else
|
||||||
size = 2
|
size = 2
|
||||||
if consttype & XADDR_TYPE
|
if consttype == CONSTADDR_TYPE
|
||||||
emit_addr(constval)
|
emit_addr(constval)
|
||||||
else
|
else
|
||||||
emit_word(constval)
|
emit_word(constval)
|
||||||
@ -2684,7 +2684,7 @@ def scan
|
|||||||
elsif ^scanptr >= 'a' and ^scanptr <= 'f'
|
elsif ^scanptr >= 'a' and ^scanptr <= 'f'
|
||||||
constval = (constval << 4) + ^scanptr - 'W'// 'a'-10
|
constval = (constval << 4) + ^scanptr - 'W'// 'a'-10
|
||||||
else
|
else
|
||||||
break//
|
break
|
||||||
fin
|
fin
|
||||||
until !^scanptr
|
until !^scanptr
|
||||||
elsif ^scanptr == $27 // '
|
elsif ^scanptr == $27 // '
|
||||||
@ -2913,8 +2913,9 @@ def parse_constval(valptr, sizeptr)
|
|||||||
idptr = id_lookup(tknptr, tknlen)
|
idptr = id_lookup(tknptr, tknlen)
|
||||||
if !idptr; return parse_err(@bad_cnst); fin
|
if !idptr; return parse_err(@bad_cnst); fin
|
||||||
type = idptr->idtype
|
type = idptr->idtype
|
||||||
if type & XADDR_TYPE
|
if type & ADDR_TYPE
|
||||||
if mod <> 8; return parse_err(@bad_cnst); fin
|
if mod <> 8; return parse_err(@bad_cnst); fin
|
||||||
|
type = CONSTADDR_TYPE
|
||||||
fin
|
fin
|
||||||
*valptr = idptr=>idval
|
*valptr = idptr=>idval
|
||||||
break
|
break
|
||||||
|
Loading…
x
Reference in New Issue
Block a user