323 points by Skyfall106 5 days ago | 178 comments | View on ycombinator
femto 5 days ago |
runjake 5 days ago |
There were even pre-made paper forms for writing code, like the IBM COBOL program sheets and similar for assembler.
Even now, if I’m working on a tough issue, I still print out code sections on paper and hash it out with a pencil.
david-gpu 5 days ago |
The first time was in my first job writing OpenGL ES 2.0 blending operations for the Imagination Technologies SGX 535, which was a remarkably advanced little GPU for its time. Alpha blending happened through special instructions in the fragment/pixel shader. We did have a compiler, but it didn't handle blending, for whatever reason.
Through testing I noticed that NVidia GPUs performed blending incorrectly, according to the specification, which was a big surprise. Only years later I figured out that the specification had some errors; I now would bet that NVidia was doing the correct thing.
The second time I had to assemble instructions by hand happened while working on a stripped down version of the Radeon 7xxx series that shipped on some mobile phones. I don't recall what the problem was, whether we were adding a feature or optimizing the microcode generated for a particular OpenGL operation, but it involved a rarely-used feature called user-defined clipping planes. We didn't have an assembler for that GPU; all microcode was assembled by hand.
The third time happened at NVidia, and I will be vague, as not enough time has passed for me to be comfortable going into any detail. I had an idea for how to provide hardware acceleration for persistent CUDA kernels, which eventually was marketed as Cluster Launch Control (CLC). In order to quantify the benefit of adding some hardware, when it was possible to approximate that functionality in software, I needed to test the most efficient software implementation that was possible, and the compiler wasn't quite giving the assembly I wanted, so I had to manually patch some instructions post-compilation. Why did I not use the assembler that was available? I couldn't, because the assembly language did not provide a way to express the exact feature I had to patch.
kamma4434 5 days ago |
I remember that was a book that went on to say that you should learn machine code (that is, raw opcodes), not assembly, to program the c-64. Not sure I would agree, but it’s definitely feasible.
The only thing that is strange in the Woz story is that you would usually start by creating a dirt-poor monitor/assembler so that you would have a sane environment to do further development in. That was the approach manuals from the era suggested for new hardware (eg Rodnay Zack’s)
mrandish 5 days ago |
However, there was an interesting period of a few years where assembler tools were either unavailable or fairly expensive, so it was common to use the computer's BASIC to write an assembly language monitor program. Such program listings were pretty common in early hobbyist 'zines. It was also pretty common to use BASIC to POKE in a quick bootstrap program to load a value in a register and jump to an address, which I could usually do from memory. After 40 years I still remember the 6809 RTS was $39 and NOP was $12, two very handy instructions to POKE a quick mod into a program.
II2II 5 days ago |
The handwritten interpreter is fairly common knowledge since Woz has told that story many times, but I don't recall any accounts of how he bridged the gap from paper to silicon. All of the discussion about the machine language monitor doesn't really address the question. At best, it moves the question from programming a ROM for BASIC to programming a ROM with the machine language monitor. Even with the monitor, additional hardware would be required to program a ROM. At the very least, a latch would be required to hold the address and data. Of course, it is possible that he did it without the computer (using a rig that let him "toggle" the pins). It is also possible that he used another computer to program the ROM, but, as he said, he didn't have the money to program BASIC on a computer so why would that be different for a ROM?
asdefghyk 5 days ago |
First for new hardware would be a monitor program. Either write one, or port one from other hardware. A monitor program allows the inspection and edit of memory data and also to run programs in such memory. The monitor program often placed in ROM for convenance. A 6502 cross assembler, could be used to avoid the need for hand assembly the program to 6502 machine code.
Probably where WOZMON came from.
Then using WOZMON start writing a VERY simple basic interpreter.
Maybe the monitor program was borrowed from other hardware that used a 6502 ( would need slight mods for the Apple 1 ) NOTE This is just a possibility - I actually have NO idea I suspect WOZ would have invented his own in any case ...
(OFF TOPIC - I messed around with a 68008 chip in mid 1980s?? and I recall I found a book with a complete montor program in for this chip - I can not recall the name of the book. )
iberator 5 days ago |
Just design and build a virtual CPU architecture in the language of your choice:) (not verilog but php, c, rust, zig or whatever)
You create architecture, then OPCODES, then you can write simple programs in machine code.
Then its SUPER EASY to write an assembler and disassembler.
Then forth compiler.
I did it all once as I was homeless on my phone in the mall .
Fun and educational, even if you don't know assembly prior.
sam345 5 days ago |
le-mark 5 days ago |
euroderf 5 days ago |
WillAdams 5 days ago |
jgrahamc 5 days ago |
And we had/have people at Cloudflare hand writing assembly to get specific performance out of our systems.
not2b 5 days ago |
dboreham 5 days ago |
Having established my chops though, I'll say that contrary to the comments on this thread that's not "how people did it back then". The typical tool chain for professionals was to run an assembler (and often an emulator too) on some larger computer such as a pdp-11 or a dec-10. Anyone interested in this particular period should read billg's latest book "Source Code". It's very detailed on this subject and tells how he and Paul Allen were able to write an 8080 BASIC interpreter despite never having seen or used an 8080. He does describe writing portions of what was to become the interpreter while on a hiking trip (as in, while actually hiking), so he could do my thing of writing code in his head.
wewewedxfgdf 5 days ago |
RicoElectrico 5 days ago |
ianberdin 5 days ago |
undefined 5 days ago |
rootedbox 5 days ago |
xgkickt 5 days ago |
glum64 5 days ago |
Real story: sometime in 80s I was in bed with a nasty flu. Pain-in-the-eyeballs flu, 40°C body temp. Could not read, coult not watch TV, could not stand any light lit near me, radio caused booming in me poor head.
So I started programming, mentally, in BASIC. One of the outcomes of this activity was an algorithm that compressed any text to mere three bytes, but that is another story...
heisenbit 5 days ago |
NorrisFByrd 5 days ago |
undefined 4 days ago |
Grimeton 5 days ago |
Time travel!
MumminTODAY 5 days ago |
Maybe that is part of the nostalgia for the 8-bit days: the practice of "slow programming"? It was relaxing, sort of like those "slow tv" shows.