HOME

Using a W65c02 Simulator:

Zero-out a range in RAM

Overview:

A portion of the SBC30 code has been sliced and edited as  SBC30_TestZERO_03.asm to show the Zeroing out of a Range of Memory function that is executed by typing "Y" or "y" in the terminal.

The original Zero function, "Z", has become a change function: you specify the page (256bytes) you wish to change followed by the hex byte.

The new ZERO OUT function, "Y", permits you to change any range of RAM to "00". Although you could change the zero page at $0000 and the first page at $0100 where the Stack lives, I would recommend against it. Also, I use the first $10 bytes of $0200 for variables so...

 

The user is prompted to enter:
- a 4-digit hex START address (minimum $0210)

- a 4-digit hex END address (maximum $4000)

All bytes in that range become "00".

 

Tester:

Oshonsoft 6502 Simulator IDE v1.41

 

Setup:

Setup your IDE as shown in the top screenshot.

Enable the Input Terminal with an I/O port of $5000.

Set the "One-Shot IN Value" to "59" for the letter "Y".

Within the Input Terminal, click "Send Hex Bytes" and enter "31,30,30,31,31,31,30,31" without the quotes. The first 4 hex numbers are the START address of $1001, and the next 4 are the END address $1101.

Adjust the 3 Memory Editors to show addresses $0000, $1000 and $1100.

 

App Operation:

Using the FlashROM code, here are the keystrokes needed to produce the adjacent lower screenshot:

- Press Reset button

- Y    0210    4000

- D    3F00

 

Breakpoints:

256, 272, 294, 308.

Use <CTRL><F6> to get you to the breakpoints, use <F2> at each to get a feel what is occurring, then continue to the next BP using <CTRL><F6>.

 

IDE Operation:

If you wish to burn the code to flashROM, try this latest build: SBC30_0_R3.bin

Oshonsoft 6502 Simulator IDE

(Click to Enlarge)

 

Sim IDE

 

ASCII Terminal

 

 

 

 

Updated 2023-09-20 @ 8am

 

HOME