small operator handling tweak

This commit is contained in:
FeralChild64 committed 2020-06-07 15:04:31 +02:00
1 parent 831bc8f453
commit 8aa3aed586
3 files changed
+28 -29

No files matched your search

+3 -3
View File
@@ -206,14 +206,14 @@ FRMEVL_push_operator_address:
// XXX add support for other operators, use .Y // XXX add support for other operators, use .Y
lda operator_jumptable_hi - 1, y lda operator_jumptable_hi, y
pha pha
lda operator_jumptable_lo - 1, y lda operator_jumptable_lo, y
pha pha
// Push operator priority // Push operator priority
lda operator_priorities - 1, y lda operator_priorities, y
pha pha
// Continue // Continue
+10 -11
View File
@@ -18,19 +18,18 @@ fetch_operator: // XXX change the operator code to start from 0
// Check if within range // Check if within range
sec sec
sbc #$A9 sbc #$AA
bcc fetch_operator_failed // branch if below 0 bcc fetch_operator_failed // branch if below 0
beq fetch_operator_failed // branch 0
cmp #$0B cmp #$0A
bcs fetch_operator_failed // branch if $0B or greater bcs fetch_operator_failed // branch if $0A or greater
// Now we have to recognize '>=', '<=' and '<>' operators // Now we have to recognize '>=', '<=' and '<>' operators
cmp #$08 cmp #$07
beq fetch_operator_try_gteq beq fetch_operator_try_gteq
cmp #$0A cmp #$09
beq fetch_operator_try_lteq_neq beq fetch_operator_try_lteq_neq
// FALLTROUGH // FALLTROUGH
@@ -57,12 +56,12 @@ fetch_operator_try_gteq:
// This is a '>' // This is a '>'
jsr unconsume_character jsr unconsume_character
lda #$08 lda #$07
bne fetch_operator_success // branch always bne fetch_operator_success // branch always
!: !:
// This is a '>=' // This is a '>='
lda #$0B lda #$0A
bne fetch_operator_success // branch always bne fetch_operator_success // branch always
@@ -79,15 +78,15 @@ fetch_operator_try_lteq_neq:
// This is a '<' // This is a '<'
jsr unconsume_character jsr unconsume_character
lda #$0A lda #$09
bne fetch_operator_success // branch always bne fetch_operator_success // branch always
!: !:
// This is a '<=' // This is a '<='
lda #$0C lda #$0B
bne fetch_operator_success // branch always bne fetch_operator_success // branch always
!: !:
// This is a '<>' // This is a '<>'
lda #$0D lda #$0C
bne fetch_operator_success // branch always bne fetch_operator_success // branch always
+15 -15
View File
@@ -11,30 +11,30 @@
// Tokens $AA-$B0 // Tokens $AA-$B0
oper_add, // ID: $01 oper_add, // ID: $00
oper_sub, // ID: $02 oper_sub, // ID: $01
oper_mul, // ID: $03 oper_mul, // ID: $02
oper_div, // ID: $04 oper_div, // ID: $03
oper_pow, // ID: $05 oper_pow, // ID: $04
oper_and, // ID: $06 oper_and, // ID: $05
oper_or, // ID: $07 oper_or, // ID: $06
// Tokens $B1-$B3 // Tokens $B1-$B3
oper_cmp_gt, // ID: $08 oper_cmp_gt, // ID: $07
oper_cmp_eq, // ID: $09 oper_cmp_eq, // ID: $08
oper_cmp_lt, // ID: $0A oper_cmp_lt, // ID: $09
// Combined two tokens // Combined two tokens
oper_cmp_gteq, // ID: $0B oper_cmp_gteq, // ID: $0A
oper_cmp_lteq, // ID: $0C oper_cmp_lteq, // ID: $0B
oper_cmp_neq, // ID: $0D oper_cmp_neq, // ID: $0C
// Unary operators // Unary operators
oper_unary_minus, // ID: $0E oper_unary_minus, // ID: $0D
oper_unary_not // ID: $0F oper_unary_not // ID: $0E
) )