From 875dff40ad71847d59c272491e516e4b1f01058c Mon Sep 17 00:00:00 2001 From: mrb0nk500 Date: Sat, 8 May 2021 13:16:32 -0400 Subject: Get the pointer from the control code handler table using SIB, rather than with lsl. This doesn't increase, or decrease the code size, but does make it both more compact, and easier to read. --- programs/sub-suite/subeditor.s | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/programs/sub-suite/subeditor.s b/programs/sub-suite/subeditor.s index aa9482a..800d565 100644 --- a/programs/sub-suite/subeditor.s +++ b/programs/sub-suite/subeditor.s @@ -412,8 +412,8 @@ print_char: ; inc step ; lda rega ; Get the character back. jsr get_ctrlidx ; Get the control code jump table index. - lsl #1 ; Multiply the return value by two, to get the index. - lea.w e, (ct_jtb+a); Get the address of the control code handler. + lea ct_jtb ; Get the pointer to the jump table. + mov.w e, (e+2*a); Get the address of the control code handler. deb ; Reset B. tba ; Reset A. jsr (e) ; Jump to the handler for that control code. -- cgit v1.2.3-13-gbd6f