MAC-16 Emulator

1. An emulator for the Lockheed Electronics Company minicomputer

My first java program is an attempt to relive the days I spent maintaining a Lockheed Electronics Company minicomputer installation in an old electricity generating station. I had a little bit to do with this machine around 1978. There was two of them in a failover configuration with the standby machine available for program and data development.

As of March 2021, the documentation that I used, is currently available on archive.org, and the main document reference used for my code here is Lockheed MAC-16 Computer Reference. Unfortunately some errors exist in this Jan70 version and there have been several versions of this reference, released over the period from 1968 to 1971.

Some Errata for Jan70

page 3-5
(better explanation)
ABA absolute value
The absolute value of the twos complement of the sign
bit only (all other bits zero) sets the V indicator.
Accumulator contents are not altered.
(missing a zero)
ONA should be 018x not  18x
page 3-8
(codes swapped)
JIX should be 03CN not 047x
JMA should be 047x not 03CN

2. Running the code

A prerequesite for running this emulator is having java installed.

  1. Once the tarball is extracted, change working directory to MAC-16/bin.
  2. type java mac16/Monitor

3. Emulator Commands

One side effect of sticking to standard java is that console input is line based and the designed I/O for the teletype on this computer is character based. To get around this, while running the emulator, after a line of characters is inputted, I drop the terminating enter code, and enter needs then to be sent on its own line. This means twice the number of enter has to be typed.

In the main program of the machine monitor there are several commands.

4. Example

$ java mac16/Monitor
MAC-16-emulator Copyright (C) 2021 Alan Electron
This program comes with ABSOLUTELY NO WARRANTY
(for details type 'w')
This is free software, and you are welcome to redistribute it
under certain conditions
(for details type 'c')
* m 0100
0100 0000 d304
0100 D304 
0101 0000 6305
0101 6305 
0102 0000 n
0103 0000 n
0104 0000 5555
0104 5555 
0105 0000 

* o 0100
O 0100 
0100 D304         LDA   P  104 
0101 6305         STA   P  105 
0102 0000         HLT          
0103 0000         HLT          
0104 5555         JMP  X   155 
0105 0000         HLT          
0106 0000         HLT          
0107 0000         HLT          
0108 0000         HLT          
0109 0000         HLT          
010A 0000         HLT          
010B 0000         HLT          
010C 0000         HLT          
010D 0000         HLT          
010E 0000         HLT          
010F 0000         HLT          
q

* g0100
Halt instruction

* o 0100
O 0100 
0100 D304         LDA   P  104 
0101 6305         STA   P  105 
0102 0000         HLT          
0103 0000         HLT          
0104 5555         JMP  X   155 
0105 5555         JMP  X   155 
0106 0000         HLT          
0107 0000         HLT          
0108 0000         HLT          
0109 0000         HLT          
010A 0000         HLT          
010B 0000         HLT          
010C 0000         HLT          
010D 0000         HLT          
010E 0000         HLT          
010F 0000         HLT          
q

* q

$ 

5. LEAP Interpreter

I have discovered the assembler engine is some sort of weird interpreter object code. After some single stepping through the engine routines, I have arbitarily allocated some operation code mnemonics and added them to the DEVSYS listing. Those of us that had a bit to do with the Motorola MC6800 or M6809 processors might recognise some of my choices for the mnemonics.

I still haven't managed to get the DEVSYS coresident development system to function properly. The editor is difficult to enter text source, and the LEAP assembler is unable to function correctly. I have attempted to debug the assembler but I am still unsure if my emulator, or the DEVSYS program is at fault.

Here are my mnemonics I have determined so far LEAP Interpreter Programming Manual.html

UsageAddresses
LEAP interpreter engine0249-0294
Interpreter routines0295-03E2
Interpreter variables03E3-0472
Interpreter read write memory0473-04FB
LEAP code04FC-0D02
Buffer for assembler source code0D03-0E3F
Support routines0F00-0F5B
Mnemonic lookup table12C5-13FF
Text Editor1400-16FF

6. Future Improvements

There is now a build.xml included so the ant application could be used to produce the jar file.


Copyright © 2023 Alan Electron
This file, index.html is part of MAC-16-emulator.