Assembler in GNU as syntax, objdump-style disassembly, UCASE$ and LCASE$
The monitor's assembler takes GNU as directives (.org, .equ, .byte, .half, .word, .ascii, .string, .space, .align, .balign ...), # comments, 0x/0b numbers, '\n' constants, . for the current address, << >> ^ ~, %hi/%lo and the FP CSR short forms; the old ORG/DB/EQU/0FFH forms remain as aliases. The disassembler prints lower case and 0x hex as objdump does. The monitor is built with -msave-restore and puts .rodata first, to fit its ROM. BASIC gains UCASE$ and LCASE$. Manual, README and tests updated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
25c8286cf2
commit
fa4752fd7a
16 files changed
+7921
-7615
No files matched your search
+18
-1
@@ -18,9 +18,11 @@ def main():
|
||||
b = te.Basic()
|
||||
errors = 0
|
||||
|
||||
def check(what, ok):
|
||||
def check(what, ok, out=""):
|
||||
nonlocal errors
|
||||
print(("PASS " if ok else "FAIL ") + what)
|
||||
if not ok and out:
|
||||
print(out)
|
||||
errors += not ok
|
||||
|
||||
def run(prog):
|
||||
@@ -64,6 +66,21 @@ def main():
|
||||
b.type(b"A, B" + CR)
|
||||
check("LINE INPUT into an element", "<A, B>" in "\n".join(l.rstrip() for l in b.screen_text().display))
|
||||
|
||||
out = run('''
|
||||
10 A$ = "Hello, World! 123"
|
||||
20 PRINT UCASE$(A$); "|"; LCASE$(A$); "|"; LCASE$(UCASE$("mIxEd"))
|
||||
30 B$ = CHR$(64) + CHR$(91) + CHR$(96) + CHR$(123) + CHR$(224)
|
||||
40 PRINT (UCASE$(B$) = B$); (LCASE$(B$) = B$); LEN(UCASE$("")); ASC(LCASE$("Z"))
|
||||
50 DIM N$(1): N$(1) = "abc": PRINT UCASE$(N$(1) + "d")
|
||||
''')
|
||||
check("UCASE$ and LCASE$", "HELLO, WORLD! 123|hello, world! 123|mixed" in out, out)
|
||||
check("only A-Z and a-z change", "-1 -1 0 122" in out, out)
|
||||
check("UCASE$ of an expression", "ABCD" in out, out)
|
||||
b.type(b"LIST 20" + CR)
|
||||
check("LIST spells UCASE$ and LCASE$",
|
||||
'20 PRINT UCASE$(A$); "|"; LCASE$(A$); "|"; LCASE$(UCASE$("mIxEd"))' in
|
||||
"\n".join(l.rstrip() for l in b.screen_text().display))
|
||||
|
||||
out = run('10 DIM Q$(2): Q$(3) = "X"')
|
||||
check("subscript out of range", "SUBSCRIPT" in out.upper())
|
||||
out = run('10 DIM Z$(300)')
|
||||
|
||||
Reference in new issue
Block a user