1
0
mirror of https://github.com/dschmenk/PLASMA.git synced 2024-10-01 14:57:08 +00:00

Clean up the est of the sandbox demos.

This commit is contained in:
David Schmenk 2014-11-25 13:09:10 -08:00
parent d49ef63905
commit f009c58de5
3 changed files with 8 additions and 7 deletions

Binary file not shown.

View File

@ -25,7 +25,7 @@ byte[] a2e = "//e"
byte[] a2c = "//c"
byte[] a3 = "///"
byte[] offsets = "Structure offsets:"
word struct[] = 1, 10, 100, 1000, 10000
word array[] = 1, 10, 100, 1000, 10000
word ptr
byte spaces = " "
//
@ -87,8 +87,8 @@ export def main(range)
wend
putln
end
ptr = @struct
main(@struct:6)
ptr = @array
main(@array:6)
puti((ptr):6)
putln
puti(ptr=>6)

View File

@ -217,7 +217,7 @@ const WPTR_TYPE = $40
const PTR_TYPE = $60 // (BPTR_TYPE | WPTR_TYPE)
const XBYTE_TYPE = $22 // (BPTR_TYPE | BYTE_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
//
// Keywords
@ -2110,7 +2110,7 @@ def emit_data(vartype, consttype, constval, constsize)
emit_byte(constval)
else
size = 2
if consttype & XADDR_TYPE
if consttype == CONSTADDR_TYPE
emit_addr(constval)
else
emit_word(constval)
@ -2684,7 +2684,7 @@ def scan
elsif ^scanptr >= 'a' and ^scanptr <= 'f'
constval = (constval << 4) + ^scanptr - 'W'// 'a'-10
else
break//
break
fin
until !^scanptr
elsif ^scanptr == $27 // '
@ -2913,8 +2913,9 @@ def parse_constval(valptr, sizeptr)
idptr = id_lookup(tknptr, tknlen)
if !idptr; return parse_err(@bad_cnst); fin
type = idptr->idtype
if type & XADDR_TYPE
if type & ADDR_TYPE
if mod <> 8; return parse_err(@bad_cnst); fin
type = CONSTADDR_TYPE
fin
*valptr = idptr=>idval
break