From 8c37a1a8714ee7e3ebe495ce51ff2393d8289954 Mon Sep 17 00:00:00 2001 From: CrazyEttin <> Date: Thu, 15 Sep 2022 22:29:48 +0300 Subject: [PATCH] Reintegrate an unnecessary call back to the rest of the code --- gidubba.asm | 107 +++++++++++++++++++++++----------------------------- 1 file changed, 47 insertions(+), 60 deletions(-) diff --git a/gidubba.asm b/gidubba.asm index 77ac35d..17e2634 100644 --- a/gidubba.asm +++ b/gidubba.asm @@ -359,11 +359,54 @@ inline: cleq r0, r0, input xor r0, r0 brneq r0, r1, cmdp - ;Save the line - cleq r0, r0, save + ;Restore the buffer start address + ;High byte + load r0, bfstrt + store chload + 1, r0 + ;Low byte + load r0, bfstrt + 1 + store chload + 2, r0 - ;Insert the next line - breq r0, r0, nextln + ;Store the save address + ;High byte + load r0, eoflod + 1 + store chsave + 1, r0 + ;Low byte + load r0, eoflod + 2 + store chsave + 2, r0 + + ;Load and save a character from the buffer + ;Load +chload: load r1, buffer + ;Save +chsave: store buffer + 100, r1 + + ;Check for line end + load r2, #a + breq r1, r2, nextln + + ;Increment the buffer address + ;Load the address + load r0, chload + 1 + load r1, chload + 2 + ;Increment + cleq r0, r0, incdw + ;Store the address + store chload + 1, r0 + store chload + 2, r1 + + ;Increment the save address + ;Load the address + load r0, chsave + 1 + load r1, chsave + 2 + ;Increment + cleq r0, r0, incdw + ;Store the address + store chsave + 1, r0 + store chsave + 2, r1 + + ;Load and save the next character + breq r0, r0, chload inesc: load r0, #20 store ffff, r0 @@ -1640,62 +1683,6 @@ lmterr: load r0, #21 ;*** - ;Save the line - - ;Restore the buffer start address - ;High byte -save: load r0, bfstrt - store chload + 1, r0 - ;Low byte - load r0, bfstrt + 1 - store chload + 2, r0 - - ;Store the save address - ;High byte - load r0, eoflod + 1 - store chsave + 1, r0 - ;Low byte - load r0, eoflod + 2 - store chsave + 2, r0 - - ;Load and save a character from the buffer - ;Load -chload: load r1, buffer - ;Save -chsave: store buffer + 100, r1 - - ;Check for line end - load r2, #a - breq r1, r2, savend - - ;Increment the buffer address - ;Load the address - load r0, chload + 1 - load r1, chload + 2 - ;Increment - cleq r0, r0, incdw - ;Store the address - store chload + 1, r0 - store chload + 2, r1 - - ;Increment the save address - ;Load the address - load r0, chsave + 1 - load r1, chsave + 2 - ;Increment - cleq r0, r0, incdw - ;Store the address - store chsave + 1, r0 - store chsave + 2, r1 - - ;Load and save the next character - breq r0, r0, chload - - ;Return -savend: ret - - ;*** - ;Find the argument line in the save and store its number ;Check for the argument