From 2465da5da3928832fefdc976dba2f0919d4b879d Mon Sep 17 00:00:00 2001 From: Bastian Bittorf Date: Mon, 29 May 2023 12:19:39 +0200 Subject: [PATCH] replace 'sub ax,2' with two times 'dec ax', which is 1 byte shorter. Doing this in 2 places safes 2 bytes which leads to a 489 bytes flat binary. --- sectorc.s | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sectorc.s b/sectorc.s index b803d3f..0073a84 100644 --- a/sectorc.s +++ b/sectorc.s @@ -114,7 +114,8 @@ compile_stmts: mov ax,[bx] ; load function offset from symbol-table sub ax,di ; compute relative to this location: "dest - cur - 2" - sub ax,2 + dec ax ; (shorter than 'sub ax,2') + dec ax stosw ; emit target jmp compile_stmts_tok_next2 ; loop to compile next statement @@ -148,7 +149,8 @@ _patch_back: stosb pop ax ; restore loop start location sub ax,di ; compute relative to this location: "dest - cur - 2" - sub ax,2 + dec ax ; (shorter than 'sub ax,2') + dec ax stosw ; emit target ;; [fall-through] _patch_fwd: