| Usage guideSummary: exor [options] [disk0 [disk1 [disk2 [disk3]]]] Options:
--traceProduce instruction trace on stderr
--dtraceProduce disk access trace on stderr
--skip nnnSkip first nnn insns in trace
--swtpcSimulate SWTPC instead of EXORciser
--exbug nameGive name for ROM if not 'exbug.bin'/'swtbug.bin'
-xGo into EXBUG/SWTBUG instead of directly into MDOS/FLEX
--facts fileProcess facts files for commented disassembly
--lowerAllow lowercase
--monStart at monitor prompt
 Default disk0 is mdos.dsk / flex.dsk To load MDOS from EXBUG, type MAID followed by E800;G To load FLEX from SWTBUG, type D For example, to simulate an EXORciser with exbug.bin and mdos.dsk in the
current directory: 
~/exor-1.0$ ./exor
Load facts file 'facts'
'exbug.bin' loaded.
'mdos.dsk' opened for drive 0 (single sided)
Hit Ctrl-C for simulator command line.  Starting simulation...
Floppy error: attempt to access non-existent disk 1
MDOS 03.00
=
 To simulate SWTPC instead, run with the --swtpc option: 
~/exor-1.0$ ./exor --swtpc
Load facts file 'facts'
'swtbug.bin' loaded.
'flex.dsk' opened for drive 0 (tracks=80 sectors=72)
Hit Ctrl-C for simulator command line.  Starting simulation...
FLEX 2.0
DATE (MM,DD,YY)? 02,07,11
+++
 About exbug.bin and swtbug.binThese memory images must each be exactly 64K bytes.  They contain the
initial memory image to be used by the simulator.  I saved the images right
at the point where the disk boot function is called so that EXORsim can
immediately boot the DOS instead of going into the monitor. swtbug.bin contains SWTBUG at
$E000 - $E3FF, but patched to boot the floppy to $A100 for FLEX2 instead of
$2400 for miniFlex. exbug.bin contains EXBUG at $F000 - $FBFF and the diskette controller at
$E800 - $EBFF. About diskette imagesEXORsim supports two MDOS disk image formats: 
Single sided: 2002 128-bit sectors, image size is 256,256 bytes (77 tracks of 26 sectors)Double sided: 4004 128-bit sectors, image size is 512,512 bytes (154 tracks of 26 sectors) EXORsim supports these eight FLEX image formats: 
35 tracks of 10 sectors, image size is 89,600 bytes40 tracks of 10 sectors, image size is 102,400 bytes35 tracks of 20 sectors, image size is 179,200 bytes40 tracks of 20 sectors, image size is 204,800 bytes80 tracks of 18 sectors, image size is 368,640 bytes80 tracks of 20 sectors, image size is 409,600 bytes80 tracks of 36 sectors, image size is 737,280 bytes80 tracks of 72 sectors, image size is 1,474,560 bytes MonitorTo enter the debug monitor, hit Ctrl-C.  The 128 instruction trace buffer
will be displayed and then the monitor prompt is presented. 
~/exor-1.0$ ./exor
Load facts file 'facts'
'exbug.bin' loaded.
'mdos.dsk' opened for drive 0 (single sided)
Hit Ctrl-C for simulator command line.  Starting simulation...
Floppy error: attempt to access non-existent disk 1
MDOS 03.00
=Interrupt!
- - - - - -
     610433 A=83 B=00 X=06A7 SP=E7EB ------          1B1E: EE 02    LDX 02,X  EA=06A9 D=0953 
     610434 A=83 B=00 X=0953 SP=E7EB ------          1B20: AD 0C    JSR 0C,X  EA=095F        
     610435 A=83 B=00 X=0953 SP=E7E9 ------          095F: 30       TSX                      
     610436 A=83 B=00 X=E7EA SP=E7E9 ------          0960: EE 00    LDX 00,X  EA=E7EA D=1B22 
     610437 A=83 B=00 X=1B22 SP=E7E9 ------          0962: EE 00    LDX 00,X  EA=1B22 D=1BE5 
     610438 A=83 B=00 X=1BE5 SP=E7E9 ------          0964: EE 00    LDX 00,X  EA=1BE5 D=0120 
     610439 A=83 B=00 X=0120 SP=E7E9 ------          0966: A6 01    LDA 01,X  EA=0121 D=83   
     610440 A=83 B=00 X=0120 SP=E7E9 --N---          0968: 2A 0B    BPL 0975  EA=0975        
     610441 A=83 B=00 X=0120 SP=E7E9 --N---          096A: 7C FF 53 INC FF53  EA=FF53(AECHO) 
     610442 A=83 B=00 X=0120 SP=E7E9 ------          096D: BD F0 15 JSR F015  EA=F015(INCHV) 
     610443 A=83 B=00 X=0120 SP=E7E7 ------ INCHV    F015: 7E FA A0 JMP FAA0  EA=FAA0(INCH)  Input char with echo (strip bit 7)
     610444 A=83 B=00 X=0120 SP=E7E7 ------ INCH     FAA0: 8D E9    BSR FA8B  EA=FA8B(INBYTE) Input character
     610445 ---- Subroutine at FA8B processed by simulator ---- RTS executed ---
