6502 Machine Language for Beginners
savetz writes "If you've always wanted to learn 6502 assembly language, now's your chance. The full text of the classic, best-selling 1983 book Machine Language for Beginners is now on the Web. It includes examples and program code for Atari 8-bit, Apple ][, PET/CBM, VIC-20, and Commodore 64 computers."
Yes, it does; it's called ADC if I remember correctly.
-WolfWithoutAClause
"Gravity is only a theory, not a fact!"Floating point is a completely different matter though. The Acorn Atom (based on the 6502) did have a floating point library in ROM. I never tried calling it from ML, but it shows that it can be implemented.
I learned Machine Language programming on the 6502 from "Atomic Theory and Practice" by David Johnson-Davies. The 6502 is a rather neat processor. I even once wrote a compiler for a self made language that would compile to 6502 machine code. For a proof that some rather impressive things can be done with it, have a look at contiki.
The additional instruction would not be "free" in terms of instruction code space. The 6502 reads one byte for the instruction and 0, 1 or 2 additional bytes as operands. All instructions with their addressing modes and implied operands have to fit into 256 codes. Appendix A of the book is a list of all opcodes (instruction, addressing mode, implied operand). There are 8 opcodes for ADC alone...
Of course FP can be implemented on a 6502... AppleSoft BASIC, written by MicroSoft and included in the ROM of all but the earliest Apple ][s (and available on floppy or cassette for the ones that didn't have it in ROM), had floating point routines, including trig functions, log, and square root.
There is a backwards compatible 16 bit version, the 65816. It was made by Western Design Center. The Apple IIgs had one running at 2.3 MHz. There also was a 20MHz upgrade cartridge for the C64 (SuperCPU), and the SNES used a lower power version, the 65c816, at 2.8 MHz.
http://www.westerndesigncenter.com/ch816S.html
The concepts from 8-bit processors, like instructions, registers and flags are still there and haven't changed much. Of course the new processors brought new concepts - virtual modes, paging, sophisticated memory protection schemes, interrupt hierarchies, numeric coprocessors, hinted jumps, various kinds of SIMD instructions and so on and so on.
On the other hand, most developers are pretty much separated from the processor - the operating system and the compiler are there to manage all of the above. Even if you want a super-optimized piece of code, it's a good idea to start by looking at the compiler output.
This is of course only true if you don't plan to write your own OS or a compiler.
IMHO, the ultimate 6502 based home computer had to be the BBC Micro; those of us educated in the UK during the 80's will almost certainly remember these ubiquitous machines sitting in virtally every computer lab in every school up and down the country.
One of the great things about this system was that it's BASIC interpreter contained a full 6502 assembler, and they produced some excellent documentation. Check out the Advanced User Guide from The BBC Lives! site. For my money, you couldn;t get a better start to 6502 development.
Life is like a sewer; what you get out of it depends on what you put into it...