Add punched tape functionality
This commit is contained in:
parent
1c2c501d09
commit
c6c1c5567f
128
gidubba.asm
128
gidubba.asm
|
@ -247,6 +247,16 @@ cnarg: load r1, ucp
|
|||
breq r0, r1, print
|
||||
load r1, lcp
|
||||
breq r0, r1, print
|
||||
;Write to tape
|
||||
load r1, ucw
|
||||
breq r0, r1, write
|
||||
load r1, lcw
|
||||
breq r0, r1, write
|
||||
;Read from tape
|
||||
load r1, ucr
|
||||
breq r0, r1, read
|
||||
load r1, lcr
|
||||
breq r0, r1, read
|
||||
;Halt
|
||||
load r1, uch
|
||||
breq r0, r1, end
|
||||
|
@ -609,39 +619,77 @@ lstend: load r0, count
|
|||
|
||||
;Print the text
|
||||
|
||||
;Get the printer address
|
||||
;High byte
|
||||
print: load r0, cstff
|
||||
store prwrch + 1, r0
|
||||
;Low byte
|
||||
load r0, cstfe
|
||||
store prwrch + 2, r0
|
||||
|
||||
;Print
|
||||
cleq r0, r0, prwr
|
||||
|
||||
;Return to the command prompt
|
||||
breq r0, r0, cmdp
|
||||
|
||||
;***
|
||||
|
||||
;Write the text to tape
|
||||
|
||||
;Get the keypunch address
|
||||
;High byte
|
||||
write: load r0, cstff
|
||||
store prwrch + 1, r0
|
||||
;Low byte
|
||||
load r0, cstfd
|
||||
store prwrch + 2, r0
|
||||
|
||||
;Write
|
||||
cleq r0, r0, prwr
|
||||
|
||||
;Write a substitute
|
||||
load r0, sub
|
||||
store fffd, r0
|
||||
|
||||
;Return to the command prompt
|
||||
breq r0, r0, cmdp
|
||||
|
||||
;***
|
||||
|
||||
;Read the text from tape
|
||||
|
||||
;Get the save start address
|
||||
;High byte
|
||||
print: load r0, svstrt
|
||||
store chprnt + 1, r0
|
||||
read: load r0, svstrt
|
||||
store chrsto + 1, r0
|
||||
;Low byte
|
||||
load r0, svstrt + 1
|
||||
store chprnt + 2, r0
|
||||
store chrsto + 2, r0
|
||||
|
||||
;Load a character from the save
|
||||
chprnt: load r1, buffer + 100
|
||||
;Read and store a character
|
||||
chread: load r1, fffd
|
||||
chrsto: store buffer + 100, r1
|
||||
|
||||
;Check for the save end
|
||||
load r2, sub
|
||||
breq r1, r2, prend
|
||||
|
||||
;Print the character
|
||||
store fffe, r1
|
||||
breq r1, r2, redend
|
||||
|
||||
;Increment the save address
|
||||
;Load the address
|
||||
load r0, chprnt + 1
|
||||
load r1, chprnt + 2
|
||||
load r0, chrsto + 1
|
||||
load r1, chrsto + 2
|
||||
;Increment
|
||||
cleq r0, r0, incdw
|
||||
;Store the address
|
||||
store chprnt + 1, r0
|
||||
store chprnt + 2, r1
|
||||
store chrsto + 1, r0
|
||||
store chrsto + 2, r1
|
||||
|
||||
;Print the next character
|
||||
breq r0, r0, chprnt
|
||||
;Read the next character
|
||||
breq r0, r0, chread
|
||||
|
||||
;Return to the command prompt
|
||||
prend: breq r0, r0, cmdp
|
||||
redend: breq r0, r0, cmdp
|
||||
|
||||
;***
|
||||
|
||||
|
@ -1238,6 +1286,44 @@ prcln: load r0, colon
|
|||
|
||||
;***
|
||||
|
||||
;Print or write to tape
|
||||
|
||||
;Get the save start address
|
||||
;High byte
|
||||
prwr: load r0, svstrt
|
||||
store chprwr + 1, r0
|
||||
;Low byte
|
||||
load r0, svstrt + 1
|
||||
store chprwr + 2, r0
|
||||
|
||||
;Load a character from the save
|
||||
chprwr: load r1, buffer + 100
|
||||
|
||||
;Check for the save end
|
||||
load r2, sub
|
||||
breq r1, r2, pwend
|
||||
|
||||
;Print the character
|
||||
prwrch: store fffe, r1
|
||||
|
||||
;Increment the save address
|
||||
;Load the address
|
||||
load r0, chprwr + 1
|
||||
load r1, chprwr + 2
|
||||
;Increment
|
||||
cleq r0, r0, incdw
|
||||
;Store the address
|
||||
store chprwr + 1, r0
|
||||
store chprwr + 2, r1
|
||||
|
||||
;Print the next character
|
||||
breq r0, r0, chprwr
|
||||
|
||||
;Return
|
||||
pwend: ret
|
||||
|
||||
;***
|
||||
|
||||
;Data
|
||||
|
||||
;Constants
|
||||
|
@ -1258,6 +1344,8 @@ constd: data d
|
|||
conste: data e
|
||||
constf: data f
|
||||
constf: data f
|
||||
cstfd: data fd
|
||||
cstfe: data fe
|
||||
cstff: data ff
|
||||
|
||||
;Characters
|
||||
|
@ -1292,6 +1380,8 @@ uch: data 48
|
|||
uci: data 49
|
||||
ucl: data 4c
|
||||
ucp: data 50
|
||||
ucr: data 52
|
||||
ucw: data 57
|
||||
bslash: data 5c
|
||||
lca: data 61
|
||||
lcb: data 62
|
||||
|
@ -1303,6 +1393,8 @@ lch: data 68
|
|||
lci: data 69
|
||||
lcl: data 6c
|
||||
lcp: data 70
|
||||
lcr: data 72
|
||||
lcw: data 77
|
||||
|
||||
;Variables
|
||||
ovrflw: data 0
|
||||
|
@ -1326,10 +1418,6 @@ count: data 0
|
|||
cmpadr: data 0
|
||||
data 0
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
;Buffer and save
|
||||
bfstrt: addr buffer
|
||||
bfsize: data fe
|
||||
|
|
|
@ -10,9 +10,9 @@ System requirements
|
|||
-------------------
|
||||
|
||||
Gidubba requires a terminal with local echo at address FFFF and
|
||||
optionally a line printer at address FFFE. The emulator implementation
|
||||
included in the Thingamajig repository is suitable. If your setup
|
||||
differs from this you may have to modify the code yourself.
|
||||
optionally a line printer at address FFFE and a punched tape reader and
|
||||
keypunch at FFFD. If your setup differs from this you may have to modify
|
||||
the code yourself.
|
||||
|
||||
Usage
|
||||
-----
|
||||
|
@ -33,6 +33,8 @@ Commands with two arguments:
|
|||
|
||||
Commands with no argument:
|
||||
* P: Print (requires a printer)
|
||||
* W: Writes to tape (requires a keypunch)
|
||||
* R: Reads from tape (requires a tape reader)
|
||||
* H: Halt
|
||||
|
||||
Both commands and arguments are case-insensitive. In both the command
|
||||
|
|
Loading…
Reference in New Issue