An Introduction to 6502 Machine Code

This document was uploaded by one of our users. The uploader already confirmed that they had the permission to publish it. If you are author/publisher or own the copyright of this documents, please report to us by using this DMCA report form.

Simply click on the Download Book button.

Yes, Book downloads on Ebookily are 100% Free.

Sometimes the book is free on Amazon As well, so go ahead and hit "Search on Amazon"

June 1986 reprint. [rear cover:] * In essence, machine code programming is direct programming of the microprocessor without using a built-in high-level computer language such as BASIC. * The vast increase in running speed obtained when writing programs in machine code is offset, to a degree, by the added complexity in writing them. However, it is not as difficult as one might think and this book tells the story. * The 6502 microprocessor is utilised in many popular home computers including the Electron, BBC models A and B, VIC-20, ORIC-1/Atmos and the Atari machines. Also, the Commodore 64 uses the 6510 which is a slightly modified but software compatible version of the 6502. * Some simple demonstration programs which can be run on a number of the above machines are Included in this book.

Author(s): PENFOLD, R.A. & J.W.
Edition: 1
Publisher: Bernard Babani Publishing
Year: 1984

Language: English
Commentary: 300 dpi b&w page images pdf reformatted from 300 dpi greyscale 46.39MB pdf at https://archive.org/details/bernard-babani-publishing-an-introduction-to-6502-machine-code/mode/2up
City: London
Tags: 6502, Assembly Language, Atari, BASIC,BBC Model A, binary, bits, bytes, Commodore 64, computer language, CPU, development, Fortran, hexadecimal. nibbles, ORIC-I/Atmos, Pascal, Computer Program, Machine Code, silicon, Snobol, Texas Instruments, VIC-20

Cover Front
CONTENTS
Preface
Chapter 1. THE MICROPROCESSOR
Assembly Languages
The Processor
Binary
Signed Binary
Twos Complement
Overflow Flag
Binary Coded Decimal
Hexadecimal
System Operation
The Stack
Flags
Paging
6502 Pinouts
Memory Organisation
Chapter 2. THE 6502 INSTRUCTION SET
1. Add With Carry
Mnemonic - ADC
2. Logic AND
Mnemonic AND
3. Arithmetic Shift Left
Mnemonic ASL
4. Branch On Carry Clear
Mnemonic BCC
5. Branch On Carry Set
Mnemonic BCS
6. Branch IF (Last Result) Equal To Zero
Mnemonic BEQ
7. Test Memory Bits Against Accumulator
Mnemonic BIT
8. Branch On Minus
Mnemonic BMI
9. Branch On (Last Result) Not Equal
To Zero
Mnemonic BNE
10. Branch On Plus
Mnemonic BPL
Break
Mnemonic BRK
12. Branch On Overflow Clear
Mnemonic BVC
13. Branch On Overflow Set
Mnemonic BVS
14. Clear Carry Flag
Mnemonic CLC
15. Clear Decimal Flag
Mnemonic CLD
16. Clear Interrupt Flag
Mnemonic CLI
17. Clear Overflow Flag
Mnemonic CLV
18. Compare To Accumulator
Mnemonic CMP
19. Compare To X Register
Mnemonic CPX
20. COMPARE TO Y REGISTER
Mnemonic CPY
21. Decrement
Mnemonic DEC
22. Decrement X Register
Mnemonic DEX
23. Decrement Y Register
Mnemonic DEY
24. Logic Exclusive-0 R
Mnemonic EOR
25. Increment Memory
Mnemonic INC
26. Increment X Register
Mnemonic INX
27. Increment Y Register
Mnemonic INY
28. JUMP TO ADDRESS
Mnemonic JMP
29. Jump To Subroutine
Mnemonic JSR
30. Load The Accumulator
Mnemonic LDA
31. Load The X Register
Mnemonic LDX
32. Load The Y Register
Mnemonic LDA
33. Logical Shift Right
Mnemonic LSR
34. No Operation
Mnemonic NOP
35. Inclusive Or With Accumulator
Mnemonic ORA
36. Push Accumulator Onto Stack
Mnemonic PHA
37. Push Processor Status Onto Stack
Mnemonic PHP
38. Pull Accumulator From Stack
Mnemonic PLA
39. Pull Processor Status From Stack
Mnemonic PLP
40. Rotate Left (one bit)
Mnemonic ROL
41. Rotate Right (one bit)
Mnemonic ROR
42. Return From Interrupt
Mnemonic RTI
43. Return From Subroutine
Mnemonic RTS
44. Subtract With Carry
Mnemonic SBC
45. Set Carry Flag
Mnemonic SEC
46. Set Decimal Mode Flag
Mnemonic SED
47. Set Interrupt Disable Flag
Mnemonic SEI
48. Store Accumulator In Memory
Mnemonic STA
49. Store X In Memory
Mnemonic STX
50. Store Y In Memory
Mnemonic STY
51. Transfer Accumulator To X
Mnemonic TAX
52. Transfer Accumulator To Y
Mnemonic TAY
53. Transfer Stack Pointer To X
Mnemonic TSX
54. Transfer X To Accumulator
Mnemonic TXA
55. Transfer X Into Stack Pointer
Mnemonic TXS
56. Transfer Y Into The Accumulator
Mnemonic TYA
Chapter 3. ADDRESSING MODES
1. Implied Addressing
2. Immediate Addressing
3. Absolute Addressing
4. Zero Page
5. Relative Addressing
6. Indirect Addressing
Indexed Addressing
7. Absolute Indexed Addressing
8. Indirect Indexed Addressing
9. Indexed Indirect Addressing
Chapter 4. STORING AND EXECUTION
Execution
Chapter 5. EXAMPLE PROGRAMS
ADD
TAKE
LOOP
TIMES
Note On The BBC/Electron Listings
Machine Specific Listings
BBC/Electron Versions
ADD
TAKE
LOOP
TIMES
VIC-20 Versions
ADD
TAKE
LOOP
TIMES
Commodore 64 Versions
ADD
TAKE
LOOP
TIMES
ORIC-1 and Atmos Versions
ADD
LOOP
TIMES
Chapter 6. INPUT/OUTPUT
The 6522
Control Register
Instruction Set Chart
Cover Back