News for hackers. Stuff that matters.
Re:Easy 6502 – How to get started writing 6502 assembly lang... by Elrac on Thursday January 05, 2017 @04:27AM (#13325873)
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.

Re:Easy 6502 – How to get started writing 6502 assembly lang... by throwaway7767 on Thursday January 05, 2017 @06:36AM (#13326343)
Back 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_microprocesso...

Re:Easy 6502 – How to get started writing 6502 assembly lang... by thick18cm on Thursday January 05, 2017 @09:53AM (#13327501)
I 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.
Re:Easy 6502 – How to get started writing 6502 assembly lang... by KSS42 on Thursday January 05, 2017 @10:28AM (#13327830)
In high school, I used a similar setup from Heathkit with a 6800 processor.

http://www.vintage-computer.com/heathkit3400.shtml

Re:Easy 6502 – How to get started writing 6502 assembly lang... by linker3000 on Thursday January 05, 2017 @03:37PM (#13331134)
Acorn System 1 for the Win

http://imgur.com/a/f7zZR

http://forum.6502.org/viewtopic.php?f=12&t=3286&hilit=acorn+...

(No I haven't built the replica yet - darn work/life balance)

Re:Easy 6502 – How to get started writing 6502 assembly lang... by Narishma on Thursday January 05, 2017 @06:21AM (#13326286)
Raspberry Pi is ARM, not AVR. And it's not really comparable to an Arduino since it runs a full OS.
Re:Easy 6502 – How to get started writing 6502 assembly lang... by Elrac on Wednesday January 11, 2017 @03:01AM (#13372480)
Oops! 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.
Re:Easy 6502 – How to get started writing 6502 assembly lang... by cgh on Thursday January 05, 2017 @11:46AM (#13328645)
Yes, 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...
Re:Easy 6502 – How to get started writing 6502 assembly lang... by user51442 on Thursday January 05, 2017 @04:48AM (#13325947)
Pi is ARM of course, but +1 for AVR. 6809 was nice too.
Re:Easy 6502 – How to get started writing 6502 assembly lang... by unoti on Thursday January 05, 2017 @12:25PM (#13329152)
I 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.
Re:Easy 6502 – How to get started writing 6502 assembly lang... by wang_li on Thursday January 05, 2017 @12:56PM (#13329513)
>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.

Re:Easy 6502 – How to get started writing 6502 assembly lang... by WhitneyLand on Thursday January 05, 2017 @07:35AM (#13326619)
Yes simple unless you had to add two numbers greater than 255 :)
Re:Easy 6502 – How to get started writing 6502 assembly lang... by Graham24 on Thursday January 05, 2017 @10:53AM (#13328073)
16-bit arithmetic was not a problem, you just checked the carry flag.