Add multiplier

Add 16x16 multiplier.

Pretty simple. Address 0-1 is multipled by address 2-3 and the result is
in address 4-7, all little endian of course.
This commit is contained in:
Byron Lathi
2023-01-04 16:15:02 -05:00
parent 32a78a4aff
commit 42ad901ba4
9 changed files with 126 additions and 30 deletions

View File

@@ -1,4 +1,4 @@
TARGETS=stacktest runram timer timer_irq
TARGETS=stacktest runram timer timer_irq multiplier
SRC=$(wildcard *.s)
DIR=../ip/bram

View File

@@ -0,0 +1,32 @@
.code
LEDS = $efff
MULTAL = $eff0
MULTAH = $eff1
MULTBL = $eff2
MULTBH = $eff3
MULTPLL = $eff4
MULTPLH = $eff5
MULTPHL = $eff6
MULTPHH = $eff7
main:
lda #$7b
sta MULTAL
lda #$00
sta MULTAH
lda #$c8
sta MULTBL
lda #$01
sta MULTBH
lda MULTPLH
sta LEDS
wai
bra main
.segment "VECTORS"
.addr main
.addr main
.addr main