.text -> .str

This commit is contained in:
Irmen de Jong 2018-04-03 16:40:24 +02:00
parent 4e38f7d6b3
commit 68dd767be8
15 changed files with 218 additions and 218 deletions

View File

@ -209,7 +209,7 @@ def _generate_string_var(out: Callable, vardef: VarDef) -> None:
out("{:s}\n\v.null {:s}".format(vardef.name, _format_string(str(vardef.value.value))))
elif vardef.datatype == DataType.STRING_P:
# pascal string
out("{:s}\n\v.ptext {:s}".format(vardef.name, _format_string(str(vardef.value.value))))
out("{:s}\n\v.strp {:s}".format(vardef.name, _format_string(str(vardef.value.value))))
elif vardef.datatype == DataType.STRING_S:
# 0-terminated string in screencode encoding
out(".enc 'screen'")
@ -218,7 +218,7 @@ def _generate_string_var(out: Callable, vardef: VarDef) -> None:
elif vardef.datatype == DataType.STRING_PS:
# 0-terminated pascal string in screencode encoding
out(".enc 'screen'")
out("{:s}n\v.ptext {:s}".format(vardef.name, _format_string(str(vardef.value.value), True)))
out("{:s}n\v.strp {:s}".format(vardef.name, _format_string(str(vardef.value.value), True)))
out(".enc 'none'")

View File

