mirror of
https://github.com/pkimpel/retro-220.git
synced 2026-01-11 23:52:46 +00:00
Commit Michael Mahon's SNAP-1E assembler for the 220 to the project repository. Included by permission of Michael Mahon. See http://www.michaeljmahon.com/ for more information.
This commit is contained in:
parent
936aadf6ee
commit
efa7fc3902
87
software/SNAP-Assembler/README.txt
Normal file
87
software/SNAP-Assembler/README.txt
Normal file
@ -0,0 +1,87 @@
|
||||
Index of folder retro-220/software/SNAP-Assembler:
|
||||
Source and object files for Michael Mahon's SNAP-1E assembler for the
|
||||
Burroughs 220, written while he was a student at the California
|
||||
Institute of Technology in the mid-1960s.
|
||||
|
||||
SNAP has a columnar assembly notation and was written for the paper-tape
|
||||
and magnetic-tape 220 configuration at CalTech -- no punched cards. It
|
||||
was also written for printed output to the Burroughs Whippet printer, an
|
||||
early, high-speed electrostatic printer originally developed for the
|
||||
U.S. military.
|
||||
|
||||
Michael has generously allowed me to offer his assembler as part of the
|
||||
retro-220 project. See his web site at http://www.michaeljmahon.com/ for
|
||||
the original assembler files and documentation, information on his 220
|
||||
emulator written for the Apple //e (!), and a number of documents on the
|
||||
220.
|
||||
|
||||
The paper-tape image files on Michael's web site are encoded for use by
|
||||
his emulator and are incompatible with the retro-220 emulator's paper-
|
||||
tape implementation. See /software/tools/Mahon-PT-Xlate.wsf in the
|
||||
retro-220 project repository for a Windows VBScript utility that will
|
||||
translate from his paper-tape format to the one used by retro-220.
|
||||
|
||||
The object tape for the assembler is designed to be loaded on paper-tape
|
||||
reader 0 (i.e., 10). Source code, however, is read from paper-tape
|
||||
reader 1. The assembler halts after loading to allow you to load the
|
||||
source tape and change the reader's unit designate.
|
||||
|
||||
Assembled object code is written to paper-tape punch 1. The assembly
|
||||
listing is output to the SPO, which at CalTech was the high-speed
|
||||
Whippet printer. Miscellaneous assembly messages are output to teletype
|
||||
printer 0 (10), which in retro-220 can be configured to be the same
|
||||
device as the SPO. Magnetic tape unit 1 is used as a scratch tape. It
|
||||
must have an "edited" (i.e., erased and not formatted) tape mounted.
|
||||
|
||||
Unless otherwise specified, all files are in standard Windows text
|
||||
format, with carriage-return/line-feed delimiters.
|
||||
|
||||
|
||||
SNAP1E.SRC-retro.pt
|
||||
Source code for the SNAP-1E assembler, written in itself, using the
|
||||
paper-tape image format required by the retro-220 emulator. This is
|
||||
not a particularly readable format, so see the listing below for a
|
||||
better presentation.
|
||||
|
||||
SNAP1E.OBJ-retro-pt.
|
||||
Loadable object code for the SNAP-1E assembler, in the paper-tape
|
||||
image format required by the retro-220 emulator. See the notes above
|
||||
and the assembler manual below for more information on running the
|
||||
assembler.
|
||||
|
||||
SNAP1E.Listing-retro.txt
|
||||
Assembly listing of the SNAP-1E assembler, as generated from the
|
||||
retro-220 emulator. Because of the I/O device configuration for the
|
||||
system at CalTech, it used a few different internal character codes
|
||||
than those for a standard 220. Thus, the listing needs to be viewed
|
||||
with the following substitutions in mind. Fortunately, except for
|
||||
"+", these were only used in comments.
|
||||
|
||||
CalTech retro-220
|
||||
= #
|
||||
+ $
|
||||
( ¤ (U0164, the "lozenge")
|
||||
) ¤ (a quirk of Cardatron code translation)
|
||||
|
||||
SNAP1E.Manual.pdf
|
||||
Manual for the assembler, OCR-ed by Michael from his original IBM
|
||||
1403 line-printer listing.
|
||||
|
||||
SIEVE.SRC-retro.pt
|
||||
Assembler source for a prime-number sieve written in SNAP-1E.
|
||||
|
||||
SIEVE.OBJ-retro.pt
|
||||
Loadable object code for the SIEVE program, in the paper-tape image
|
||||
format required by the retro-220 emulator. Load the object tape on
|
||||
paper-tape reader 0. This program writes its output to magnetic tape
|
||||
unit 1 in 100-word blocks. The tape unit must be loaded with an
|
||||
edited, unformatted tape.
|
||||
|
||||
SIEVE.Listing-retro.txt
|
||||
Assembler listing of the SIEVE program.
|
||||
|
||||
Paul Kimpel
|
||||
January 2018
|
||||
|
||||
|
||||
|
||||
402
software/SNAP-Assembler/SIEVE.Listing-retro.txt
Normal file
402
software/SNAP-Assembler/SIEVE.Listing-retro.txt
Normal file
@ -0,0 +1,402 @@
|
||||
|
||||
S N A P VER. 1E 5/10/64
|
||||
|
||||
|
||||
|
||||
SWITCH OPTIONS MUST BE SET DURING O-O HALT.
|
||||
|
||||
SW 5 ON IF INPUT IS ON MAG-TAPE
|
||||
SW 6 ON SUPPRESSES PUNCHING
|
||||
SW 7 ON TO INSERT VALUE IN AC FOR UNDEFINED ADRES
|
||||
SW 8 ON SUPPRESSES ERROR TYPING
|
||||
SW 9 ON SUPPRESSES DICTIONARY PRINTING
|
||||
SW 0 ON INDICATES PAPER-TAPE-ONLY MODE
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
PASS 1
|
||||
|
||||
|
||||
|
||||
PASS 2
|
||||
|
||||
DICTIONARY
|
||||
|
||||
LABEL VALUE LABEL VALUE LABEL VALUE LABEL VALUE
|
||||
|
||||
.BUN. 0027 .WRIT 0015 ADDON 0008 BUFAD 0041
|
||||
BUFER 0042 CLOSE 0036 HITAB 0028 NUM 0029
|
||||
NXNUM 0018 QUIT 0025 START 0000 STOP 0021
|
||||
TABLE 0142 TABLN 0030 TEST 0001 WRITE 0031
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
ADRES INSTRUCTION LABEL VAR OP VARIABLE FIELD
|
||||
|
||||
* PRIME NUMBER SIEVE ¤WRITES MAG-TAPE¤
|
||||
* ¤MJM - 03/30/64¤
|
||||
|
||||
|
||||
0000 6 0000040000 LOAD 0
|
||||
0000 0 0004450000 START CLB
|
||||
0001 0 0000100029 TEST CAD NUM GET NEXT NUMBER
|
||||
0002 0 0001480010 SRT 10
|
||||
0003 1 0000150142 - DIV TABLE DIVIDE BY PRIME.
|
||||
0004 0 0000370018 BFR NXNUM NUM ISN T PRIME.
|
||||
0005 1 0000180142 - CFA TABLE IS QUOT LT DIVISOR
|
||||
0006 0 0001340008 BCL ADDON -YES, IT S PRIME.
|
||||
0007 0 0001200001 1IBB TEST -NO, TRY NXT DIVISOR.
|
||||
0008 0 0000100030 ADDON CAD TABLN ¤CHANGED BY QUIT¤
|
||||
0009 0 0410180028 0410CFA HITAB
|
||||
0010 0 0000350025 BCE QUIT TABLE FULL.
|
||||
0011 0 0001260030 1IFL TABLN ADD PRIME TO TABLE.
|
||||
0012 0 0000420030 LDB TABLN
|
||||
0013 0 0000100029 CAD NUM
|
||||
0014 1 0000400142 - STA TABLE
|
||||
0015 0 0000100029 .WRIT CAD NUM
|
||||
0016 0 0000440031 CALL WRITE
|
||||
0018 0 0002260029 NXNUM 2IFL NUM NEXT ODD NUMBER
|
||||
0019 0 0000310021 BOF STOP
|
||||
0020 0 0000300000 BUN START GO AGAIN.
|
||||
|
||||
0021 0 0000440031 STOP STP WRITE CLOSE OUT
|
||||
0022 0 0000300036 BUN CLOSE BUFFER
|
||||
0023 0 0757007250 757HLT 7250 AND O-K STOP
|
||||
0024 0 0000300023 BUN *-1 DEAD.
|
||||
|
||||
0025 0 0000100027 QUIT CAD .BUN. SET
|
||||
0026 0 0000400008 STA ADDON SWITCH TO
|
||||
0027 0 0000300015 .BUN. BUN .WRIT BYPASS ADDON.
|
||||
|
||||
0028 0 0000004857 HITAB HLT 4999-TABLE ¤MAX LENGTH¤
|
||||
0029 0 0000000007 NUM DEC 7 NUMBER TO BE TESTED
|
||||
0030 0 0000000001 TABLN DEC 1 TABLE LENGTH - 1
|
||||
|
||||
* WRITE SUBROUTINE FOR SIEVE
|
||||
|
||||
0031 0 0000300000 WRITE BUN ** RETURN ADDRESS
|
||||
0032 0 0000420041 LDB BUFAD
|
||||
0033 1 0000400042 - STA BUFER STORE PRIME IN BUFER
|
||||
0034 0 0001260041 1IFL BUFAD AND KEEP COUNT.
|
||||
0035 0 9901200031 9901IBB WRITE BRANCH IF NOT FULL.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
ADRES INSTRUCTION LABEL VAR OP VARIABLE FIELD
|
||||
|
||||
0036 0 1100540042 CLOSE 1100MIW BUFER WRITE 100 PRIMES.
|
||||
0037 0 0000460041 CLL BUFAD EMPTY BUFER.
|
||||
0038 0 0000380031 0 BCS WRITE SW 0 ON TO SKIP HALT
|
||||
0039 0 6996006996 6996HLT 6996 EVERY 100 PRIMES.
|
||||
0040 0 0000300031 BUN WRITE RETURN...
|
||||
|
||||
0041 0 0000000003 BUFAD DEC 3
|
||||
0042 0 0000000002 BUFER DEC 2 INITIAL PRIMES
|
||||
0043 0 0000000003 DEC 3
|
||||
0044 0 0000000005 DEC 5
|
||||
0045 6 0000040142 BSS 97
|
||||
|
||||
|
||||
|
||||
0142 0 0000000003 TABLE DEC 3 PRIME NUMBER
|
||||
0143 0 0000000005 DEC 5 TABLE.
|
||||
|
||||
0000 6 0000300000 TCD START TRANSFER CONTROL.
|
||||
END
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
END OF ASSEMBLY
|
||||
|
||||
|
||||
BIN
software/SNAP-Assembler/SIEVE.OBJ-retro.pt
Normal file
BIN
software/SNAP-Assembler/SIEVE.OBJ-retro.pt
Normal file
Binary file not shown.
BIN
software/SNAP-Assembler/SIEVE.SRC-retro.pt
Normal file
BIN
software/SNAP-Assembler/SIEVE.SRC-retro.pt
Normal file
Binary file not shown.
2712
software/SNAP-Assembler/SNAP1E.Listing-retro.txt
Normal file
2712
software/SNAP-Assembler/SNAP1E.Listing-retro.txt
Normal file
File diff suppressed because it is too large
Load Diff
BIN
software/SNAP-Assembler/SNAP1E.Manual.pdf
Normal file
BIN
software/SNAP-Assembler/SNAP1E.Manual.pdf
Normal file
Binary file not shown.
1460
software/SNAP-Assembler/SNAP1E.OBJ-retro.pt
Normal file
1460
software/SNAP-Assembler/SNAP1E.OBJ-retro.pt
Normal file
File diff suppressed because it is too large
Load Diff
BIN
software/SNAP-Assembler/SNAP1E.SRC-retro.pt
Normal file
BIN
software/SNAP-Assembler/SNAP1E.SRC-retro.pt
Normal file
Binary file not shown.
169
software/tools/Mahon-PT-Xlate.wsf
Normal file
169
software/tools/Mahon-PT-Xlate.wsf
Normal file
@ -0,0 +1,169 @@
|
||||
<?XML version="1.0"?>
|
||||
<package>
|
||||
<job id="Mahon-PT-Xlate">
|
||||
<reference object="Scripting.FileSystemObject" />
|
||||
<script language="VBScript">
|
||||
<![CDATA[
|
||||
|
||||
Option Explicit
|
||||
'-----------------------------------------------------------------------
|
||||
' retro-220 Mahon-PT-Xlate.wsf
|
||||
' Copyright (c) 2017, Paul Kimpel,
|
||||
' Licensed under the MIT License, see
|
||||
' http://www.opensource.org/licenses/mit-license.php
|
||||
'-----------------------------------------------------------------------
|
||||
' VBScript to reformat Michael Mahon's Apple II assembler-encoded 220 paper
|
||||
' tape files to the paper-tape format used by the retro-220 emulator.
|
||||
' Uses Scripting Runtime FileSystemObject.
|
||||
' Parameters:
|
||||
' Name of assembler-encoded file (required).
|
||||
' Name of resulting retro-220 file (optional - by default will have the
|
||||
' name of the assembler-encoded file with "-retro.pt" replacing the
|
||||
' orginal file name extension.
|
||||
'-----------------------------------------------------------------------
|
||||
' Modification Log.
|
||||
' 2017-11-18 P.Kimpel
|
||||
' Original version, cloned from retro-b5500 B5500-MemDumpToTapeDump.wsf.
|
||||
'-----------------------------------------------------------------------
|
||||
|
||||
Const defaultSuffix = "-retro.pt"
|
||||
|
||||
Dim args
|
||||
Dim asmFile
|
||||
Dim asmName
|
||||
Dim fso
|
||||
Dim ptFile
|
||||
Dim ptName
|
||||
Dim xlate220
|
||||
|
||||
'---------------------------------------
|
||||
Function OutputWord(byVal word)
|
||||
'Outputs one one word of paper-tape data, converting sign-2 words to ANSI
|
||||
'code as necessary
|
||||
Dim char
|
||||
Dim code
|
||||
Dim sign
|
||||
Dim x
|
||||
|
||||
sign = Mid(word, 2, 1)
|
||||
If sign <> "2" Then
|
||||
ptFile.WriteLine Mid(word, 2, 11)
|
||||
Else
|
||||
ptFile.Write sign
|
||||
For x = 3 To 11 Step 2
|
||||
char = Mid(word, x, 2)
|
||||
If Not IsNumeric(char) Then
|
||||
ptFile.Write "!"
|
||||
Else
|
||||
code = CInt("1" & char) Mod 100 '-- avoid octal conversion if leading zero
|
||||
ptFile.Write xlate220(code)
|
||||
End If
|
||||
Next
|
||||
|
||||
ptFile.WriteLine
|
||||
End If
|
||||
End Function
|
||||
|
||||
'---------------------------------------
|
||||
Sub ReformatPaperTape
|
||||
'Creates the retro-220 paper-tape file from the Mahon assembler-encoded file.
|
||||
Dim code
|
||||
Dim count
|
||||
Dim line
|
||||
Dim word
|
||||
Dim x
|
||||
|
||||
count = 0
|
||||
word = ""
|
||||
|
||||
Do While Not asmFile.AtEndOfStream
|
||||
line = asmFile.ReadLine
|
||||
If Len(line) > 8 Then
|
||||
For x = 9 To 20 Step 3
|
||||
code = Mid(line, x, 2)
|
||||
If code = " " Then
|
||||
Exit For
|
||||
Else
|
||||
If count < 6 Then
|
||||
count = count+1
|
||||
word = word & code
|
||||
Else
|
||||
OutputWord word
|
||||
count = 1
|
||||
word = code
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
Loop
|
||||
|
||||
If count > 0 Then
|
||||
Do While count < 6
|
||||
word = "00" & word
|
||||
count = count+1
|
||||
Loop
|
||||
|
||||
OutputWord word
|
||||
End If
|
||||
End Sub
|
||||
|
||||
'---------------------------------------------------------------
|
||||
|
||||
Set fso = WScript.CreateObject("Scripting.FileSystemObject")
|
||||
|
||||
'-- Translate internal B220 code to ANSI.
|
||||
' Note that ANSI new-line sequences are used for end-of-word characters,
|
||||
' so B220 carriage-return (16) translates to "|". To avoid space-expansion
|
||||
' of tabs (26), they are translated to "~". The 02 "blank" code is "_".
|
||||
' Form-feed (15) translates to "^".
|
||||
xlate220 = Array( _
|
||||
" ", "?", "_", ".", "¤", ")", "?", "?", "?", "?", _
|
||||
"&", "?", "?", "$", "*", "^", "|", "?", "?", "?", _
|
||||
"-", "/", "?", ",", "%", "?", "~", "?", "?", "?", _
|
||||
"?", "?", "?", "#", "@", "\", "?", "?", "?", "?", _
|
||||
"?", "A", "B", "C", "D", "E", "F", "G", "H", "I", _
|
||||
"?", "J", "K", "L", "M", "N", "O", "P", "Q", "R", _
|
||||
"?", "?", "S", "T", "U", "V", "W", "X", "Y", "Z", _
|
||||
"?", "?", "?", "?", "?", "?", "?", "?", "?", "?", _
|
||||
"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", _
|
||||
"?", "?", "?", "?", "?", "?", "?", "?", "?", "?")
|
||||
|
||||
Set args = WScript.Arguments
|
||||
If args.Count < 1 Then
|
||||
MsgBox "Must supply at least the name of the assembler-encoded file."
|
||||
WScript.Quit 9
|
||||
Else
|
||||
asmName = Trim(args.Item(0))
|
||||
If args.Count > 1 Then
|
||||
ptName = Trim(args.Item(1))
|
||||
Else
|
||||
ptName = fso.BuildPath(fso.GetParentFolderName(asmName), fso.GetBaseName(asmName)) & defaultSuffix
|
||||
End If
|
||||
End If
|
||||
|
||||
Set args = Nothing
|
||||
|
||||
'-- Main Line --
|
||||
If Not fso.FileExists(asmName) Then
|
||||
MsgBox "Assembler-encoded file does not exist: " & vbCrLf & asmName
|
||||
Else
|
||||
Set asmFile = fso.OpenTextFile(asmName, ForReading, False)
|
||||
Set ptFile = fso.CreateTextFile(ptName, True, True)
|
||||
|
||||
ReformatPaperTape
|
||||
|
||||
ptFile.Close
|
||||
Set ptFile = Nothing
|
||||
asmFile.Close
|
||||
Set asmFile = Nothing
|
||||
MsgBox "retro-220 paper tape file created: " & vbCrLf & ptName
|
||||
End If
|
||||
|
||||
Set fso = Nothing
|
||||
|
||||
WScript.Quit 0
|
||||
|
||||
]]>
|
||||
</script>
|
||||
</job>
|
||||
</package>
|
||||
@ -19,15 +19,22 @@ BAC-XScript-Reformatter.wsf
|
||||
assembly listing transcriptions and reformat them into card decks
|
||||
for use by BAC-Assembler.html
|
||||
|
||||
BAC-Assembler.html
|
||||
GEN-Assembler.html
|
||||
HTML/Javascript assembler for the assembly language dialect used
|
||||
with the BALGOL Generator utility.
|
||||
|
||||
GEN-XScript-Reformatter.wsf
|
||||
Windows VBScript utility to extract source code from the Generator
|
||||
assembly listing transcription and reformat it into a card deck for
|
||||
use by GEN-Assembler.html
|
||||
use by GEN-Assembler.html.
|
||||
|
||||
Mahon-PT-Xlate.wsf
|
||||
Windows VBScript utility to translate the original paper tape files
|
||||
for Michael Mahon's SNAP-1E assembler for the 220 to the paper tape
|
||||
image format required by the retro-220 emulator.
|
||||
See /software/SNAP-Assembler for more on that assembler.
|
||||
|
||||
Paul Kimpel
|
||||
December 2017
|
||||
January 2018
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user