From f375b60328b89a16721d046133810cd9829243fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maja=20K=C4=85dzio=C5=82ka?= Date: Tue, 7 Mar 2023 00:35:22 +0100 Subject: [PATCH] Save 1 byte --- README.md | 4 ++-- boot.s | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index d59efc8..36849c5 100644 --- a/README.md +++ b/README.md @@ -153,8 +153,8 @@ Git or GitHub's web interface. This disparity is handled by two Python scripts: ## Free bytes -At this moment, not counting the `55 AA` signature at the end, **492** bytes are used, -leaving 18 bytes for any potential improvements. +At this moment, not counting the `55 AA` signature at the end, **491** bytes are used, +leaving 19 bytes for any potential improvements. Byte saving leaderboard: - Ilya Kurdyukov saved 24 bytes. Thanks! diff --git a/boot.s b/boot.s index d143091..d2d89fc 100644 --- a/boot.s +++ b/boot.s @@ -120,6 +120,9 @@ ReadLine: mov al, 0x0a int 0x10 mov [di-1], bl ; write the null terminator by using the BX = 0 from PutChar + pop bx +InterpreterLoopSaveBX: + push bx InterpreterLoop: call ParseWord jcxz short ReadLine @@ -179,10 +182,7 @@ STATE equ $+1 mov si, .return jmp ax .return: - dw .executed -.executed: - push bx - jmp short InterpreterLoop + dw InterpreterLoopSaveBX COMMA: HERE equ $+1