From 95c4c83e611c73f3512b40ff633c4cc23d2cf9c5 Mon Sep 17 00:00:00 2001 From: Daniel Serpell Date: Sun, 25 Feb 2018 00:54:26 -0300 Subject: [PATCH] Optimize EMIT_N parser instruction. --- src/parse.asm | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/src/parse.asm b/src/parse.asm index cc763ef..5bf289f 100644 --- a/src/parse.asm +++ b/src/parse.asm @@ -264,17 +264,14 @@ ploop_nofetch: .assert SM_RET = 1, error, "SM_RET must be 1" beq pexit_ok dex - .assert SM_ERET = 2, error, "SM_ERET must be 1" + .assert SM_ERET = 2, error, "SM_ERET must be 2" beq pemit_ret -pemit_n: - clc - adc #($100 - SM_EMIT_1) - tax + .assert SM_EMIT_1 = 3, error, "SM_EMIT_1 must be 3" : jsr emit_sub dex - bpl :- - bmi ploop + bne :- + beq ploop ; Character match match_char: @@ -381,14 +378,12 @@ skip_nextline: .assert SM_RET = 1, error, "SM_RET must be 1" beq go_ploop dex - .assert SM_ERET = 2, error, "SM_ERET must be 1" + .assert SM_ERET = 2, error, "SM_ERET must be 2" beq skip_ret - clc - adc #($100 - SM_EMIT_1) - tax + .assert SM_EMIT_1 = 3, error, "SM_EMIT_1 must be 3" : jsr parser_fetch ; Skip token dex - bpl :- + bne :- jmp skip_nextline skip_ret: jsr parser_fetch ; Skip token and RET