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:
@@ -1,4 +1,4 @@
|
||||
TARGETS=stacktest runram timer timer_irq
|
||||
TARGETS=stacktest runram timer timer_irq multiplier
|
||||
SRC=$(wildcard *.s)
|
||||
DIR=../ip/bram
|
||||
|
||||
|
||||
32
hw/efinix_fpga/test_programs/multiplier.s
Normal file
32
hw/efinix_fpga/test_programs/multiplier.s
Normal 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
|
||||
Reference in New Issue
Block a user