5 ms·
I don't want to diminish what he did, but consider that this was one of the most common methods of learning assembler programming in depth in that era. Most boo
by vidarh 13y ago
I don't want to diminish what he did, but consider that this was one of the most common methods of learning assembler programming in depth in that era. Most books on the subject were relatively primitive in the context of games and demo programming, and so if you didn't want to lag behind, you needed to figure out techniques by studying disassembled programs.
(EDIT: Just to add that this is in reference to the disassembling bit. Pulling eproms to dump them and studying them so intently you start to fix bugs the game designers hadn't managed to solve is certainly dedication well above the typical level)
Many large demos at least for 8-bit computers, and quite likely some games too, were written even without a symbolic assembler, but instead entered using a simple machine code monitor (think just one step above debug.com on MS DOS, and decidedly more primitive than programming directly in gdb...) using hardcoded address references instead of labels.
I'd actually been programming on the C64 for a couple of years before I got an assembler that supported labels that was good enough to use (I had some before that, but they wasted too much memory and/or were too slow to seem worth it) and from people I met I gather that's a fairly common experience.
- joezydeco 13y agoNasir Gebelli was a game programmer that created some of the classic early games for the Apple ][ (Space Eggs, Gorgon). He eventually went on to create Final Fantasy at Square. When programming his games in 6502 assembly for the Apple, Gebelli used the built-in mini assembler from the command line. No text editor, and according to most accounts no printer either. All in his head, by hand.
- vidarh 13y agoI don't know the Apple mini assembler, but that sounds similar to what I meant. Either we'd load a tiny "monitor" which is what they were typically called in the Commodore world at least, and you'd have a primitive REPL with commands like ".D C000 C100" to disassemble addresses 0xC000 to 0xC100 or ".A C000" to get a prompt with the address 0xC000 after which you could enter one instruction, press enter and have it instantly assembled and get the next address (with no support for labels). If you needed to correct something, you'd press enter to exit back to the prompt, type ".A [address to correct] [new instruction]" and hopefully you wouldn't need to alter the length of the instruction as then you'd have the fun task of remapping absolute addresses and copy the following code around. Then when you wanted to test something, you'd do ".G C000" and hope your program didn't crash things so bad you had to load things back in... Scarily enough it was common at least in demo circles to not even save before each test as it was too slow with a tape or floppy and so we just hoped we wouldn't lose changes too often from bugs overwriting our program etc. Often not all variables might even be reinitialized on starting the program again either, and so the program might differ depending on test runs... When we saved the programs it was often just a raw memory dump of the locations we'd assembled stuff to... (e.g. .S "filename" C000 C3FF might save the 1K range from 0xC000 to 0xC3FF) (I keep using C000 by habit, even after 25 years or so away from the C64 - 0xC000 to 0xCFFF was free space in between the BASIC ROM and memory mapped registers for the graphics and sound chips, and BASIC would not touch memory above 0x9fff, so putting stuff at 0xC000 was popular since you could e.g. load basic programs without wiping it)
- 300bps 13y ago>I keep using C000 by habit It's been over 25 years since I last programmed in Assembly on my Commodore 64 but I will never forget typing: SYS 49152
- cgh 13y agoYes, the starting address of the 4KB of "protected" memory that we'd poke our assembler opcodes into. All us C64 programmers (loosely used term in my case, I was ten years old or so) have that address burned into our brains forever.
- lurkinggrue 13y agoSYS 64738
- geocar 13y agoThe Apple II had a monitor you could reach via: ]CALL -151 and you could type a program such as: *300:AD 30 C0 88 D0 FD 4C 00 30 but while there was a disassembler (300 L) there was no assembler! Fortunately, if you had Integer Basic, you could do: ]INT to get to Integer basic, then go into that monitor: >CALL -151 then jump into the "mini assembler" inside Integer Basic: *F666 G and now you're in something resembling an assembler: !300:LDY#$0 !302:JMP$309 !305:JSR$FDED !308:INY !309:LDA $320,Y !30C:BNE $305 !30E:JMP$FF65 !$320:48 45 4c 4c 4f 20 48 41 !$328:43 4b 45 52 20 4e 45 57 !$330:53 21 00 !303G
- dmethvin 13y agoAgreed. A symbolic assembler was just a convenient way of managing names and jump targets. To reverse engineer it wasn't too hard to write down the bytes and translate to symbols because the instruction sets were relatively simple and regular (unlike current x86).
- tmoertel 13y agoThe printout-and-highlighters method of reverse engineering was indeed common way back then. It became even more well known in 1982, when Don Lancaster wrote a book entitled Enhancing your Apple II. In it was a chapter on "Tearing into Machine-Language Code," in which he explained a method for using a disassembly printout and colored highlighters to quickly reverse-engineer machine code. This method soon spread beyond the Apple II community. For example, from a 1983 book review in Microcomputing Magazine: Software buffs are likely to vote for the third chapter ("Tearing Into Machine- Language Code") as the jewel of the collection. It is a unique contribution that applies to all machine languages, of which Apple is only one. Possibly no manual anywhere that describes the use of disassemblers and techniques for ex- tracting hidden code can equal this 60-page adventure in decryption. Pro- grammers would do well to look into this chapter to check on techniques they might have missed; commercial software vendors may want to know some things that hackers do to defeat them. Source: Microcomputing Magazine (October 1983) [1] [1] http://archive.org/stream/kilobaudmagazine-1983-10/Microcomputing_1983_October_djvu.txt http://archive.org/stream/kilobaudmagazine-1983-10/Microcomp...
- vidarh 13y agoInteresting... The Apple machines were pretty much unknown in large parts of the world outside the US, so I've actually to this date not even seen an Apple II in person as far as I'm aware, and didn't come across Don Lancaster's stuff until a year or two ago either. Europe was dominated largely by Commodore, with Sinclair, and Atari and maybe Amstrad in "supporting roles" far ahead of the usual suspect of weirder machines for pretty much the entire 80's, until the PC finally got the upper hand. The computer shops near me in the early 80's at one point or another probably stocked about 20-30 distinct home computer brands, but I can't remember seeing any Apple products at any of them until the Macintosh. It's fascinating how the view of home computing is often so completely different from the US vs Europe as a result.
- bluedino 13y agoWere there large import tariffs or something making it prohibitively expensive to get Apple computers from the US, or did Apple not market the machines internationally? Countries such as the USSR and Brazil simply made their own Apple clones. I'd suspect Western Europe did not do so because of legal ramifications.
- Scramblejams 13y agoIt wasn't just the method he used, though. It was 512 pages of assembly, and he spent more than 6 months studying it. The amount of effort he put in is astounding.
- vidarh 13y agoIt sounds a lot when put like that, but it's not 512 pages of dense text, but in terms of typical presentation, perhaps four hex character address, a three character instruction and an operand of <10 characters or so - he could've fit the entire thing on 64 double sided pages easily, maybe less. Lots of people printed out games and other programs in the 32K-64K size range all the time and studied them for months. It's what we did to work with "large" code bases. I've written perhaps a dozen pretty printing programs for asm (including ones that would painstakingly download narrower fonts to our dot matrix printer to fit more columns....) exactly because I wore out large number of printer cartridges, printing out code and kept trying to get things printed faster and on less paper, and that was a pretty common pursuit. Again, it's a lot of effort, and some of what he did shows a quite impressive level of dedication (such as dumping the eproms, building his own clone of the game, and fixing bugs the designers hadn't found), but actually printing out a code base that size and studying it to learn was quite normal. I'm all for recognizing this guys effort, but not for the most mundane part of what he did.
- primitur 13y agoIn my days in the 80's, I had one of these: http://www.old-computers.com/museum/hardware/Oric_Atmos_MCP40_2.jpg http://www.old-computers.com/museum/hardware/Oric_Atmos_MCP4... .. and used it as a general work-buffer for expressing routines and dumping assembly .. my parents called it my "bogroll homework" since I usually took rolls of plotted product to the head with me, light reading ..