@ -730,12 +730,12 @@ sub byte2hex (ubyte: A) -> (X, Y, A?) {
tax
rts
hex_digits .text "0123456789abcdef" ; can probably be reused for other stuff as well
hex_digits .str "0123456789abcdef" ; can probably be reused for other stuff as well
}
}
var .text word2hex_output = "1234" ; 0-terminated, to make printing easier
var .str word2hex_output = "1234" ; 0-terminated, to make printing easier
sub word2hex (word: XY) -> (?) {
; ---- convert 16 bit word in X/Y into 4-character hexadecimal string into memory 'word2hex_output'
%asm {

View File

@ -219,7 +219,7 @@ def t_CLOBBEREDREGISTER(t):
def t_DATATYPE(t):
r"""\.byte|\.wordarray|\.float|\.array|\.word|\.text|\.stext|\.ptext|\.pstext|\.matrix"""
r"""\.byte|\.wordarray|\.float|\.array|\.word|\.strps|\.strs|\.strp|\.str|\.matrix"""
t.value = t.value[1:]
return t

View File

@ -420,10 +420,10 @@ class DatatypeNode(AstNode):
"byte": DataType.BYTE,
"word": DataType.WORD,
"float": DataType.FLOAT,
"text": DataType.STRING,
"ptext": DataType.STRING_P,
"stext": DataType.STRING_S,
"pstext": DataType.STRING_PS,
"str": DataType.STRING,
"strp": DataType.STRING_P,
"strs": DataType.STRING_S,
"strps": DataType.STRING_PS,
"matrix": DataType.MATRIX,
"array": DataType.BYTEARRAY,
"wordarray": DataType.WORDARRAY

View File

@ -139,10 +139,10 @@ IL65 supports the following data types:
| byte array | varies | ``.array`` | @todo |
| word array | varies | ``.wordarray`` | @todo |
| matrix (of bytes) | varies | ``.matrix`` | @todo |
| string (petscii) | varies | ``.text`` | ``"hello."`` (implicitly terminated by a 0-byte) |
| pascal-string (petscii) | varies | ``.ptext`` | ``"hello."`` (implicit first byte = length, no 0-byte |
| string (screencodes) | varies | ``.stext`` | ``"hello."`` (implicitly terminated by a 0-byte) |
| pascal-string (scr) | varies | ``.pstext`` | ``"hello."`` (implicit first byte = length, no 0-byte |
| string (petscii) | varies | ``.str`` | ``"hello."`` (implicitly terminated by a 0-byte) |
| pascal-string (petscii) | varies | ``.strp`` | ``"hello."`` (implicit first byte = length, no 0-byte |
| string (screencodes) | varies | ``.strs`` | ``"hello."`` (implicitly terminated by a 0-byte) |
| pascal-string (scr) | varies | ``.strps`` | ``"hello."`` (implicit first byte = length, no 0-byte |
You can use the literals ``true`` and ``false`` as 'boolean' values, they are aliases for the
@ -154,7 +154,7 @@ this encoding is done by the compiler. PETSCII is the default, if you need scree
have to use the ``s`` variants of the string type identifier.
A string with just one character in it is considered to be a BYTE instead with
that character's PETSCII value. So if you really need a string of length 1 you must declare
the variable explicitly of type ``.text``.
the variable explicitly of type ``.str``.
Floating point numbers are stored in the 5-byte 'MFLPT' format that is used on CBM machines,
but most float operations are specific to the Commodore-64 even because

View File

@ -34,7 +34,7 @@ def test_creation():
assert v.size == [2, 3]
assert isinstance(v.value, LiteralValue)
assert v.value.value == 0
dt = DatatypeNode(name="text", sourceref=sref)
dt = DatatypeNode(name="str", sourceref=sref)
v = VarDef(name="v2", vartype="var", datatype=dt, sourceref=sref)
assert v.vartype == VarType.VAR
assert v.datatype == DataType.STRING
@ -49,7 +49,7 @@ def test_set_value():
assert v.value.value == 0
v.value = LiteralValue(value=42, sourceref=sref)
assert v.value.value == 42
v = VarDef(name="v1", vartype="var", datatype=DatatypeNode(name="text", sourceref=sref), sourceref=sref)
v = VarDef(name="v1", vartype="var", datatype=DatatypeNode(name="str", sourceref=sref), sourceref=sref)
assert v.datatype == DataType.STRING
assert v.value is None
v.value = LiteralValue(value="hello", sourceref=sref)

View File

@ -12,7 +12,7 @@
const .word constw = $2355
const .byte constb = $23
const .float constf = 3.4556677
const .text constt = "derp"
const .str constt = "derp"
sub sub1 () -> (X?) = $ffdd
sub sub2 (A) -> (Y?) = $eecc

View File

@ -78,7 +78,7 @@ label4:
~ conditionals {
var bytevar = 22 + 23
var .text name = "?"*80
var .str name = "?"*80
var bytevar2 = 23
var .word wordvar = 22345

View File

@ -74,10 +74,10 @@
var .array(10 ) init_bytearrayb =true
var .array(10 ) init_bytearrayc ='@'
var .text text = "hello-null"
var .ptext ptext = 'hello-pascal'
var .stext stext = 'screencodes-null'
var .pstext pstext = "screencodes-pascal"
var .str text = "hello-null"
var .strp ptext = 'hello-pascal'
var .strs stext = 'screencodes-null'
var .strps pstext = "screencodes-pascal"
var .matrix( 2, 128 ) uninitmatrix
var .matrix(10, 20) initmatrix1 = $12
@ -107,10 +107,10 @@
const .float cfloat2 = 2.3456
const .float cfloat2b = cfloat2*3.44
const .float cfloat3 = true
const .text ctext3 = "constant-text"
const .ptext ctext4 = "constant-ptext"
const .stext ctext5 = "constant-stext"
const .pstext ctext6 = "constant-pstext"
const .str ctext3 = "constant-text"
const .strp ctext4 = "constant-ptext"
const .strs ctext5 = "constant-stext"
const .strps ctext6 = "constant-pstext"
; taking the address of various things:
var .word vmemaddr1 = &membyte1

View File

@ -11,7 +11,7 @@ start:
var .float myfloatneg1 = -555.666
var .float myfloat_large1 = 987654.1111
var .float myfloat_large2 = -123456.2222
var .text myfloatstr = "1234.998877"
var .str myfloatstr = "1234.998877"
var .float myfloatzero = 0
var .float myfloatsmall1 = 1.234
var .float myfloatsmall2 = 2.6677

View File

@ -3,7 +3,7 @@
%import c64lib
~ main {
var .text name = "????????????????????????????????????????????????????????????????????????????????" ; 80
var .str name = "????????????????????????????????????????????????????????????????????????????????" ; 80
var .word orig_irq
start:

View File

@ -86,10 +86,10 @@ start:
var .wordarray(10) init_wordarray = $1234
var .wordarray(10) init_wordarrayb = true
var .text text = "hello"+"-null"
var .ptext ptext = 'hello-pascal'
var .stext stext = 'screencodes-null'
var .pstext pstext = "screencodes-pascal"
var .str text = "hello"+"-null"
var .strp ptext = 'hello-pascal'
var .strs stext = 'screencodes-null'
var .strps pstext = "screencodes-pascal"
var .matrix( 3, 4 ) uninitmatrix
var .matrix( 3, 4 ) initmatrix1 = $12
@ -119,10 +119,10 @@ start:
const .float cfloat2 = 2.3456
const .float cfloat2b = cfloat2*3.44
const .float cfloat3 = true
const .text ctext3 = "constant-text"
const .ptext ctext4 = "constant-ptext"
const .stext ctext5 = "constant-stext"
const .pstext ctext6 = "constant-pstext"
const .str ctext3 = "constant-text"
const .strp ctext4 = "constant-ptext"
const .strs ctext5 = "constant-stext"
const .strps ctext6 = "constant-pstext"
; taking the address of various things:
var .word vmemaddr1 = &membyte1
@ -309,7 +309,7 @@ max:
const .word constw = $2355
const .byte constb = $23
const .float constf = 3.4556677
const .text constt = "derp"
const .str constt = "derp"
sub sub1 () -> (X?) = $ffdd
sub sub2 (A) -> (Y?) = $eecc
@ -440,10 +440,10 @@ bar:
var .wordarray(10) init_wordarray = $1234
var .wordarray(10) init_wordarrayb = true
var .text text = "hello"+"-null"
var .ptext ptext = 'hello-pascal'
var .stext stext = 'screencodes-null'
var .pstext pstext = "screencodes-pascal"
var .str text = "hello"+"-null"
var .strp ptext = 'hello-pascal'
var .strs stext = 'screencodes-null'
var .strps pstext = "screencodes-pascal"
var .matrix( 3, 4 ) uninitmatrix
var .matrix( 3, 4 ) initmatrix1 = $12
@ -473,10 +473,10 @@ bar:
const .float cfloat2 = 2.3456
const .float cfloat2b = cfloat2*3.44
const .float cfloat3 = true
const .text ctext3 = "constant-text"
const .ptext ctext4 = "constant-ptext"
const .stext ctext5 = "constant-stext"
const .pstext ctext6 = "constant-pstext"
const .str ctext3 = "constant-text"
const .strp ctext4 = "constant-ptext"
const .strs ctext5 = "constant-stext"
const .strps ctext6 = "constant-pstext"
; taking the address of various things:
var .word vmemaddr1 = &membyte1
@ -663,7 +663,7 @@ max:
const .word constw = $2355
const .byte constb = $23
const .float constf = 3.4556677
const .text constt = "derp"
const .str constt = "derp"
sub sub1 () -> (X?) = $ffdd
sub sub2 (A) -> (Y?) = $eecc
@ -794,10 +794,10 @@ bar:
var .wordarray(10) init_wordarray = $1234
var .wordarray(10) init_wordarrayb = true
var .text text = "hello"+"-null"
var .ptext ptext = 'hello-pascal'
var .stext stext = 'screencodes-null'
var .pstext pstext = "screencodes-pascal"
var .str text = "hello"+"-null"
var .strp ptext = 'hello-pascal'
var .strs stext = 'screencodes-null'
var .strps pstext = "screencodes-pascal"
var .matrix( 3, 4 ) uninitmatrix
var .matrix( 3, 4 ) initmatrix1 = $12
@ -827,10 +827,10 @@ bar:
const .float cfloat2 = 2.3456
const .float cfloat2b = cfloat2*3.44
const .float cfloat3 = true
const .text ctext3 = "constant-text"
const .ptext ctext4 = "constant-ptext"
const .stext ctext5 = "constant-stext"
const .pstext ctext6 = "constant-pstext"
const .str ctext3 = "constant-text"
const .strp ctext4 = "constant-ptext"
const .strs ctext5 = "constant-stext"
const .strps ctext6 = "constant-pstext"
; taking the address of various things:
var .word vmemaddr1 = &membyte1
@ -1017,7 +1017,7 @@ max:
const .word constw = $2355
const .byte constb = $23
const .float constf = 3.4556677
const .text constt = "derp"
const .str constt = "derp"
sub sub1 () -> (X?) = $ffdd
sub sub2 (A) -> (Y?) = $eecc
@ -1148,10 +1148,10 @@ bar:
var .wordarray(10) init_wordarray = $1234
var .wordarray(10) init_wordarrayb = true
var .text text = "hello"+"-null"
var .ptext ptext = 'hello-pascal'
var .stext stext = 'screencodes-null'
var .pstext pstext = "screencodes-pascal"
var .str text = "hello"+"-null"
var .strp ptext = 'hello-pascal'
var .strs stext = 'screencodes-null'
var .strps pstext = "screencodes-pascal"
var .matrix( 3, 4 ) uninitmatrix
var .matrix( 3, 4 ) initmatrix1 = $12
@ -1181,10 +1181,10 @@ bar:
const .float cfloat2 = 2.3456
const .float cfloat2b = cfloat2*3.44
const .float cfloat3 = true
const .text ctext3 = "constant-text"
const .ptext ctext4 = "constant-ptext"
const .stext ctext5 = "constant-stext"
const .pstext ctext6 = "constant-pstext"
const .str ctext3 = "constant-text"
const .strp ctext4 = "constant-ptext"
const .strs ctext5 = "constant-stext"
const .strps ctext6 = "constant-pstext"
; taking the address of various things:
var .word vmemaddr1 = &membyte1
@ -1371,7 +1371,7 @@ max:
const .word constw = $2355
const .byte constb = $23
const .float constf = 3.4556677
const .text constt = "derp"
const .str constt = "derp"
sub sub1 () -> (X?) = $ffdd
sub sub2 (A) -> (Y?) = $eecc
@ -1502,10 +1502,10 @@ bar:
var .wordarray(10) init_wordarray = $1234
var .wordarray(10) init_wordarrayb = true
var .text text = "hello"+"-null"
var .ptext ptext = 'hello-pascal'
var .stext stext = 'screencodes-null'
var .pstext pstext = "screencodes-pascal"
var .str text = "hello"+"-null"
var .strp ptext = 'hello-pascal'
var .strs stext = 'screencodes-null'
var .strps pstext = "screencodes-pascal"
var .matrix( 3, 4 ) uninitmatrix
var .matrix( 3, 4 ) initmatrix1 = $12
@ -1535,10 +1535,10 @@ bar:
const .float cfloat2 = 2.3456
const .float cfloat2b = cfloat2*3.44
const .float cfloat3 = true
const .text ctext3 = "constant-text"
const .ptext ctext4 = "constant-ptext"
const .stext ctext5 = "constant-stext"
const .pstext ctext6 = "constant-pstext"
const .str ctext3 = "constant-text"
const .strp ctext4 = "constant-ptext"
const .strs ctext5 = "constant-stext"
const .strps ctext6 = "constant-pstext"
; taking the address of various things:
var .word vmemaddr1 = &membyte1
@ -1725,7 +1725,7 @@ max:
const .word constw = $2355
const .byte constb = $23
const .float constf = 3.4556677
const .text constt = "derp"
const .str constt = "derp"
sub sub1 () -> (X?) = $ffdd
sub sub2 (A) -> (Y?) = $eecc
@ -1856,10 +1856,10 @@ bar:
var .wordarray(10) init_wordarray = $1234
var .wordarray(10) init_wordarrayb = true
var .text text = "hello"+"-null"
var .ptext ptext = 'hello-pascal'
var .stext stext = 'screencodes-null'
var .pstext pstext = "screencodes-pascal"
var .str text = "hello"+"-null"
var .strp ptext = 'hello-pascal'
var .strs stext = 'screencodes-null'
var .strps pstext = "screencodes-pascal"
var .matrix( 3, 4 ) uninitmatrix
var .matrix( 3, 4 ) initmatrix1 = $12
@ -1889,10 +1889,10 @@ bar:
const .float cfloat2 = 2.3456
const .float cfloat2b = cfloat2*3.44
const .float cfloat3 = true
const .text ctext3 = "constant-text"
const .ptext ctext4 = "constant-ptext"
const .stext ctext5 = "constant-stext"
const .pstext ctext6 = "constant-pstext"
const .str ctext3 = "constant-text"
const .strp ctext4 = "constant-ptext"
const .strs ctext5 = "constant-stext"
const .strps ctext6 = "constant-pstext"
; taking the address of various things:
var .word vmemaddr1 = &membyte1
@ -2079,7 +2079,7 @@ max:
const .word constw = $2355
const .byte constb = $23
const .float constf = 3.4556677
const .text constt = "derp"
const .str constt = "derp"
sub sub1 () -> (X?) = $ffdd
sub sub2 (A) -> (Y?) = $eecc
@ -2210,10 +2210,10 @@ bar:
var .wordarray(10) init_wordarray = $1234
var .wordarray(10) init_wordarrayb = true
var .text text = "hello"+"-null"
var .ptext ptext = 'hello-pascal'
var .stext stext = 'screencodes-null'
var .pstext pstext = "screencodes-pascal"
var .str text = "hello"+"-null"
var .strp ptext = 'hello-pascal'
var .strs stext = 'screencodes-null'
var .strps pstext = "screencodes-pascal"
var .matrix( 3, 4 ) uninitmatrix
var .matrix( 3, 4 ) initmatrix1 = $12
@ -2243,10 +2243,10 @@ bar:
const .float cfloat2 = 2.3456
const .float cfloat2b = cfloat2*3.44
const .float cfloat3 = true
const .text ctext3 = "constant-text"
const .ptext ctext4 = "constant-ptext"
const .stext ctext5 = "constant-stext"
const .pstext ctext6 = "constant-pstext"
const .str ctext3 = "constant-text"
const .strp ctext4 = "constant-ptext"
const .strs ctext5 = "constant-stext"
const .strps ctext6 = "constant-pstext"
; taking the address of various things:
var .word vmemaddr1 = &membyte1
@ -2433,7 +2433,7 @@ max:
const .word constw = $2355
const .byte constb = $23
const .float constf = 3.4556677
const .text constt = "derp"
const .str constt = "derp"
sub sub1 () -> (X?) = $ffdd
sub sub2 (A) -> (Y?) = $eecc
@ -2564,10 +2564,10 @@ bar:
var .wordarray(10) init_wordarray = $1234
var .wordarray(10) init_wordarrayb = true
var .text text = "hello"+"-null"
var .ptext ptext = 'hello-pascal'
var .stext stext = 'screencodes-null'
var .pstext pstext = "screencodes-pascal"
var .str text = "hello"+"-null"
var .strp ptext = 'hello-pascal'
var .strs stext = 'screencodes-null'
var .strps pstext = "screencodes-pascal"
var .matrix( 3, 4 ) uninitmatrix
var .matrix( 3, 4 ) initmatrix1 = $12
@ -2597,10 +2597,10 @@ bar:
const .float cfloat2 = 2.3456
const .float cfloat2b = cfloat2*3.44
const .float cfloat3 = true
const .text ctext3 = "constant-text"
const .ptext ctext4 = "constant-ptext"
const .stext ctext5 = "constant-stext"
const .pstext ctext6 = "constant-pstext"
const .str ctext3 = "constant-text"
const .strp ctext4 = "constant-ptext"
const .strs ctext5 = "constant-stext"
const .strps ctext6 = "constant-pstext"
; taking the address of various things:
var .word vmemaddr1 = &membyte1
@ -2787,7 +2787,7 @@ max:
const .word constw = $2355
const .byte constb = $23
const .float constf = 3.4556677
const .text constt = "derp"
const .str constt = "derp"
sub sub1 () -> (X?) = $ffdd
sub sub2 (A) -> (Y?) = $eecc
@ -2918,10 +2918,10 @@ bar:
var .wordarray(10) init_wordarray = $1234
var .wordarray(10) init_wordarrayb = true
var .text text = "hello"+"-null"
var .ptext ptext = 'hello-pascal'
var .stext stext = 'screencodes-null'
var .pstext pstext = "screencodes-pascal"
var .str text = "hello"+"-null"
var .strp ptext = 'hello-pascal'
var .strs stext = 'screencodes-null'
var .strps pstext = "screencodes-pascal"
var .matrix( 3, 4 ) uninitmatrix
var .matrix( 3, 4 ) initmatrix1 = $12
@ -2951,10 +2951,10 @@ bar:
const .float cfloat2 = 2.3456
const .float cfloat2b = cfloat2*3.44
const .float cfloat3 = true
const .text ctext3 = "constant-text"
const .ptext ctext4 = "constant-ptext"
const .stext ctext5 = "constant-stext"
const .pstext ctext6 = "constant-pstext"
const .str ctext3 = "constant-text"
const .strp ctext4 = "constant-ptext"
const .strs ctext5 = "constant-stext"
const .strps ctext6 = "constant-pstext"
; taking the address of various things:
var .word vmemaddr1 = &membyte1
@ -3141,7 +3141,7 @@ max:
const .word constw = $2355
const .byte constb = $23
const .float constf = 3.4556677
const .text constt = "derp"
const .str constt = "derp"
sub sub1 () -> (X?) = $ffdd
sub sub2 (A) -> (Y?) = $eecc
@ -3272,10 +3272,10 @@ bar:
var .wordarray(10) init_wordarray = $1234
var .wordarray(10) init_wordarrayb = true
var .text text = "hello"+"-null"
var .ptext ptext = 'hello-pascal'
var .stext stext = 'screencodes-null'
var .pstext pstext = "screencodes-pascal"
var .str text = "hello"+"-null"
var .strp ptext = 'hello-pascal'
var .strs stext = 'screencodes-null'
var .strps pstext = "screencodes-pascal"
var .matrix( 3, 4 ) uninitmatrix
var .matrix( 3, 4 ) initmatrix1 = $12
@ -3305,10 +3305,10 @@ bar:
const .float cfloat2 = 2.3456
const .float cfloat2b = cfloat2*3.44
const .float cfloat3 = true
const .text ctext3 = "constant-text"
const .ptext ctext4 = "constant-ptext"
const .stext ctext5 = "constant-stext"
const .pstext ctext6 = "constant-pstext"
const .str ctext3 = "constant-text"
const .strp ctext4 = "constant-ptext"
const .strs ctext5 = "constant-stext"
const .strps ctext6 = "constant-pstext"
; taking the address of various things:
var .word vmemaddr1 = &membyte1
@ -3495,7 +3495,7 @@ max:
const .word constw = $2355
const .byte constb = $23
const .float constf = 3.4556677
const .text constt = "derp"
const .str constt = "derp"
sub sub1 () -> (X?) = $ffdd
sub sub2 (A) -> (Y?) = $eecc
@ -3626,10 +3626,10 @@ bar:
var .wordarray(10) init_wordarray = $1234
var .wordarray(10) init_wordarrayb = true
var .text text = "hello"+"-null"
var .ptext ptext = 'hello-pascal'
var .stext stext = 'screencodes-null'
var .pstext pstext = "screencodes-pascal"
var .str text = "hello"+"-null"
var .strp ptext = 'hello-pascal'
var .strs stext = 'screencodes-null'
var .strps pstext = "screencodes-pascal"
var .matrix( 3, 4 ) uninitmatrix
var .matrix( 3, 4 ) initmatrix1 = $12
@ -3659,10 +3659,10 @@ bar:
const .float cfloat2 = 2.3456
const .float cfloat2b = cfloat2*3.44
const .float cfloat3 = true
const .text ctext3 = "constant-text"
const .ptext ctext4 = "constant-ptext"
const .stext ctext5 = "constant-stext"
const .pstext ctext6 = "constant-pstext"
const .str ctext3 = "constant-text"
const .strp ctext4 = "constant-ptext"
const .strs ctext5 = "constant-stext"
const .strps ctext6 = "constant-pstext"
; taking the address of various things:
var .word vmemaddr1 = &membyte1
@ -3849,7 +3849,7 @@ max:
const .word constw = $2355
const .byte constb = $23
const .float constf = 3.4556677
const .text constt = "derp"
const .str constt = "derp"
sub sub1 () -> (X?) = $ffdd
sub sub2 (A) -> (Y?) = $eecc
@ -3980,10 +3980,10 @@ bar:
var .wordarray(10) init_wordarray = $1234
var .wordarray(10) init_wordarrayb = true
var .text text = "hello"+"-null"
var .ptext ptext = 'hello-pascal'
var .stext stext = 'screencodes-null'
var .pstext pstext = "screencodes-pascal"
var .str text = "hello"+"-null"
var .strp ptext = 'hello-pascal'
var .strs stext = 'screencodes-null'
var .strps pstext = "screencodes-pascal"
var .matrix( 3, 4 ) uninitmatrix
var .matrix( 3, 4 ) initmatrix1 = $12
@ -4013,10 +4013,10 @@ bar:
const .float cfloat2 = 2.3456
const .float cfloat2b = cfloat2*3.44
const .float cfloat3 = true
const .text ctext3 = "constant-text"
const .ptext ctext4 = "constant-ptext"
const .stext ctext5 = "constant-stext"
const .pstext ctext6 = "constant-pstext"
const .str ctext3 = "constant-text"
const .strp ctext4 = "constant-ptext"
const .strs ctext5 = "constant-stext"
const .strps ctext6 = "constant-pstext"
; taking the address of various things:
var .word vmemaddr1 = &membyte1
@ -4203,7 +4203,7 @@ max:
const .word constw = $2355
const .byte constb = $23
const .float constf = 3.4556677
const .text constt = "derp"
const .str constt = "derp"
sub sub1 () -> (X?) = $ffdd
sub sub2 (A) -> (Y?) = $eecc
@ -4334,10 +4334,10 @@ bar:
var .wordarray(10) init_wordarray = $1234
var .wordarray(10) init_wordarrayb = true
var .text text = "hello"+"-null"
var .ptext ptext = 'hello-pascal'
var .stext stext = 'screencodes-null'
var .pstext pstext = "screencodes-pascal"
var .str text = "hello"+"-null"
var .strp ptext = 'hello-pascal'
var .strs stext = 'screencodes-null'
var .strps pstext = "screencodes-pascal"
var .matrix( 3, 4 ) uninitmatrix
var .matrix( 3, 4 ) initmatrix1 = $12
@ -4367,10 +4367,10 @@ bar:
const .float cfloat2 = 2.3456
const .float cfloat2b = cfloat2*3.44
const .float cfloat3 = true
const .text ctext3 = "constant-text"
const .ptext ctext4 = "constant-ptext"
const .stext ctext5 = "constant-stext"
const .pstext ctext6 = "constant-pstext"
const .str ctext3 = "constant-text"
const .strp ctext4 = "constant-ptext"
const .strs ctext5 = "constant-stext"
const .strps ctext6 = "constant-pstext"
; taking the address of various things:
var .word vmemaddr1 = &membyte1
@ -4557,7 +4557,7 @@ max:
const .word constw = $2355
const .byte constb = $23
const .float constf = 3.4556677
const .text constt = "derp"
const .str constt = "derp"
sub sub1 () -> (X?) = $ffdd
sub sub2 (A) -> (Y?) = $eecc
@ -4688,10 +4688,10 @@ bar:
var .wordarray(10) init_wordarray = $1234
var .wordarray(10) init_wordarrayb = true
var .text text = "hello"+"-null"
var .ptext ptext = 'hello-pascal'
var .stext stext = 'screencodes-null'
var .pstext pstext = "screencodes-pascal"
var .str text = "hello"+"-null"
var .strp ptext = 'hello-pascal'
var .strs stext = 'screencodes-null'
var .strps pstext = "screencodes-pascal"
var .matrix( 3, 4 ) uninitmatrix
var .matrix( 3, 4 ) initmatrix1 = $12
@ -4721,10 +4721,10 @@ bar:
const .float cfloat2 = 2.3456
const .float cfloat2b = cfloat2*3.44
const .float cfloat3 = true
const .text ctext3 = "constant-text"
const .ptext ctext4 = "constant-ptext"
const .stext ctext5 = "constant-stext"
const .pstext ctext6 = "constant-pstext"
const .str ctext3 = "constant-text"
const .strp ctext4 = "constant-ptext"
const .strs ctext5 = "constant-stext"
const .strps ctext6 = "constant-pstext"
; taking the address of various things:
var .word vmemaddr1 = &membyte1
@ -4911,7 +4911,7 @@ max:
const .word constw = $2355
const .byte constb = $23
const .float constf = 3.4556677
const .text constt = "derp"
const .str constt = "derp"
sub sub1 () -> (X?) = $ffdd
sub sub2 (A) -> (Y?) = $eecc
@ -5042,10 +5042,10 @@ bar:
var .wordarray(10) init_wordarray = $1234
var .wordarray(10) init_wordarrayb = true
var .text text = "hello"+"-null"
var .ptext ptext = 'hello-pascal'
var .stext stext = 'screencodes-null'
var .pstext pstext = "screencodes-pascal"
var .str text = "hello"+"-null"
var .strp ptext = 'hello-pascal'
var .strs stext = 'screencodes-null'
var .strps pstext = "screencodes-pascal"
var .matrix( 3, 4 ) uninitmatrix
var .matrix( 3, 4 ) initmatrix1 = $12
@ -5075,10 +5075,10 @@ bar:
const .float cfloat2 = 2.3456
const .float cfloat2b = cfloat2*3.44
const .float cfloat3 = true
const .text ctext3 = "constant-text"
const .ptext ctext4 = "constant-ptext"
const .stext ctext5 = "constant-stext"
const .pstext ctext6 = "constant-pstext"
const .str ctext3 = "constant-text"
const .strp ctext4 = "constant-ptext"
const .strs ctext5 = "constant-stext"
const .strps ctext6 = "constant-pstext"
; taking the address of various things:
var .word vmemaddr1 = &membyte1
@ -5265,7 +5265,7 @@ max:
const .word constw = $2355
const .byte constb = $23
const .float constf = 3.4556677
const .text constt = "derp"
const .str constt = "derp"
sub sub1 () -> (X?) = $ffdd
sub sub2 (A) -> (Y?) = $eecc
@ -5396,10 +5396,10 @@ bar:
var .wordarray(10) init_wordarray = $1234
var .wordarray(10) init_wordarrayb = true
var .text text = "hello"+"-null"
var .ptext ptext = 'hello-pascal'
var .stext stext = 'screencodes-null'
var .pstext pstext = "screencodes-pascal"
var .str text = "hello"+"-null"
var .strp ptext = 'hello-pascal'
var .strs stext = 'screencodes-null'
var .strps pstext = "screencodes-pascal"
var .matrix( 3, 4 ) uninitmatrix
var .matrix( 3, 4 ) initmatrix1 = $12
@ -5429,10 +5429,10 @@ bar:
const .float cfloat2 = 2.3456
const .float cfloat2b = cfloat2*3.44
const .float cfloat3 = true
const .text ctext3 = "constant-text"
const .ptext ctext4 = "constant-ptext"
const .stext ctext5 = "constant-stext"
const .pstext ctext6 = "constant-pstext"
const .str ctext3 = "constant-text"
const .strp ctext4 = "constant-ptext"
const .strs ctext5 = "constant-stext"
const .strps ctext6 = "constant-pstext"
; taking the address of various things:
var .word vmemaddr1 = &membyte1
@ -5619,7 +5619,7 @@ max:
const .word constw = $2355
const .byte constb = $23
const .float constf = 3.4556677
const .text constt = "derp"
const .str constt = "derp"
sub sub1 () -> (X?) = $ffdd
sub sub2 (A) -> (Y?) = $eecc
@ -5750,10 +5750,10 @@ bar:
var .wordarray(10) init_wordarray = $1234
var .wordarray(10) init_wordarrayb = true
var .text text = "hello"+"-null"
var .ptext ptext = 'hello-pascal'
var .stext stext = 'screencodes-null'
var .pstext pstext = "screencodes-pascal"
var .str text = "hello"+"-null"
var .strp ptext = 'hello-pascal'
var .strs stext = 'screencodes-null'
var .strps pstext = "screencodes-pascal"
var .matrix( 3, 4 ) uninitmatrix
var .matrix( 3, 4 ) initmatrix1 = $12
@ -5783,10 +5783,10 @@ bar:
const .float cfloat2 = 2.3456
const .float cfloat2b = cfloat2*3.44
const .float cfloat3 = true
const .text ctext3 = "constant-text"
const .ptext ctext4 = "constant-ptext"
const .stext ctext5 = "constant-stext"
const .pstext ctext6 = "constant-pstext"
const .str ctext3 = "constant-text"
const .strp ctext4 = "constant-ptext"
const .strs ctext5 = "constant-stext"
const .strps ctext6 = "constant-pstext"
; taking the address of various things:
var .word vmemaddr1 = &membyte1
@ -5973,7 +5973,7 @@ max:
const .word constw = $2355
const .byte constb = $23
const .float constf = 3.4556677
const .text constt = "derp"
const .str constt = "derp"
sub sub1 () -> (X?) = $ffdd
sub sub2 (A) -> (Y?) = $eecc
@ -6104,10 +6104,10 @@ bar:
var .wordarray(10) init_wordarray = $1234
var .wordarray(10) init_wordarrayb = true
var .text text = "hello"+"-null"
var .ptext ptext = 'hello-pascal'
var .stext stext = 'screencodes-null'
var .pstext pstext = "screencodes-pascal"
var .str text = "hello"+"-null"
var .strp ptext = 'hello-pascal'
var .strs stext = 'screencodes-null'
var .strps pstext = "screencodes-pascal"
var .matrix( 3, 4 ) uninitmatrix
var .matrix( 3, 4 ) initmatrix1 = $12
@ -6137,10 +6137,10 @@ bar:
const .float cfloat2 = 2.3456
const .float cfloat2b = cfloat2*3.44
const .float cfloat3 = true
const .text ctext3 = "constant-text"
const .ptext ctext4 = "constant-ptext"
const .stext ctext5 = "constant-stext"
const .pstext ctext6 = "constant-pstext"
const .str ctext3 = "constant-text"
const .strp ctext4 = "constant-ptext"
const .strs ctext5 = "constant-stext"
const .strps ctext6 = "constant-pstext"
; taking the address of various things:
var .word vmemaddr1 = &membyte1
@ -6327,7 +6327,7 @@ max:
const .word constw = $2355
const .byte constb = $23
const .float constf = 3.4556677
const .text constt = "derp"
const .str constt = "derp"
sub sub1 () -> (X?) = $ffdd
sub sub2 (A) -> (Y?) = $eecc
@ -6458,10 +6458,10 @@ bar:
var .wordarray(10) init_wordarray = $1234
var .wordarray(10) init_wordarrayb = true
var .text text = "hello"+"-null"
var .ptext ptext = 'hello-pascal'
var .stext stext = 'screencodes-null'
var .pstext pstext = "screencodes-pascal"
var .str text = "hello"+"-null"
var .strp ptext = 'hello-pascal'
var .strs stext = 'screencodes-null'
var .strps pstext = "screencodes-pascal"
var .matrix( 3, 4 ) uninitmatrix
var .matrix( 3, 4 ) initmatrix1 = $12
@ -6491,10 +6491,10 @@ bar:
const .float cfloat2 = 2.3456
const .float cfloat2b = cfloat2*3.44
const .float cfloat3 = true
const .text ctext3 = "constant-text"
const .ptext ctext4 = "constant-ptext"
const .stext ctext5 = "constant-stext"
const .pstext ctext6 = "constant-pstext"
const .str ctext3 = "constant-text"
const .strp ctext4 = "constant-ptext"
const .strs ctext5 = "constant-stext"
const .strps ctext6 = "constant-pstext"
; taking the address of various things:
var .word vmemaddr1 = &membyte1
@ -6681,7 +6681,7 @@ max:
const .word constw = $2355
const .byte constb = $23
const .float constf = 3.4556677
const .text constt = "derp"
const .str constt = "derp"
sub sub1 () -> (X?) = $ffdd
sub sub2 (A) -> (Y?) = $eecc
@ -6812,10 +6812,10 @@ bar:
var .wordarray(10) init_wordarray = $1234
var .wordarray(10) init_wordarrayb = true
var .text text = "hello"+"-null"
var .ptext ptext = 'hello-pascal'
var .stext stext = 'screencodes-null'
var .pstext pstext = "screencodes-pascal"
var .str text = "hello"+"-null"
var .strp ptext = 'hello-pascal'
var .strs stext = 'screencodes-null'
var .strps pstext = "screencodes-pascal"
var .matrix( 3, 4 ) uninitmatrix
var .matrix( 3, 4 ) initmatrix1 = $12
@ -6845,10 +6845,10 @@ bar:
const .float cfloat2 = 2.3456
const .float cfloat2b = cfloat2*3.44
const .float cfloat3 = true
const .text ctext3 = "constant-text"
const .ptext ctext4 = "constant-ptext"
const .stext ctext5 = "constant-stext"
const .pstext ctext6 = "constant-pstext"
const .str ctext3 = "constant-text"
const .strp ctext4 = "constant-ptext"
const .strs ctext5 = "constant-stext"
const .strps ctext6 = "constant-pstext"
; taking the address of various things:
var .word vmemaddr1 = &membyte1
@ -7035,7 +7035,7 @@ max:
const .word constw = $2355
const .byte constb = $23
const .float constf = 3.4556677
const .text constt = "derp"
const .str constt = "derp"
sub sub1 () -> (X?) = $ffdd
sub sub2 (A) -> (Y?) = $eecc

View File

@ -3,8 +3,8 @@
%import mathlib
~ main {
var .text name = '?' * 80
var .text guess = '?' * 80
var .str name = '?' * 80
var .str guess = '?' * 80
var secretnumber
var attempts_left = 10

View File

@ -11,18 +11,18 @@
memory .word screenw = $0500
; ascii to petscii, 0 terminated
var .text hello = "hello everyone out there."
var .str hello = "hello everyone out there."
; ascii to petscii, with length as first byte
var .ptext hellopascalstr = "Hello!\0x00\x01\x02d ag\0x01."
var .strp hellopascalstr = "Hello!\0x00\x01\x02d ag\0x01."
; ascii to screen codes, 0 terminated
var .stext hello_screen = "Hello!\n guys123."
var .strs hello_screen = "Hello!\n guys123."
; ascii to screen codes, length as first byte
var .pstext hellopascal_screen = "Hello! \n."
var .strps hellopascal_screen = "Hello! \n."
var .text hello2 = "@@\f\b\n\r\t@@"
var .str hello2 = "@@\f\b\n\r\t@@"
start:
global2.make_screen_black()

View File

@ -4,14 +4,14 @@
~ main
{
var .text greeting = "hello world!\r12345678 is a big number.\r"
var .ptext p_greeting = "hello world!\r12345678 is a big number.\r"
var .str greeting = "hello world!\r12345678 is a big number.\r"
var .strp p_greeting = "hello world!\r12345678 is a big number.\r"
const .word BORDER = $d020
start:
c64scr.print_pimmediate() ; this prints the pstring immediately following it
%asm {
.ptext "hello-pimmediate!{cr}"
.strp "hello-pimmediate!{cr}"
}
c64scr.print_byte_decimal0 (19)