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/05/07 16:55] – chris | 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://6502.cdot.systems]]. 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# | + | 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 33: | Line 33: | ||
* 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 58: | 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 79: | 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 96: | 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 111: | 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 146: | Line 145: | ||
===== Source Code ===== | ===== Source Code ===== | ||
- | The emulator' | + | The emulator' |
spo600/6502_emulator.1715100925.txt.gz · Last modified: 2024/05/07 20:55 (external edit)