5 ms·
"However, Alto microcode is pretty crazy, so I'm not going to try a microcode Mandelbrot." I don't understand that logic, coming from somebody who has a restor
by Someone 9y ago
"However, Alto microcode is pretty crazy, so I'm not going to try a microcode Mandelbrot."
I don't understand that logic, coming from somebody who has a restored Xerox Alto and wrote a Mandelbrot generator in BCPL for it "to learn how to use the Alto's bitmapped display, not make the fastest Mandelbrot set".
I also expect this guy will get source code for the 'simple' things such as an OR instruction or a fixed-width multiplication instruction within a few weeks.
Edit: I’ve been browsing http://bitsavers.trailing-edge.com/pdf/xerox/alto/Alto_Hardware_Manual_Aug76.pdf http://bitsavers.trailing-edge.com/pdf/xerox/alto/Alto_Hardw....
There apparently are only 16 basic micro-instructions (”The ALU function field controls the SN74181 ALU. This device can do a total of 48 arithmetic and logical operations, most of which are relatively useless. The 4-bit field is mapped by a PROM into the 16 most useful functions”), and OR is one of them:
ALUF FIELD FUNCTION
0 BUS (A)
1 T (B)
2 BUS OR T* (A+B)
3 BUS AND T (AB)
4 BUS XOR T (A XOR B)
5 BUS + I* (A PLUS I)
6 BUS - I* (A MINUS I)
7 BUS + T (A PLUS B)
1OB BUS - T (A MINUS B)
11B BUS - T - 1 (A MINUS B MINUS I)
12B BUS + T + 1* (A PLUS B PLUS I)
13B BUS + SKIP* (A PLUS I)
14B BUS.T* (AND) (AB)
15B BUS AND NOT T (A & NOT B)
16B-17B UNDEFINED
So, following the best source I have, (that PDF) which states:
”For the most part, since the Alto is such a simple machine, writing Alto microcode is a straightforward exercise in rule-following”
that shouldn’t be too hard, provided that there is a free spot for writing the microcode instruction, or that you can find an instruction to give up in exchange for a simple OR.
Edit 2: that PDF also describes the way you do an OR, so that apparently was the way to go:
”To "or" together the contents of ACO and ACI; results ACO:
COM 1.1
AND 1,0
ADC 1,0
”
- kens 9y agoEven if I were crazy enough to write microcode, there's a problem that we don't have the microcode assembler MU.RUN. Maybe it will turn up on one of the PARC disks we're archiving...
- simcop2387 9y agoInteresting, I hope that the archives end up available to the public. It'd be really neat to build some kind of functional emulator like the visual 6502 to play around in. Do it on a block level for the CPU so you can examine the state as things happen.
- kens 9y agoFunny you should mention that, because the Living Computer Museum wrote a high-quality emulator (ContrAlto) for the Alto. It's super-accurate, even emulating the microcode and hardware, and runs at the speed of the live machine. It includes a debugging mode that lets you examine machine state and step through machine instructions and microcode. Source: https://github.com/livingcomputermuseum/ContrAlto https://github.com/livingcomputermuseum/ContrAlto ContrAlto was very helpful while getting the real Alto running, and I also use it for developing software such as the Mandelbrot. I wrote a guide to getting started with ContrAlto: http://www.righto.com/2016/10/simulating-xerox-alto-with-contralto.html http://www.righto.com/2016/10/simulating-xerox-alto-with-con...
- simcop2387 9y agoAwesome I'll check that out. I think I remember looking back when this started and found SALTO but it appears to be incomplete and buggy. ContrAlto looks interesting.
- edmccard 9y agoTheres a mu.run on (at least) one of the disks archived at the Computer History Musuem, listed at http://xeroxalto.computerhistory.org/_cd8_/alto/.index.html http://xeroxalto.computerhistory.org/_cd8_/alto/.index.html http://xeroxalto.computerhistory.org/_cd8_/alto/.mu.run!2.html http://xeroxalto.computerhistory.org/_cd8_/alto/.mu.run!2.ht... but I don't know if there's any way to transfer it from a disk image to an actual Alto disk?
- kens 9y agoThanks - I searched that archive for MU.RUN but somehow missed it. We got a gateway from the Living Computer Museum that lets us transfer files to the real Alto. So I guess I need another excuse for why I'm not writing microcode :-)
- qubex 9y agoPardon my ignorance, but does the Alto multi-task between user programs? If the answer to that question is affirmative, how does the machine cope with simultaneously running two programs that load different custom microcode? Does it load and unload and reload at every context switch? Or does it simply not multi-task?
- kens 9y agoThe Alto is a "personal computer" and only runs one program at a time. The operating system provides primitive task management (sort of like threads) so the operating system can for instance process network packets while a program is running, or a program can contain multiple tasks. Thus, a program can load the microcode it needs when it starts up and doesn't need to worry about conflicts. This task management is entirely orthogonal to the 16 tasks that are running at the microcode level to refresh the display and handle I/O devices.
- kens 9y agoThe microcode isn't quite as simple as you make it sound. Trust me, I've needed to understand a lot of the Alto's microcode to debug disk and other issues, and it's brain-twisting. There are the 16 basic ALU micro-instructions, but these are combined with 8 different bus sources and two sets of "special functions" to make fairly complex micro-instructions. The special functions are a bit crazy and also totally change meaning depending on which hardware task is running. Control flow in microcode is pretty wacky. Each micro-instruction contains the address of the next micro-instruction, so it's like a goto in every instruction with instructions randomly scattered through memory. Additionally, branches are done by the hardware setting bits in the address based on conditions, so you end up with basically a computed goto. Finally, branches happen the instruction after the condition. So even just following the control flow of microcode is hard. Another fun thing with microcode is that to read memory you write the address to the memory address register. Then you need to wait two microinstructions before you can read or write the memory value. If you want to take a look at the Alto's microcode: http://bitsavers.trailing-edge.com/pdf/xerox/alto/microcode/altoIIcode3.mu.txt http://bitsavers.trailing-edge.com/pdf/xerox/alto/microcode/...
- Someone 9y agoYes, I saw a bit of that, and did realize what you meant by pretty crazy. Rereading my last edit, I also notice that the smiley I had there got lost in editing. Apologies for that. If you do have the microcode for AND, and a RAM board to store custom microcode, creating an OR instruction shouldn't be insanely hard, though, even without an assembler (finding a spot to put it without losing another instruction may be impossible, though, and that could mean a fairly large rewrite of your OS and applications) Also, branch delay slots (https://en.wikipedia.org/wiki/Delay_slot#Branch_delay_slots https://en.wikipedia.org/wiki/Delay_slot#Branch_delay_slots) apparently predate RISC.
- pm215 9y agoWell, the microcode for AND is simple; it's this line G17: L_ ACDEST AND T, TASK, :SHIFT; ...the problem is that that's in the middle of the decode (there's a computed jump into this lot from the line labelled DIS1:). So you could change the AND insn to do OR instead, trivially (use "OR" here where the line says "AND"), but you probably wanted to keep AND. So you'd need to at least add enough of your own decode to be able to put the insn somewhere else. And as you say that looks like the real problem: http://users.rcn.com/crfriend/museum/doco/DG/Nova/base-instr.html http://users.rcn.com/crfriend/museum/doco/DG/Nova/base-instr... suggests that given 16 bit instructions and the format they've used there isn't much space left. The best you could do would be to steal some of the 'io instruction' space and have it operate on fixed accumulator registers the way MUL and DIV do. (The decode is remarkably confusing even knowing what it's supposed to be doing; there seems to be a lot of implicitly jumping to entries in decode tables based on bits of the instruction...)