>    610446 A=00 B=00 X=0120 SP=E7E7 ------          FAA2: 84 7F    ANDA #7F                 
Type 'help'
% 
 The '>' before the last line of the instruction trace indicates the
current PC value, $FAA2 in this case.  It's the next instruction to be
executed if you step or continue. You can hit Ctrl-C again to exit EXORsim. Monitor commandsThe follow commands are available: 
qQuit simulator
resetReset processor and continue simulating
abortAbort (send NMI) to processor
t onTurn tracing on
t offTurn tracing off
cContinue execution with current PC address
c hhhhContinue execution, but with new PC address hhhh
sExecute one instruction and return to monitor
s hhhhExecute one instruction at new PC address hhhh and return to
monitor
x hhhhCall subroute at hhhh and return to monitor when it
returns
bClear breakpoint
b hhhhSet breakpoint at address hhhh
rShow registers
r reg hhhhSet register reg to hhhh
caps onForce conversion to uppercase when simulation is running
caps offAllow lower case letters to reach simulation
d hhhh [nnnn]Hex dump beginning at hhhh of size nnnn
m hhhhModify memory beginning at hhhh
a hhhhAssemble beginning at hhhh
u hhhhDisassemble beginning at hhhh
uDisassemble next 20 instructions
clrClear symbol table
syShow symbol table
p hhhh nnnn [ssss]"Punch" (to paper tape) memory image in S19 format starting at
hhhh, size nnnn.  Put starting execution address ssss in S9 record.
lLoad (from paper tape) S19 formatted image into memory.
saveSave all 64K of memory in file called "dump"
save fileSave 64K of memory in file
save file start sizeSave memory block in
file
readRead file "dump" into memory
read fileRead file into memory starting at 0
read file startRead file into memory starting
at start
poll onTurn ACIA (serial port) polling on.  This means that when the
program reads the ACIA status register, the simulator will check for
keyboard input and sleep for a few milliseconds.
poll offTurn ACIA (serial port) polling off.  This means that when
the program reads the ACIA status register, the simulator will immediately
indicate that input is available.  When the program reads the data register,
the simulator executes a blocking Linux read to get the character.  In this
way, less trace output is generated and less CPU time is used.  However,
some programs read from the ACIA data register even when no input is
expected, so the simulation can sometimes appear to be stuck.   The above commands can be modified with redirection operators: Append >file to redirect output to file Append >>file to append output to file
 Append <file to redirect input from file
 ExamplesHere is an example monitor session where we type in a program from the
