+gnusto Posted September 11, 2020 Share Posted September 11, 2020 If you happen to be a ycombinator reader, yes coming from there. But in an article linked from there earlier today I realized that Steve Wozniak wrote the initial Apple I and Apple II ROMs by hand. He wrote the opcodes out, and then translated the opcodes into machine code by reading through each line and typing in the binary, because he couldn't afford an interpreter program. I wonder how much this contributed to his oft-sited efficiency in 6502. When you are writing it all out on paper or whatnot, you would have a lot of incentive to be as brief as possible in terms of lines of code. 2 1 Quote Link to comment Share on other sites More sharing options...
stepho Posted September 11, 2020 Share Posted September 11, 2020 Yep, that was common back then. Compilers and assemblers were hard to come by, expensive or ran on expensive development systems. So many hackers just did it by hand. I was never able to memorise all the opcodes myself but I know others who could disassemble a ROM just by eyeballing it. As in, he could look at a hex dump of a ROM, tell you what instructions were being called and (after a bit of thinking) tell you that it was a 16 bit multiple routine. 1 Quote Link to comment Share on other sites More sharing options...
Rybags Posted September 11, 2020 Share Posted September 11, 2020 (edited) I used to know most of the common ones off by heart - sort of easy, the Ax are mostly loads, 8x mostly stores, all the branches have 0 as the second nybble. 60/20 for JSR/RTS, 4C for JMP. I've done some hand assembly in that fashion but not really more than a few dozen instructions. The hardest part IMO is dealing with the branches, the rest isn't too hard. Edited September 11, 2020 by Rybags Quote Link to comment Share on other sites More sharing options...
Bobo Cujo Posted September 11, 2020 Share Posted September 11, 2020 I actually did hand assembly (well, text file assembly) along with a hex editor for many of the recent Joy2B hacks. It's still a useful technique if you want to replace small amounts of code in an existing binary, since you'll be counting opcode sizes to make sure everything fits. Having to recount branches by hand is painful, as @Rybags said. With that said, it can still easier than dealing with disassemblies that involve branches, JSRs and JMPs to locations that are dynamically remapped on load, and are thus near-impossible to follow without the assistance of a debugger... Quote Link to comment Share on other sites More sharing options...
zzip Posted September 11, 2020 Share Posted September 11, 2020 15 hours ago, gnusto said: If you happen to be a ycombinator reader, yes coming from there. But in an article linked from there earlier today I realized that Steve Wozniak wrote the initial Apple I and Apple II ROMs by hand. He wrote the opcodes out, and then translated the opcodes into machine code by reading through each line and typing in the binary, because he couldn't afford an interpreter program. I wonder how much this contributed to his oft-sited efficiency in 6502. When you are writing it all out on paper or whatnot, you would have a lot of incentive to be as brief as possible in terms of lines of code. I did this back when I was too cheap to splurge for a decent assembler. It was a pain in the ass to debug! so props to him for making it work! Quote Link to comment Share on other sites More sharing options...
Graham Dearsley Posted September 18, 2020 Share Posted September 18, 2020 Yep, In 1981 I used to do the same for my DLI and VBI routines, write the assembly out on paper and then look up the codes in the back of the Programming the 6502 book. Then I got the assembler/editor cartridge. Oh the bliss of being able to jump to a label ? 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.