spo600:6502_emulator
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
spo600:6502_emulator [2024/04/16 14:10] – external edit 127.0.0.1 | spo600:6502_emulator [2025/04/09 21:14] (current) – chris | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== 6502 Emulator ====== | ====== 6502 Emulator ====== | ||
- | A simple web-based [[6502]] emulator is available at [[https://matrix.senecapolytechnic.ca/ | + | A simple web-based [[6502]] emulator is available at [[http://6502.proximity.on.ca]] (note that this is an http link, not an https link). This emulator is used in the [[start|SPO600]] course to teach 8-bit [[Assembly Language|assembly language]] before transitioning to more complex 64-bit x86_64 and [[ARMv8# |
- | In most 6502 documentation, | + | In most 6502 documentation, |
===== Basic Controls | ===== Basic Controls | ||
Line 17: | Line 17: | ||
* Notes - displays notes about the emulator in the message area. | * Notes - displays notes about the emulator in the message area. | ||
- | The Speed slider lets you adjust the speed of the emulator from about 1% of native 6502 performance (left) to roughly full native speed (right). Setting the speed slider to a lower setting can be useful for debugging and for viewing the progress of operations on the displays. | + | The Speed slider lets you adjust the speed of the emulator from about 1% of native 6502 performance (left) to roughly full native speed of a 1MHz CPU (right; this is not fully accurate to the CPU speed since the emulator is not cycle-accurate). Setting the speed slider to a lower setting can be useful for debugging and for viewing the progress of operations on the displays. |
There are also controls to Save and Load the text area to/from local storage on the computer on which it is running (as a download/ | There are also controls to Save and Load the text area to/from local storage on the computer on which it is running (as a download/ | ||
Line 23: | Line 23: | ||
===== Assembler Capabilities | ===== Assembler Capabilities | ||
The assembler accepts these inputs: | The assembler accepts these inputs: | ||
+ | |||
==== Instructions | ==== Instructions | ||
* 6502 assembler instructions, | * 6502 assembler instructions, | ||
* simple instruction: | * simple instruction: | ||
* instruction with a label: '' | * instruction with a label: '' | ||
- | | + | |
==== Directives | ==== Directives | ||
* Origin assignment: You can tell the assembler where to assemble the following code with this syntax: '' | * Origin assignment: You can tell the assembler where to assemble the following code with this syntax: '' | ||
* " | * " | ||
- | * " | + | * " |
==== High and Low Label Bytes ==== | ==== High and Low Label Bytes ==== | ||
- | * The low byte of the label X can be accessed as <X and the high byte can be accessed as >X. For example, this code will load the low byte of the label " | + | * The low byte of the label X can be accessed as <X and the high byte can be accessed as >X. For example, this code will load the low byte of the label " |
* You can use labels and origin assignment together to get a label for any address in the system. For example, to get a label pointing to the first byte of the character display, you could place this at the end of your program: | * You can use labels and origin assignment together to get a label for any address in the system. For example, to get a label pointing to the first byte of the character display, you could place this at the end of your program: | ||
Line 55: | Line 58: | ||
===== Using the Monitor | ===== Using the Monitor | ||
- | Selecting the Monitor checkbox will display the specified region of memory as code is executed. For example, specifying a start of $00 and a length of $100 will display the entire zero page. Once enabled, the monitor | + | Selecting the Monitor checkbox will display the specified region of memory as code is executed. For example, specifying a start of $00 and a length of $100 will display the entire zero page. The monitor display is updated with after each execution of one (or more) instructions. |
===== Turning the Text Screen On/ | ===== Turning the Text Screen On/ | ||
The checkbox labeled "Text Screen" | The checkbox labeled "Text Screen" | ||
Line 76: | Line 78: | ||
* a one-byte pseudo-random number generator (//PRNG//) at **$fe**. | * a one-byte pseudo-random number generator (//PRNG//) at **$fe**. | ||
* a single-key buffer at **$ff** - if you write to this address, it will remain unchanged until a new keypress is received. Printable characters plus Return/ | * a single-key buffer at **$ff** - if you write to this address, it will remain unchanged until a new keypress is received. Printable characters plus Return/ | ||
- | * a 32x32 pixel bitmapped display at **$0200-$05ff**, | + | * a 32x32 pixel bitmapped display at **$0200-$05ff**, |
* $0: Black | * $0: Black | ||
* $1: White | * $1: White | ||
Line 93: | Line 95: | ||
* $e: Light blue | * $e: Light blue | ||
* $f: Light grey | * $f: Light grey | ||
- | * an 80x25 character display at **$f000-$fcff**, | + | * an 80x25 character display at **$f000-$fcff**, |
* a read-only ROM chip is present at **$fe00-$ffff**; | * a read-only ROM chip is present at **$fe00-$ffff**; | ||
Line 108: | Line 110: | ||
* SCINIT $ff81 - Initialize and clear the character display | * SCINIT $ff81 - Initialize and clear the character display | ||
* CHRIN $ffcf - Input one character from keyboard (returns A (that is, the return value will be placed in the Accumulator register)) | * CHRIN $ffcf - Input one character from keyboard (returns A (that is, the return value will be placed in the Accumulator register)) | ||
- | * CHROUT $ffdw - Outputs one character (A) to the screen at the current cursor position. Screen will wrap/scroll appropriately. Printable characters and cursor codes ($80/ | + | * CHROUT $ffdw - Outputs one character (A) to the screen at the current cursor position. Screen will wrap/scroll appropriately. Printable characters and cursor codes ($80/ |
* SCREEN $ffed - Returns the character screen size in the X and Y registers. | * SCREEN $ffed - Returns the character screen size in the X and Y registers. | ||
* PLOT $fff0 - gets (CARRY=1) or sets (CARRY=0) the cursor position | * PLOT $fff0 - gets (CARRY=1) or sets (CARRY=0) the cursor position | ||
Line 143: | Line 145: | ||
===== Source Code ===== | ===== Source Code ===== | ||
- | The emulator' | + | The emulator' |
spo600/6502_emulator.1713276609.txt.gz · Last modified: 2024/04/16 18:10 (external edit)