Motorola User's Group Library- no. 72 by Don L. Jackson, which computes
integer square root: 
~/exor-1.0$ ./exor --mon
Load facts file 'facts'
'exbug.bin' loaded.
'mdos.dsk' opened for drive 0 (single sided)
Hit Ctrl-C for simulator command line.  Starting simulation...
>         0 A=00 B=00 X=0000 SP=FF8A ------ OSLOAD   E800: 8E FF 8A LDS #$FF8A                Load OS
Type 'help'
% a 0		Assemble
0000:  NAM ISQRT
0000: *********************************************************
0000: * THIS SUBROUTINE CALCULATES THE INTEGER
0000: * SQUARE ROOT OF ANY POSITIVE NUMBER UP
0000: * TO 255 DECIMAL.  ENTER WITH NUMBER IN
0000: * ACCUMULATOR A, RESULT WILL BE RETURNED
0000: * IN ACCUMULATOR A.  B AND CC REGISTERS
0000: * ARE AFFECTED.  PROGRAM IS RELOCATABLE.
0000: *
0000: * PROGRAMMED BY DON L. JACKSON 11/27/76
0000: ***************************************************************
0000:  SPC 1
0000:  ORG $2100	Notice that ORG changes address
2100: ISQRT LDA B #$FF
2102: ISQRT2 ADD B #2
2104:  SBA
2105:  BCC ISQRT2
2107:  TBA
2108:  LSR A
2109:  RTS
210a:  SPC 1
210a:  END ISQRT
210a: 
% u 2100	Unassemble
2100: C6 FF               LDB #$FF
2102: CB 02               ADDB #$02
2104: 10                  SBA
2105: 24 FB               BCC $2102
2107: 17                  TBA
2108: 44                  LSRA
2109: 39                  RTS
210A: 00                  ???
210B: 00                  ???
210C: 00                  ???
210D: 00                  ???
210E: 00                  ???
210F: 00                  ???
2110: 00                  ???
2111: 00                  ???
2112: 00                  ???
2113: 00                  ???
2114: 00                  ???
2115: 00                  ???
2116: 00                  ???
2117: 00                  ???
2118: 00                  ???
% sy		Show symbol table
2102 ISQRT2
2100 ISQRT
% r a 19	Set register A to decimal 25
% t on		Enable tracing
% x 2100	Call subroutine
          0 A=19 B=00 X=0000 SP=FF8A ------ ISQRT    2100: C6 FF    LDB #FF   EA=2101 D=FF   
          1 A=19 B=FF X=0000 SP=FF8A --N--- ISQRT2   2102: CB 02    ADDB #02  EA=2103 D=02   
          2 A=19 B=01 X=0000 SP=FF8A H----C          2104: 10       SBA                      
          3 A=18 B=01 X=0000 SP=FF8A H-----          2105: 24 FB    BCC 2102  EA=2102(ISQRT2) 
          4 A=18 B=01 X=0000 SP=FF8A H----- ISQRT2   2102: CB 02    ADDB #02  EA=2103 D=02   
          5 A=18 B=03 X=0000 SP=FF8A ------          2104: 10       SBA                      
          6 A=15 B=03 X=0000 SP=FF8A ------          2105: 24 FB    BCC 2102  EA=2102(ISQRT2) 
          7 A=15 B=03 X=0000 SP=FF8A ------ ISQRT2   2102: CB 02    ADDB #02  EA=2103 D=02   
          8 A=15 B=05 X=0000 SP=FF8A ------          2104: 10       SBA                      
          9 A=10 B=05 X=0000 SP=FF8A ------          2105: 24 FB    BCC 2102  EA=2102(ISQRT2) 
         10 A=10 B=05 X=0000 SP=FF8A ------ ISQRT2   2102: CB 02    ADDB #02  EA=2103 D=02   
         11 A=10 B=07 X=0000 SP=FF8A ------          2104: 10       SBA                      
         12 A=09 B=07 X=0000 SP=FF8A ------          2105: 24 FB    BCC 2102  EA=2102(ISQRT2) 
         13 A=09 B=07 X=0000 SP=FF8A ------ ISQRT2   2102: CB 02    ADDB #02  EA=2103 D=02   
         14 A=09 B=09 X=0000 SP=FF8A ------          2104: 10       SBA                      
         15 A=00 B=09 X=0000 SP=FF8A ---Z--          2105: 24 FB    BCC 2102  EA=2102(ISQRT2) 
         16 A=00 B=09 X=0000 SP=FF8A ---Z-- ISQRT2   2102: CB 02    ADDB #02  EA=2103 D=02   
         17 A=00 B=0B X=0000 SP=FF8A ------          2104: 10       SBA                      
         18 A=F5 B=0B X=0000 SP=FF8A --N--C          2105: 24 FB    BCC 2102  EA=2102(ISQRT2) 
         19 A=F5 B=0B X=0000 SP=FF8A --N--C          2107: 17       TBA                      
         20 A=0B B=0B X=0000 SP=FF8A -----C          2108: 44       LSRA                     
         21 A=05 B=0B X=0000 SP=FF8A ----VC          2109: 39       RTS                      
>        22 A=05 B=0B X=0000 SP=FF8A ----VC          210A: 00       Huh?                     
Type 'help'
% r		Show answer in A...
PC=210A A=05 B=0B X=0000 SP=FF8A CC=C3
% 
 |