HOME

OS Apps:

Multiply Two Bytes

Overview:

A portion of the SBC30 code has been sliced and edited as  SBC30_TEST_OS_03e.asm for the Multiply Two Bytes function.

The SIM will provide an input of "5" to select the menu item and then "0F" and "0E" as the two 2-digit numbers to be multiplied.

 

Tester:

Oshonsoft 6502 Simulator IDE v1.45

 

Setup:

Setup your IDE as shown in the top screenshot adjacent.

In the Peripheral Devices window:

- set Device 1 to be an INput on port $5000 with a One-Shot IN value of 35 (for the number 5)

- Set Output Terminal to I/O Port $5000

- Set Input Terminal to I/O Port $5000

- Send Hex Bytes 30,46,30,45

Adjust the 2 Memory Editors to show addresses $0000 and $0200.

In the Watch Variables window, you may wish to add:

- AddrLoHi at $0006

- Cnv2LoHi at $0212

- Num1_Lo at $0040

- Num2_Lo at $0042

 

SIM Breakpoints:

BPs are needed are at 2940, 2954, 2956 and 2988. The first ones will allow you to see the operation.

The last BP is for the RTS to end the program.

 

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

 

App Operation:

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

- Press Reset button

- O

- 5

- 0F

- 0E

 

Permutations tried include: $0F/$0E, $10/$10 and $FF/$FF.

 

IDE Operation:

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

Oshonsoft 6502 Simulator IDE

(Click to Enlarge)

 

Sim IDE

 

ASCII Terminal

 

 

 

 

Updated 2023-10-11 @ 8am

 

HOME