more sane directory name, updated binaries
This commit is contained in:
1 parent
d4d32095d1
commit
76aaf298b8
697 files changed
+56
-56
No files matched your search
@@ -0,0 +1,68 @@
|
||||
// #LAYOUT# STD * #TAKE
|
||||
// #LAYOUT# * BASIC_0 #TAKE
|
||||
// #LAYOUT# * * #IGNORE
|
||||
|
||||
//
|
||||
// Jumptable and priority list for all BASIC operators
|
||||
//
|
||||
|
||||
|
||||
.const operator_list = List().add(
|
||||
|
||||
// Tokens $AA-$B0
|
||||
|
||||
oper_add, // ID: $00
|
||||
oper_sub, // ID: $01
|
||||
oper_mul, // ID: $02
|
||||
oper_div, // ID: $03
|
||||
oper_pow, // ID: $04
|
||||
oper_and, // ID: $05
|
||||
oper_or, // ID: $06
|
||||
|
||||
// Tokens $B1-$B3
|
||||
|
||||
oper_cmp_gt, // ID: $07
|
||||
oper_cmp_eq, // ID: $08
|
||||
oper_cmp_lt, // ID: $09
|
||||
|
||||
// Combined two tokens
|
||||
|
||||
oper_cmp_gteq, // ID: $0A
|
||||
oper_cmp_lteq, // ID: $0B
|
||||
oper_cmp_neq, // ID: $0C
|
||||
|
||||
// Unary operators
|
||||
|
||||
oper_unary_minus, // ID: $0D
|
||||
oper_unary_not // ID: $0E
|
||||
)
|
||||
|
||||
|
||||
operator_priorities: // higher number = higher priority
|
||||
|
||||
.byte $05 // oper_add
|
||||
.byte $05 // oper_sub
|
||||
.byte $06 // oper_mul
|
||||
.byte $06 // oper_div
|
||||
.byte $08 // oper_pow
|
||||
.byte $02 // oper_and
|
||||
.byte $01 // oper_or
|
||||
.byte $04 // oper_cmp_gt
|
||||
.byte $04 // oper_cmp_eq
|
||||
.byte $04 // oper_cmp_lt
|
||||
.byte $04 // oper_cmp_gteq
|
||||
.byte $04 // oper_cmp_lteq
|
||||
.byte $04 // oper_cmp_neq
|
||||
.byte $07 // oper_unary_minus
|
||||
.byte $03 // oper_unary_not
|
||||
|
||||
|
||||
|
||||
operator_jumptable_lo:
|
||||
|
||||
put_jumptable_lo(operator_list)
|
||||
|
||||
|
||||
operator_jumptable_hi:
|
||||
|
||||
put_jumptable_hi(operator_list)
|
||||
@@ -0,0 +1,72 @@
|
||||
// #LAYOUT# STD * #TAKE
|
||||
// #LAYOUT# * BASIC_0 #TAKE
|
||||
// #LAYOUT# * * #IGNORE
|
||||
|
||||
|
||||
oper_add:
|
||||
|
||||
// This operator can be used either with two strings, or with two floats
|
||||
// First check whether arguments match and then choose the variant
|
||||
|
||||
pla
|
||||
cmp VALTYP
|
||||
bne_16 do_TYPE_MISMATCH_error
|
||||
|
||||
lda VALTYP
|
||||
bmi oper_add_strings
|
||||
|
||||
// FALLTROUGH
|
||||
|
||||
oper_add_floats:
|
||||
|
||||
// XXX implement this
|
||||
|
||||
jmp do_NOT_IMPLEMENTED_error
|
||||
|
||||
oper_add_strings:
|
||||
|
||||
// Retrieve string address
|
||||
|
||||
pla
|
||||
sta __FAC2+2
|
||||
pla
|
||||
sta __FAC2+1
|
||||
|
||||
// Pull string length
|
||||
|
||||
pla
|
||||
sta __FAC2+0
|
||||
beq oper_add_strings_end // if string 2 is empty, we have nothing to do
|
||||
|
||||
// If string 1 is empty, just copy the metadata
|
||||
|
||||
lda __FAC1+0
|
||||
bne !+
|
||||
|
||||
lda __FAC2+0
|
||||
sta __FAC1+0
|
||||
lda __FAC2+1
|
||||
sta __FAC1+1
|
||||
lda __FAC2+2
|
||||
sta __FAC1+2
|
||||
|
||||
jmp FRMEVL_continue
|
||||
!:
|
||||
// Allocate memory for concatenated string
|
||||
|
||||
clc
|
||||
adc __FAC2+0
|
||||
bcs_16 do_STRING_TOO_LONG_error
|
||||
|
||||
jsr alloc_temp_string
|
||||
|
||||
.break
|
||||
|
||||
|
||||
|
||||
// XXX finish the implementation
|
||||
|
||||
|
||||
oper_add_strings_end:
|
||||
|
||||
jmp FRMEVL_continue
|
||||
@@ -0,0 +1,10 @@
|
||||
// #LAYOUT# STD * #TAKE
|
||||
// #LAYOUT# * BASIC_0 #TAKE
|
||||
// #LAYOUT# * * #IGNORE
|
||||
|
||||
|
||||
oper_and:
|
||||
|
||||
// XXX provide implementation
|
||||
|
||||
jmp do_NOT_IMPLEMENTED_error
|
||||
@@ -0,0 +1,10 @@
|
||||
// #LAYOUT# STD * #TAKE
|
||||
// #LAYOUT# * BASIC_0 #TAKE
|
||||
// #LAYOUT# * * #IGNORE
|
||||
|
||||
|
||||
oper_cmp_eq:
|
||||
|
||||
// XXX provide implementation
|
||||
|
||||
jmp do_NOT_IMPLEMENTED_error
|
||||
@@ -0,0 +1,10 @@
|
||||
// #LAYOUT# STD * #TAKE
|
||||
// #LAYOUT# * BASIC_0 #TAKE
|
||||
// #LAYOUT# * * #IGNORE
|
||||
|
||||
|
||||
oper_cmp_gt:
|
||||
|
||||
// XXX provide implementation
|
||||
|
||||
jmp do_NOT_IMPLEMENTED_error
|
||||
@@ -0,0 +1,10 @@
|
||||
// #LAYOUT# STD * #TAKE
|
||||
// #LAYOUT# * BASIC_0 #TAKE
|
||||
// #LAYOUT# * * #IGNORE
|
||||
|
||||
|
||||
oper_cmp_gteq:
|
||||
|
||||
// XXX provide implementation
|
||||
|
||||
jmp do_NOT_IMPLEMENTED_error
|
||||
@@ -0,0 +1,10 @@
|
||||
// #LAYOUT# STD * #TAKE
|
||||
// #LAYOUT# * BASIC_0 #TAKE
|
||||
// #LAYOUT# * * #IGNORE
|
||||
|
||||
|
||||
oper_cmp_lt:
|
||||
|
||||
// XXX provide implementation
|
||||
|
||||
jmp do_NOT_IMPLEMENTED_error
|
||||
@@ -0,0 +1,10 @@
|
||||
// #LAYOUT# STD * #TAKE
|
||||
// #LAYOUT# * BASIC_0 #TAKE
|
||||
// #LAYOUT# * * #IGNORE
|
||||
|
||||
|
||||
oper_cmp_lteq:
|
||||
|
||||
// XXX provide implementation
|
||||
|
||||
jmp do_NOT_IMPLEMENTED_error
|
||||
@@ -0,0 +1,10 @@
|
||||
// #LAYOUT# STD * #TAKE
|
||||
// #LAYOUT# * BASIC_0 #TAKE
|
||||
// #LAYOUT# * * #IGNORE
|
||||
|
||||
|
||||
oper_cmp_neq:
|
||||
|
||||
// XXX provide implementation
|
||||
|
||||
jmp do_NOT_IMPLEMENTED_error
|
||||
@@ -0,0 +1,10 @@
|
||||
// #LAYOUT# STD * #TAKE
|
||||
// #LAYOUT# * BASIC_0 #TAKE
|
||||
// #LAYOUT# * * #IGNORE
|
||||
|
||||
|
||||
oper_div:
|
||||
|
||||
// XXX provide implementation
|
||||
|
||||
jmp do_NOT_IMPLEMENTED_error
|
||||
@@ -0,0 +1,10 @@
|
||||
// #LAYOUT# STD * #TAKE
|
||||
// #LAYOUT# * BASIC_0 #TAKE
|
||||
// #LAYOUT# * * #IGNORE
|
||||
|
||||
|
||||
oper_mul:
|
||||
|
||||
// XXX provide implementation
|
||||
|
||||
jmp do_NOT_IMPLEMENTED_error
|
||||
@@ -0,0 +1,10 @@
|
||||
// #LAYOUT# STD * #TAKE
|
||||
// #LAYOUT# * BASIC_0 #TAKE
|
||||
// #LAYOUT# * * #IGNORE
|
||||
|
||||
|
||||
oper_or:
|
||||
|
||||
// XXX provide implementation
|
||||
|
||||
jmp do_NOT_IMPLEMENTED_error
|
||||
@@ -0,0 +1,10 @@
|
||||
// #LAYOUT# STD * #TAKE
|
||||
// #LAYOUT# * BASIC_0 #TAKE
|
||||
// #LAYOUT# * * #IGNORE
|
||||
|
||||
|
||||
oper_pow:
|
||||
|
||||
// XXX provide implementation
|
||||
|
||||
jmp do_NOT_IMPLEMENTED_error
|
||||
@@ -0,0 +1,10 @@
|
||||
// #LAYOUT# STD * #TAKE
|
||||
// #LAYOUT# * BASIC_0 #TAKE
|
||||
// #LAYOUT# * * #IGNORE
|
||||
|
||||
|
||||
oper_sub:
|
||||
|
||||
// XXX provide implementation
|
||||
|
||||
jmp do_NOT_IMPLEMENTED_error
|
||||
@@ -0,0 +1,10 @@
|
||||
// #LAYOUT# STD * #TAKE
|
||||
// #LAYOUT# * BASIC_0 #TAKE
|
||||
// #LAYOUT# * * #IGNORE
|
||||
|
||||
|
||||
oper_unary_minus:
|
||||
|
||||
// XXX provide implementation
|
||||
|
||||
jmp do_NOT_IMPLEMENTED_error
|
||||
@@ -0,0 +1,10 @@
|
||||
// #LAYOUT# STD * #TAKE
|
||||
// #LAYOUT# * BASIC_0 #TAKE
|
||||
// #LAYOUT# * * #IGNORE
|
||||
|
||||
|
||||
oper_unary_not:
|
||||
|
||||
// XXX provide implementation
|
||||
|
||||
jmp do_NOT_IMPLEMENTED_error
|
||||
Reference in new issue
Block a user