From 9770df14c4251afd672585d50d6a11dd9dff1dfa Mon Sep 17 00:00:00 2001 From: CrazyEttin <> Date: Sun, 28 Aug 2022 15:49:51 +0300 Subject: [PATCH] Update the code to make use of immediate loads, make sending the line feed character input a carriage return and line feed, and include format information in the readme --- gidubba.asm | 449 ++++++++++++++++++++++------------------------------ readme.md | 23 ++- 2 files changed, 210 insertions(+), 262 deletions(-) diff --git a/gidubba.asm b/gidubba.asm index 1f0129a..ce78d5b 100644 --- a/gidubba.asm +++ b/gidubba.asm @@ -3,15 +3,15 @@ ;*** ;Save an end-of-file at the start address - load r0, eof + load r0, #1a store buffer + 100, r0 ;*** ;Command prompt -cmdp: load r0, prompt +cmdp: load r0, #3e store ffff, r0 - load r0, space + load r0, #20 store ffff, r0 ;Input the command @@ -19,10 +19,10 @@ cmdin: cleq r0, r0, input ;Check for control characters ;Escape - load r0, esc + load r0, #1b breq r0, r2, cmdesc ;End-of-file - load r0, eof + load r0, #1a breq r0, r2, end ;Initialise the command and argument @@ -30,7 +30,7 @@ cmdin: cleq r0, r0, input store cmd, r0 store argf1, r0 store argf2, r0 - load r0, zero + load r0, #30 store arg1, r0 store arg1 + 1, r0 store arg1 + 2, r0 @@ -43,21 +43,21 @@ cmdin: cleq r0, r0, input load r0, buffer store cmd, r0 ;Load carriage return and hash - load r1, cr - load r2, hash + load r1, #d + load r2, #23 ;Check for no command breq r0, r1, cmdp ;First digit load r0, buffer + 1 breq r0, r1, chkcmd - load r3, const1 + load r3, #1 store argf1, r3 breq r0, r2, hsharg load r3, arg1d2 + 1 store arg2d1 + 1, r3 load r3, arg1d2 + 2 store arg2d1 + 2, r3 - load r3, comma + load r3, #2c breq r0, r3, 2ndarg store arg1 + 3, r0 ;Second digit @@ -67,7 +67,7 @@ arg1d2: load r0, buffer + 2 store arg2d1 + 1, r3 load r3, arg1d3 + 2 store arg2d1 + 2, r3 - load r3, comma + load r3, #2c breq r0, r3, 2ndarg load r2, arg1 + 3 store arg1 + 2, r2 @@ -79,7 +79,7 @@ arg1d3: load r0, buffer + 3 store arg2d1 + 1, r3 load r3, arg1d4 + 2 store arg2d1 + 2, r3 - load r3, comma + load r3, #2c breq r0, r3, 2ndarg load r2, arg1 + 2 store arg1 + 1, r2 @@ -93,7 +93,7 @@ arg1d4: load r0, buffer + 4 store arg2d1 + 1, r3 load r3, arg1d5 + 2 store arg2d1 + 2, r3 - load r3, comma + load r3, #2c breq r0, r3, 2ndarg load r2, arg1 + 1 store arg1, r2 @@ -108,10 +108,10 @@ arg1d4: load r0, buffer + 4 cleq r0, r0, incdw store arg2d1 + 1, r0 store arg2d1 + 2, r1 - load r1, cr + load r1, #d arg1d5: load r0, buffer + 5 breq r0, r1, getarg - load r3, comma + load r3, #2c breq r0, r3, 2ndarg breq r0, r0, cmderr @@ -126,11 +126,11 @@ arg1d5: load r0, buffer + 5 store arg2d3 + 1, r0 store arg2d3 + 2, r1 ;Load carriage return - load r1, cr + load r1, #d ;First digit arg2d1: load r0, 0 breq r0, r1, chkcmd - load r3, const1 + load r3, #1 store argf2, r3 store arg2 + 1, r0 ;Second digit @@ -159,7 +159,7 @@ hsharg: load r0, buffer + 2 ;First digit getarg: load r0, arg1 cleq r0, r0, hex2n - load r1, qmark + load r1, #3f breq r0, r1, cmderr xor r2, r2 xor r2, r0 @@ -170,7 +170,7 @@ getarg: load r0, arg1 ;Second digit load r0, arg1 + 1 cleq r0, r0, hex2n - load r1, qmark + load r1, #3f breq r0, r1, cmderr ;Combine and store the first and second digits or r0, r2 @@ -178,7 +178,7 @@ getarg: load r0, arg1 ;Third digit load r0, arg1 + 2 cleq r0, r0, hex2n - load r1, qmark + load r1, #3f breq r0, r1, cmderr xor r2, r2 xor r2, r0 @@ -189,7 +189,7 @@ getarg: load r0, arg1 ;Fourth digit load r0, arg1 + 3 cleq r0, r0, hex2n - load r1, qmark + load r1, #3f breq r0, r1, cmderr ;Combine and store the third and fourth digits or r0, r2 @@ -199,7 +199,7 @@ getarg: load r0, arg1 ;First digit load r0, arg2 cleq r0, r0, hex2n - load r1, qmark + load r1, #3f breq r0, r1, cmderr xor r2, r2 xor r2, r0 @@ -210,7 +210,7 @@ getarg: load r0, arg1 ;Second digit load r0, arg2 + 1 cleq r0, r0, hex2n - load r1, qmark + load r1, #3f breq r0, r1, cmderr ;Combine and store the first and second digits or r0, r2 @@ -228,55 +228,55 @@ chkcmd: load r0, cmd xor r3, r3 breq r2, r3, onearg ;Copy to mark - load r1, ucc + load r1, #43 breq r0, r1, copy - load r1, lcc + load r1, #63 breq r0, r1, copy ;Delete - load r1, ucd + load r1, #44 breq r0, r1, delete - load r1, lcd + load r1, #64 breq r0, r1, delete ;List - load r1, ucl + load r1, #4c breq r0, r1, list - load r1, lcl + load r1, #6c breq r0, r1, list ;Branch to error breq r0, r0, cmderr ;Insert -onearg: load r1, uci +onearg: load r1, #49 breq r0, r1, insln - load r1, lci + load r1, #69 breq r0, r1, insln ;Set a mark - load r1, ucm + load r1, #4d breq r0, r1, setmrk - load r1, lcm + load r1, #6d breq r0, r1, setmrk ;Branch to error breq r0, r0, cmderr ;Print -cnarg: load r1, ucp +cnarg: load r1, #50 breq r0, r1, print - load r1, lcp + load r1, #70 breq r0, r1, print ;Write to tape - load r1, ucw + load r1, #57 breq r0, r1, write - load r1, lcw + load r1, #77 breq r0, r1, write ;Read from tape - load r1, ucr + load r1, #52 breq r0, r1, read - load r1, lcr + load r1, #72 breq r0, r1, read ;Print an error and return to the command prompt cmderr: cleq r0, r0, error breq r0, r0, cmdp -cmdesc: load r0, space +cmdesc: load r0, #20 store ffff, r0 store ffff, r0 breq r0, r0, cmdin @@ -296,10 +296,10 @@ inline: cleq r0, r0, input ;Check for control characters ;Escape - load r0, esc + load r0, #1b breq r0, r2, inesc ;End-of-file - load r0, eof + load r0, #1a breq r0, r2, cmdp ;Increment the line number @@ -328,7 +328,7 @@ inline: cleq r0, r0, input ;Insert the next line breq r0, r0, insln -inesc: load r0, space +inesc: load r0, #20 store ffff, r0 store ffff, r0 store ffff, r0 @@ -370,7 +370,7 @@ copy: xor r0, r0 ;Check for the save end chsend: load r0, 0 - load r1, eof + load r1, #1a breq r0, r1, cmdp ;Restore the buffer start address @@ -389,7 +389,7 @@ readch: load r1, 0 ;Check for save and buffer ends ;Save end - load r2, eof + load r2, #1a breq r1, r2, feol ;Buffer end load r2, bfsize @@ -400,12 +400,12 @@ stoch: store 0, r1 ;Check for line and save ends ;Line end - load r2, lf + load r2, #a breq r1, r2, incsz ;Increment the character counter and store it in r3 ;Increment - load r2, const1 + load r2, #1 cleq r0, r0, sum ;Store xor r3, r3 @@ -414,7 +414,7 @@ stoch: store 0, r1 ;Increment the save address ;Low byte load r0, readch + 2 - load r2, const1 + load r2, #1 cleq r0, r0, sum store readch + 2, r0 ;Add the overflow to the high byte @@ -427,7 +427,7 @@ stoch: store 0, r1 ;Increment the buffer address ;Low byte load r0, stoch + 2 - load r2, const1 + load r2, #1 cleq r0, r0, sum store stoch + 2, r0 ;Add the overflow to the high byte @@ -445,7 +445,7 @@ stoch: store 0, r1 breq r0, r0, readch ;Increment and store the string size -feol: load r2, const2 +feol: load r2, #2 cleq r0, r0, sum store strsz, r0 @@ -456,7 +456,7 @@ feol: load r2, const2 store stocr + 2 ,r1 ;Store the CR of a newline in the buffer - load r0, cr + load r0, #d stocr: store 0, r0 ;Increment the buffer address @@ -470,14 +470,14 @@ stocr: store 0, r0 store stolf + 2, r1 ;Store the LF of a newline in the buffer - load r0, lf + load r0, #a stolf: store 0, r0 ;Jump to saving breq r0, r0, svtarg ;Increment and store the string size -incsz: load r2, const1 +incsz: load r2, #1 cleq r0, r0, sum store strsz, r0 @@ -512,11 +512,11 @@ svtarg: load r0, target ;Loop ;Decrement the counter load r0, count - load r2, cstff + load r2, #ff cleq r0, r0, sum store count, r0 ;Check if the mark is a hash - load r2, cstff + load r2, #ff load r0, target brneq r0, r2, incmrk load r1, target + 1 @@ -597,7 +597,7 @@ delete: xor r0, r0 ;Check for the save end dchend: load r0, 0 - load r1, eof + load r1, #1a breq r0, r1, cmdp ;Increment the line number @@ -626,7 +626,7 @@ lodmov: load r0, 0 stomov: store 0, r0 ;Check for the save end - load r1, eof + load r1, #1a breq r0, r1, delend ;Increment the first save address @@ -655,7 +655,7 @@ stomov: store 0, r0 ;Loop ;Decrement the counter delend: load r0, count - load r2, cstff + load r2, #ff cleq r0, r0, sum store count, r0 ;Decrement the line number @@ -691,7 +691,7 @@ list: xor r0, r0 ;Check for the save end lchend: load r0, 0 - load r1, eof + load r1, #1a breq r0, r1, cmdp ;Print a line number prompt @@ -701,14 +701,14 @@ lchend: load r0, 0 chlist: load r1, 0 ;Check for the save end - load r2, eof + load r2, #1a breq r1, r2, prnwln ;Print the character store ffff, r1 ;Check for the line end - load r2, lf + load r2, #a breq r1, r2, lstend ;Increment the save address @@ -730,7 +730,7 @@ prnwln: cleq r0, r0, newln ;Loop ;Decrement the counter lstend: load r0, count - load r2, cstff + load r2, #ff cleq r0, r0, sum store count, r0 ;Increment the line number @@ -748,10 +748,10 @@ lstend: load r0, count ;Get the printer address ;High byte -print: load r0, cstff +print: load r0, #ff store prwrch + 1, r0 ;Low byte - load r0, cstfe + load r0, #fe store prwrch + 2, r0 ;Print @@ -766,17 +766,17 @@ print: load r0, cstff ;Get the tape punch address ;High byte -write: load r0, cstff +write: load r0, #ff store prwrch + 1, r0 ;Low byte - load r0, cstfd + load r0, #fd store prwrch + 2, r0 ;Write cleq r0, r0, prwr ;Write an end-of-file - load r0, eof + load r0, #1a store fffd, r0 ;Return to the command prompt @@ -807,18 +807,18 @@ chread: load r1, fffd ;Trailer chkend: xor r2, r2 brneq r1, r2, chkntp - load r1, eof + load r1, #1a breq r0, r0, chrsto ;Empty tape reader chkntp: nand r2, r2 brneq r1, r2, chrsto - load r1, eof + load r1, #1a ;Store a character chrsto: store buffer + 100, r1 ;Check for the save end - load r2, eof + load r2, #1a breq r1, r2, redend ;Increment the save address @@ -845,16 +845,16 @@ end: halt ;*** ;Print a newline -newln: load r0, cr +newln: load r0, #d store ffff, r0 - load r0, lf + load r0, #a store ffff, r0 ret ;*** ;Print an error -error: load r0, qmark +error: load r0, #3f store ffff, r0 cleq r0, r0, newln @@ -886,7 +886,7 @@ sumlop: xor r1, r1 rol r1 breq r1, r2, nvrflw ;Store - load r1, const1 + load r1, #1 store ovrflw, r1 ;Check for no carry @@ -913,7 +913,7 @@ incdw: xor r3, r3 xor r0, r1 ;Increment the low byte - load r2, const1 + load r2, #1 cleq r0, r0, sum ;Load the high byte to r0 and store the low byte in r3 @@ -948,7 +948,7 @@ decdw: xor r3, r3 xor r3, r1 ;Decrement the high byte - load r2, cstff + load r2, #ff cleq r0, r0, sum ;Load the low byte to r0 and store the high byte in r3 @@ -963,7 +963,7 @@ decdw: xor r3, r3 xor r0, r2 ;Decrement the low byte - load r2, cstff + load r2, #ff cleq r0, r0, sum ;Load the high byte to r0 and store the low byte in r3 @@ -994,75 +994,75 @@ decdw: xor r3, r3 ;Get the hexadecimal digit of a nibble ;Extract the low nibble -n2hex: load r1, constf +n2hex: load r1, #f and r0, r1 ;Get the nibble value - load r1, const0 + load r1, #0 breq r0, r1, dgt0 - load r1, const1 + load r1, #1 breq r0, r1, dgt1 - load r1, const2 + load r1, #2 breq r0, r1, dgt2 - load r1, const3 + load r1, #3 breq r0, r1, dgt3 - load r1, const4 + load r1, #4 breq r0, r1, dgt4 - load r1, const5 + load r1, #5 breq r0, r1, dgt5 - load r1, const6 + load r1, #6 breq r0, r1, dgt6 - load r1, const7 + load r1, #7 breq r0, r1, dgt7 - load r1, const8 + load r1, #8 breq r0, r1, dgt8 - load r1, const9 + load r1, #9 breq r0, r1, dgt9 - load r1, consta + load r1, #a breq r0, r1, dgta - load r1, constb + load r1, #b breq r0, r1, dgtb - load r1, constc + load r1, #c breq r0, r1, dgtc - load r1, constd + load r1, #d breq r0, r1, dgtd - load r1, conste + load r1, #e breq r0, r1, dgte - load r1, constf + load r1, #f breq r0, r1, dgtf ;Load the hexadecimal digit of the nibble -dgt0: load r0, zero +dgt0: load r0, #30 breq r0, r0, n2hend -dgt1: load r0, one +dgt1: load r0, #31 breq r0, r0, n2hend -dgt2: load r0, two +dgt2: load r0, #32 breq r0, r0, n2hend -dgt3: load r0, three +dgt3: load r0, #33 breq r0, r0, n2hend -dgt4: load r0, four +dgt4: load r0, #34 breq r0, r0, n2hend -dgt5: load r0, five +dgt5: load r0, #35 breq r0, r0, n2hend -dgt6: load r0, six +dgt6: load r0, #36 breq r0, r0, n2hend -dgt7: load r0, seven +dgt7: load r0, #37 breq r0, r0, n2hend -dgt8: load r0, eight +dgt8: load r0, #38 breq r0, r0, n2hend -dgt9: load r0, nine +dgt9: load r0, #39 breq r0, r0, n2hend -dgta: load r0, uca +dgta: load r0, #41 breq r0, r0, n2hend -dgtb: load r0, ucb +dgtb: load r0, #42 breq r0, r0, n2hend -dgtc: load r0, ucc +dgtc: load r0, #43 breq r0, r0, n2hend -dgtd: load r0, ucd +dgtd: load r0, #44 breq r0, r0, n2hend -dgte: load r0, uce +dgte: load r0, #45 breq r0, r0, n2hend -dgtf: load r0, ucf +dgtf: load r0, #46 breq r0, r0, n2hend ;Return @@ -1074,88 +1074,88 @@ n2hend: ret ;Get the nibble value ;Numeric digits -hex2n: load r1, zero +hex2n: load r1, #30 breq r0, r1, nbl0 - load r1, one + load r1, #31 breq r0, r1, nbl1 - load r1, two + load r1, #32 breq r0, r1, nbl2 - load r1, three + load r1, #33 breq r0, r1, nbl3 - load r1, four + load r1, #34 breq r0, r1, nbl4 - load r1, five + load r1, #35 breq r0, r1, nbl5 - load r1, six + load r1, #36 breq r0, r1, nbl6 - load r1, seven + load r1, #37 breq r0, r1, nbl7 - load r1, eight + load r1, #38 breq r0, r1, nbl8 - load r1, nine + load r1, #39 breq r0, r1, nbl9 ;Uppercase letter digits - load r1, uca + load r1, #41 breq r0, r1, nbla - load r1, ucb + load r1, #42 breq r0, r1, nblb - load r1, ucc + load r1, #43 breq r0, r1, nblc - load r1, ucd + load r1, #44 breq r0, r1, nbld - load r1, uce + load r1, #45 breq r0, r1, nble - load r1, ucf + load r1, #46 breq r0, r1, nblf ;Lowercase letter digits - load r1, lca + load r1, #61 breq r0, r1, nbla - load r1, lcb + load r1, #62 breq r0, r1, nblb - load r1, lcc + load r1, #63 breq r0, r1, nblc - load r1, lcd + load r1, #64 breq r0, r1, nbld - load r1, lce + load r1, #65 breq r0, r1, nble - load r1, lcf + load r1, #66 breq r0, r1, nblf ;Load a question mark if the character is not a digit - load r0, qmark + load r0, #3f breq r0, r0, h2nend ;Load the hexadecimal digit of the nibble -nbl0: load r0, const0 +nbl0: load r0, #0 breq r0, r0, h2nend -nbl1: load r0, const1 +nbl1: load r0, #1 breq r0, r0, h2nend -nbl2: load r0, const2 +nbl2: load r0, #2 breq r0, r0, h2nend -nbl3: load r0, const3 +nbl3: load r0, #3 breq r0, r0, h2nend -nbl4: load r0, const4 +nbl4: load r0, #4 breq r0, r0, h2nend -nbl5: load r0, const5 +nbl5: load r0, #5 breq r0, r0, h2nend -nbl6: load r0, const6 +nbl6: load r0, #6 breq r0, r0, h2nend -nbl7: load r0, const7 +nbl7: load r0, #7 breq r0, r0, h2nend -nbl8: load r0, const8 +nbl8: load r0, #8 breq r0, r0, h2nend -nbl9: load r0, const9 +nbl9: load r0, #9 breq r0, r0, h2nend -nbla: load r0, consta +nbla: load r0, #a breq r0, r0, h2nend -nblb: load r0, constb +nblb: load r0, #b breq r0, r0, h2nend -nblc: load r0, constc +nblc: load r0, #c breq r0, r0, h2nend -nbld: load r0, constd +nbld: load r0, #d breq r0, r0, h2nend -nble: load r0, conste +nble: load r0, #e breq r0, r0, h2nend -nblf: load r0, constf +nblf: load r0, #f breq r0, r0, h2nend ;Return @@ -1218,23 +1218,26 @@ inloop: load r1, ffff ;Check for control characters and the buffer end ;Delete - load r2, del + load r2, #7f breq r1, r2, delbr ;Escape - load r2, esc + load r2, #1b breq r1, r2, escbr ;End-of-file - load r2, eof + load r2, #1a breq r1, r2, eofbr ;Carriage return - load r2, cr + load r2, #d breq r1, r2, crbr + ;Line feed + load r2, #a + breq r1, r2, lfbr ;Buffer end load r2, bfsize brneq r0, r2, chstor ;Backtrack if at the buffer end - load r2, bs + load r2, #8 store ffff, r2 breq r0, r0, inloop @@ -1243,7 +1246,7 @@ chstor: store buffer, r1 ;Increment the character counter and store it in r3 ;Increment - load r2, const1 + load r2, #1 cleq r0, r0, sum ;Store xor r3, r3 @@ -1252,7 +1255,7 @@ chstor: store buffer, r1 ;Increment the buffer address ;Low byte load r0, chstor + 2 - load r2, const1 + load r2, #1 cleq r0, r0, sum store chstor + 2, r0 ;Add the overflow to the high byte @@ -1270,7 +1273,7 @@ chstor: store buffer, r1 breq r0, r0, inloop ;Print an underscore -delbr: load r2, uscore +delbr: load r2, #5f store ffff, r2 ;Check for buffer start @@ -1279,7 +1282,7 @@ delbr: load r2, uscore ;Decrement the character counter and store it in r3 ;Decrement - load r2, cstff + load r2, #ff cleq r0, r0, sum ;Store xor r3, r3 @@ -1288,12 +1291,12 @@ delbr: load r2, uscore ;Decrement the buffer address ;High byte load r0, chstor + 1 - load r2, cstff + load r2, #ff cleq r0, r0, sum store chstor + 1, r0 ;Low byte load r0, chstor + 2 - load r2, cstff + load r2, #ff cleq r0, r0, sum store chstor + 2, r0 ;Add the overflow to the high byte @@ -1312,9 +1315,9 @@ delbr: load r2, uscore ;Print a backslash and a newline ;Backslash -escbr: load r0, space +escbr: load r0, #20 store ffff, r0 - load r0, bslash + load r0, #5c store ffff, r0 ;Newline cleq r0, r0, newln @@ -1328,19 +1331,28 @@ eofbr: cleq r0, r0, newln ;Return with End-of-file at r2 breq r0, r0, inend + ;Print a line feed +crbr: load r1, #a + store ffff, r1 + breq r0, r0, endnl + + ;Print a carriage return +lfbr: load r1, #d + store ffff, r1 + ;Increment and store the string size -crbr: load r2, const2 +endnl: load r2, #2 cleq r0, r0, sum store strsz, r0 - ;Store the CR of a newline in the buffer ;Get the buffer address load r1, chstor + 1 store endcr + 1, r1 load r1, chstor + 2 store endcr + 2, r1 - ;Store - load r0, cr + + ;Store the CR of a newline in the buffer + load r0, #d endcr: store 0, r0 ;Increment the buffer address @@ -1353,9 +1365,8 @@ endcr: store 0, r0 store endlf + 1, r0 store endlf + 2, r1 - ;Print and store the LF of a newline in the buffer - load r0, lf - store ffff, r0 + ;Store the LF of a newline in the buffer + load r0, #a endlf: store 0, r0 ;Return @@ -1368,7 +1379,7 @@ inend: ret ;Find the end of the save address ;Check for an end-of-file eofchk: load r0, 0 - load r1, eof + load r1, #1a breq r0, r1, endfnd ;Load the address load r0, eofchk + 1 @@ -1473,7 +1484,7 @@ chload: load r1, buffer chsave: store buffer + 100, r1 ;Check for line end - load r2, lf + load r2, #a breq r1, r2, savend ;Increment the buffer address @@ -1529,11 +1540,11 @@ charg: load r0, target ;Check for control characters ;End-of-file -feof: load r0, eof +feof: load r0, #1a eoflod: load r1, 0 breq r0, r1, fendnd ;Line feed - load r2, lf + load r2, #a brneq r1, r2, incsav ;Increment the line number @@ -1572,16 +1583,16 @@ prnln: load r0, lnnum ;Convert cleq r0, r0, bt2hex ;Print - load r2, zero + load r2, #30 breq r0, r2, lead0 store ffff, r0 nlead0: store ffff, r1 - load r3, const1 + load r3, #1 breq r0, r0, lbtln -lead0: load r0, space +lead0: load r0, #20 store ffff, r0 brneq r1, r2, nlead0 - load r1, space + load r1, #20 store ffff, r1 xor r3, r3 @@ -1594,9 +1605,9 @@ lbtln: load r0, lnnum + 1 xor r2, r2 brneq r2, r3, nled0s ;Print - load r2, zero + load r2, #30 brneq r0, r2, nled0s - load r0, space + load r0, #20 store ffff, r0 store ffff, r1 breq r0, r0, prcln @@ -1604,9 +1615,9 @@ nled0s: store ffff, r0 store ffff, r1 ;Print a colon -prcln: load r0, colon +prcln: load r0, #3a store ffff, r0 - load r0, space + load r0, #20 store ffff, r0 ;Return @@ -1628,7 +1639,7 @@ prwr: load r0, svstrt chprwr: load r1, buffer + 100 ;Check for the save end - load r2, eof + load r2, #1a breq r1, r2, pwend ;Print the character @@ -1654,80 +1665,6 @@ pwend: ret ;Data - ;Constants -const0: data 0 -const1: data 1 -const2: data 2 -const3: data 3 -const4: data 4 -const5: data 5 -const6: data 6 -const7: data 7 -const8: data 8 -const9: data 9 -consta: data a -constb: data b -constc: data c -constd: data d -conste: data e -constf: data f -constf: data f -cstfd: data fd -cstfe: data fe -cstff: data ff - - ;Characters -bs: data 8 -lf: data a -cr: data d -eof: data 1a -esc: data 1b -space: data 20 -hash: data 23 -comma: data 2c -zero: data 30 -one: data 31 -two: data 32 -three: data 33 -four: data 34 -five: data 35 -six: data 36 -seven: data 37 -eight: data 38 -nine: data 39 -colon: data 3a -prompt: data 3e -qmark: data 3f -uca: data 41 -ucb: data 42 -ucc: data 43 -ucd: data 44 -uce: data 45 -ucf: data 46 -uch: data 48 -uci: data 49 -ucl: data 4c -ucm: data 4d -ucp: data 50 -ucr: data 52 -ucw: data 57 -bslash: data 5c -uscore: data 5f -lca: data 61 -lcb: data 62 -lcc: data 63 -lcd: data 64 -lce: data 65 -lcf: data 66 -lch: data 68 -lci: data 69 -lcl: data 6c -lcm: data 6d -lcp: data 70 -lcr: data 72 -lcw: data 77 -del: data 7f - ;Variables ovrflw: data 0 lnnum: data 0 diff --git a/readme.md b/readme.md index d055b7c..4400b58 100644 --- a/readme.md +++ b/readme.md @@ -9,10 +9,19 @@ https://ahti.space/git/crazyettin/Thingamajig. System requirements ------------------- -Gidubba requires a terminal with local echo at address FFFF, and -optionally a character printer at address FFFE and a punched tape reader -and punch or a casette drive at FFFD. If your setup differs from this -you have to modify the code yourself. +Gidubba uses a terminal with local echo at address FFFF, and optionally +a character printer at address FFFE and a punched tape reader and punch +or a casette drive at FFFD. Do not be afraid to modify the code yourself +if your setup requires it! + +Format +------ + +Gidubba works with texts consisting of lines and terminated with an +end-of-file (^Z). The lines consist of at most 256 characters terminated +by a newline of a carriage return (^M) followed by a line feed (^J), +included in the character count. Note that any characters following the +last newline and preceding the end-of-file are ignored. Usage ----- @@ -43,6 +52,8 @@ Commands with no arguments: A delete (^?) discards the preceding character and outputs an underscore to the terminal. An escape (^[) discards the contents of the current command or line and outputs a backslash and a newline to the terminal. -An end-of-file (^Z) discards the current command and halts the computer -or discards the current line and returns to the command prompt. +A carriage return (^M) or a line feed (^J) inputs a newline that commits +the current command or line. An end-of-file (^Z) discards the current +command and halts the computer or discards the current line and returns +to the command prompt.  \ No newline at end of file