This commit is contained in:
Dominic Grimm 2023-04-02 14:32:11 +02:00
parent 00bab636db
commit 3da2567890
No known key found for this signature in database
GPG key ID: 12EFFCAEA9E620BF
3 changed files with 75 additions and 67 deletions

View file

@ -15,23 +15,36 @@
.org prev
.delete prev, diff
.define_eval prev, OFFSET
{%- for c in conditions %}
.bytes NULL
{% if !c.data.1.is_empty() %}.bytes NULL{% endif %}
{% endfor %}
.define_eval INDEX_CONDITIONS_SIZE, (OFFSET - prev)
.org prev
.delete prev
; .define_eval prev, OFFSET
; {%- for c in conditions %}
; .bytes CORE_U16_MAX{% if !c.data.1.is_empty() %}, CORE_U16_MAX{% endif %}
; {%- endfor %}
; .define_eval JUMP_TABLE_CONDITIONS_SIZE, (OFFSET - prev)
; .org prev
; .delete prev
.debug INDEX_CONDITIONS_SIZE
; .define_eval JUMP_TABLE_WORDS_SIZE, ({{ words.len() }} * 2)
; index
{%- for c in conditions %}
index_conditions_if_{{ c.id }}:
{% endfor %}
; .define_eval MEM_JUMP_TABLE_LEN, (JUMP_TABLE_CONDITIONS_SIZE + JUMP_TABLE_WORDS_SIZE / 2)
; .define_eval MEM_JUMP_TABLE_PTR, CORE_MEM_MEM
; .define_eval MEM_JUMP_TABLE_END, (MEM_JUMP_TABLE_PTR + MEM_JUMP_TABLE_LEN)
.define_eval MEM_LOOP_DEPTH, CORE_MEM_MEM
; .debug MEM_JUMP_TABLE_LEN, MEM_JUMP_TABLE_PTR, MEM_JUMP_TABLE_END
; ; jump table
; ; conditions
; {%- for c in conditions %}
; jump_table_conditions_if_{{ c.id }}: .bytes 444
; {%- if !c.data.1.is_empty() %}
; jump_table_conditions_else_{{ c.id }}: .bytes 5498
; {%- endif %}
; {%- endfor %}
.define_eval MEM_JUMP_TABLE_LEN, 9
.define_eval MEM_JUMP_TABLE_PTR, CORE_MEM_MEM
.define_eval MEM_JUMP_TABLE_END, (MEM_JUMP_TABLE_PTR + MEM_JUMP_TABLE_LEN)
.define_eval MEM_LOOP_DEPTH, (MEM_JUMP_TABLE_END + 1)
.define_eval MEM_LOOP_I, (MEM_LOOP_DEPTH + 1)
.define_eval MEM_LOOP_J, (MEM_LOOP_I + 1)
@ -48,9 +61,14 @@
tlr CORE_REG_A
.endmacro
; setup jump table
; reference MEM_CALL_STACK_PTR to itself
.std_rset CORE_REG_A, MEM_CALL_STACK_PTR
.std_set MEM_CALL_STACK_PTR
; reference MEM_ALLOC_PTR to itself
.std_rset CORE_REG_A, MEM_ALLOC_PTR
.std_set MEM_ALLOC_PTR