Add binary operator '_' for left shift

If the command line option yus to allow the underscore character in
symbols is NOT selected, then interpret underscore as a new binary
operator meaning to do a left shift of the left side value by the
number of bit positions indicated by the right side value.  As for the
arithmetic operators, both values must be literal (numeric constants
or symbols equated to a numeric constant).
This commit is contained in:
Stephen Casner
2021-02-13 15:25:08 -08:00
committed by Rhialto The M
parent e452ac437c
commit dcdbc02b2e
6 changed files with 148 additions and 90 deletions

View File

@@ -20,6 +20,11 @@
.word 12. / 4 ; 000003
.word 123 & 771 ; 000121
.word 123121 ! 322 ; 123323
five = 5
a: .word 123 _ 3 ; 001230
.word five _ 6 ; 000500
.word 101_five ; 004040
.word a _ 3 ; Invalid expression
.word - 377 ; 177401
.word + 377 ; 000377