5 ms·
My first real job was programming a Commodore PET for a merchant - in BASIC. When I needed searches to be faster I wrote a routine in 6502 assembler. Unfortunat
by Elrac 10y ago
My first real job was programming a Commodore PET for a merchant - in BASIC. When I needed searches to be faster I wrote a routine in 6502 assembler. Unfortunately I didn't have an assembler, so I hand-assembled my code using the instruction code chart from the back of a book. My "loader" was a chunk of BASIC code POKEing numbers into memory.
Can confirm that the 6502 instruction set is pleasantly simple. On the other hand, a similar experience can be had on some modern CPUs as well. I found the Atmel AVR's instruction set (as found in the Arduino and Raspberry Pi) to be similarly approachable.
- user51442 10y agoPi is ARM of course, but +1 for AVR. 6809 was nice too.
- unoti 10y agoI loved 6809. It's the design of th instruction set that I loved, its simple consistency. That and the fact that it had a SEX (sign extend) function, and two stacks.
- Narishma 10y agoRaspberry Pi is ARM, not AVR. And it's not really comparable to an Arduino since it runs a full OS.
- Elrac 10y agoOops! I stand corrected. But no, the Raspberry Pi does not necessarily run a full OS. It can, and it certainly makes sense to do that, but it's very possible to run a standalone boot-loaded program on a Raspberry, just as OSes like FemtoOS will run on AVR architecture.
- throwaway7767 10y agoBack in school (I studied electronics), our embedded programming course was done on 8085 machines with a hexadecimal keypad where you could enter data into memory a byte at a time. The assignments were done on pen and paper, we got a printout of the instruction set, a blank piece of paper and a description of what the program was supposed to do. We'd write the assembler code on paper, translate it by hand to hexadecimal using the instruction set reference and then load the resulting binary code by hand. You could pause execution with a button and the address and data buses were available on pins, so you could hook up a scope or logic analyzer to see what was happening under the hood. Most everybody hated that class, but man did I love it. It was hands-down the most fun class in my studies. Would've been better with a 6502 though. EDIT: Oh look, I found the machine. Apparently it was a HP 5036A Microprocessor Lab (learning computer): http://www.azur-electronics.com/Pages/hp_5036a_microprocessor_lab.aspx http://www.azur-electronics.com/Pages/hp_5036a_microprocesso...
- thick18cm 10y agoI can't see how it would have been better with a 6502. The 8080 family had multiple clock cycles per instruction cycle, thus if you are hooking up a scope and watching, there is more going on to see, and if you grok what's happens at each clock transition, you will have learned more about timing and the internal propagation of signals through stages of logic gates. It's somewhat similar to CISC vs RISC, both may be elegant designs, but understanding more complexity is a greater intellectual puzzle and the 8085 had more microcode.
- KSS42 10y agoIn high school, I used a similar setup from Heathkit with a 6800 processor. http://www.vintage-computer.com/heathkit3400.shtml http://www.vintage-computer.com/heathkit3400.shtml
- linker3000 10y agoAcorn System 1 for the Win http://imgur.com/a/f7zZR http://imgur.com/a/f7zZR http://forum.6502.org/viewtopic.php?f=12&t=3286&hilit=acorn+system+1 http://forum.6502.org/viewtopic.php?f=12&t=3286&hilit=acorn+... (No I haven't built the replica yet - darn work/life balance)
- WhitneyLand 10y agoYes simple unless you had to add two numbers greater than 255 :)
- Graham24 10y ago16-bit arithmetic was not a problem, you just checked the carry flag.
- cgh 10y agoYes, the combo of read/data and poke was the preferred way to combine Basic and assembly on the C64 also. Technical magazines like The Transactor consisted of program listings that were nothing but these statements and lots of numbers. I believe 169 is LDA, if memory serves...
- wang_li 10y ago>On the other hand, a similar experience can be had on some modern CPUs as well. There's absolutely no reason you couldn't constrain yourself to a subset of the instructions available on x86 and have a fairly equivalent experience as coding for a 6502.