Changes

Jump to: navigation, search

6502 Emulator

1,777 bytes added, 11:43, 13 September 2021
no edit summary
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/upload); this works nicely with a local github repository.
 
== Assembler Capabilities ==
 
The assembler accepts these inputs:
* 6502 assembler instructions, optionally prefixed with a label and a colon. Examples:
** simple instruction: <code>STA $10</code>
** instruction with a label: <code>LOOP: STA ($10),Y</code>
*** when a label is used, the address of the label can be referenced using the label name: <code>JMP LOOP</code>
* Origin assignment: You can tell the assembler where to assemble the following code with this syntax: <code>*=$XXXX</code> where XXXX is an address in hexadecimal. Multiple origin assignments may be used. Example: <code>*=$1800</code>
* "define" directive: Macro assignments may be created with the "define" directive: <code>define macro value</code> -- for example: <code>define WHITE $01</code> -- the macro value will be substituted into lines wherever the macro name appears (e.g., <code>LDA #WHITE</code>).
* "dcb" directive: the Define Constant Byte (dcb) directive will cause the assembler to place individual byte values into memory. These byte values may be in hexadecimal prefixed with $, decimal with no prefix, or single printable non-space characters quoted with double quotes.
* high and low label bytes: the low byte of the label X can be accessed as &lt;X and the high byte can be accessed as &gt;X. For example, this code will load the low byte of the label "start" into the A register: <code>LDA #&lt;START</code>
* Comments: any characters on a line following an unquoted semicolon <code>;</code> are treated as a comment and ignored.
== Using the Debugger ==
* 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/Enter and Backspace are reported as ASCII codes; cursor keys are reported as $80=up, $81=right, $82=down, $83=left.
* a 32x32 pixel bitmapped display at '''$0200-$05ff''', with one byte per pixel. The lowest four bits of each byte select one of 16 colours.
** $0: Black** $1: White** $2: Red** $3: Cyan** $4: Purple** $5: Green** $6: Blue** $7: Yellow** $8: Orange** $9: Brown** $a: Light red** $b: Dark grey** $c: Grey** $d: Light green** $e: Light blue** $f: Light grey* an 80x25 character display at '''$f000-$7cfffcff''', with one byte per pixel. Printable ASCII characters will be displayed. If the high-order bit is set, the character will be shown in <span style="background: black; color: white;">&nbsp;reverse video&nbsp;</span>.
* a read-only ROM chip is present at '''$fe00-$ffff'''; see below for details.
A contains the character at the current cursor location
Registers which are not used for input/output are not affected by the ROM routines. The ROM routines use $f0-fd in the zero pagefor variable storage.
To use the ROM routines, these define directives may be pasted into your code:

Navigation menu