-
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix chained assignment and multi-vardecl RHS evaluation
- Loading branch information
Showing
6 changed files
with
65 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,24 @@ | ||
%import textio | ||
%import string | ||
%import math | ||
%zeropage basicsafe | ||
|
||
main { | ||
sub start() { | ||
cx16.set_chrin_keyhandler(0, &keystroke_handler) | ||
cbm.CHRIN() | ||
} | ||
ubyte x,y,z = math.rnd() | ||
|
||
sub keystroke_handler() -> ubyte { | ||
%asm {{ | ||
sta cx16.r0L | ||
}} | ||
uword cmdxx = grab_cmdline() | ||
if_cs { | ||
; first entry, decide if we want to override | ||
if cx16.r0L==9 { | ||
; intercept TAB | ||
sys.clear_carry() | ||
return 0 | ||
} | ||
sys.set_carry() | ||
return 0 | ||
} else { | ||
if cx16.r0L==9 { | ||
%asm {{ | ||
brk ; BOOM | ||
}} | ||
uword cmd = grab_cmdline() | ||
if cmd and cmd[0] { | ||
;cx16.r5++ | ||
} | ||
return '!' | ||
} | ||
return 0 ; eat all other characters | ||
} | ||
txt.print_ub(x) | ||
txt.nl() | ||
txt.print_ub(y) | ||
txt.nl() | ||
txt.print_ub(z) | ||
txt.nl() | ||
|
||
sub grab_cmdline() -> uword { | ||
cx16.r9++ | ||
return $5000 | ||
} | ||
x=y=z=math.rnd() | ||
txt.print_ub(x) | ||
txt.nl() | ||
txt.print_ub(y) | ||
txt.nl() | ||
txt.print_ub(z) | ||
txt.nl() | ||
} | ||
} |