Download View/Open - CSTA Source

Transcript
A PDP-8 Emulator Program
Reset,
isz CH
jmp Loop
tad A
dca CH
jms i CRLF
jmp Loop
'a'
0
-123d
•
35
/ Else increment ASCII code
/ Get 'a'
/ Do CR-LF
A,
CH,
MZ,
/ minus ASCII 'z'
/
/ Interrupt Handler
/
*5000
XIntH, 0
/ Interrupt Handler
dca XHold
/ Save AC
krb
/ Get character
tad XCR
/ Is it a CR?
sna
/
No - continue
jmp XHalt
/
Yes - halt
cla cll
tad Beep
/ Get Bell
tsf
/
jmp .-1
tls
/ Sound It
cla cll
tad LF
/ Get Line Feed
tsf
jmp .-1
tls
/ Display It
cla cll
tad XHold
/ Restore AC
jmp i XIntH
/ Return
Xhalt
hlt
/ Halt Program
jmp .-4
/ Restart ?
XHold, 0
XCR,
-13d
Beep,
07
LF,
10d
/
/ Basic I/O Routines - Page 30
/
*7400
...
see BIOS code
$Main
Fig. 25. PDP-8 interrupt demo program
Note that the interrupt handler does itsown I/O. It does NOT make any calls to the simple
character I/O routines on page 30. To do so would cause problems since if an interrupt occurred
during the execution of one of these I/O routines, the interrupt handler would overwrite the
original return address.
In the current implementation of the PDP-8 Emulator Program an interrupt can only be generated
by hitting a key.