3 ms·
> Several days later, I tried writing a scrappy decompiler for the Applesoft BASIC bytecode. From past experience I was worried this would be real complex, but
by egypturnash 2y ago
> Several days later, I tried writing a scrappy decompiler for the Applesoft BASIC bytecode. From past experience I was worried this would be real complex, but in the mother of all lucky breaks the "bytecode" is the original program text with certain keywords replaced with 1-byte tokens. After nicking the list of tokens from the Apple II ROM disassembly I had a half-decent decompiler after a few goes.
Applesoft has a BASIC decompiler built in, it's called "break the program and type LIST". Maybe Oregon Trail did something to obscure this? I know there were ways to make that stop working.
- sumtechguy 2y agoIf I remember correctly applesoft also had a few single bytecodes that would decode to other key words. Like PRINT and ?. But I could be remembering badly.
- bongodongobob 2y agoDepends on the version. The original was BASIC, but the one with graphics and sound (which I think was more popular?) was assembly.
- egypturnash 2y agoWikipedia implies this version was mostly BASIC, the hunting minigame was in assembly.
- canucker2016 2y agoYes, a few minutes spent reading about Applesoft BASIC or Microsoft BASIC would've reduced the cringe factor in reading a neophyte trying to mentally grapple with old technology. "bytecode" and "virtual machine", no, no, no. That's not the path to enlightenment... in this case, print debugging, is your best bet.