Adds a 16x16 divider to go with the multiplier. The divider is a single stage with no pipelining, which works at the slow 2MHz frequency. Doing this lowers the maximum clock frequency to 5. This is acceptable for now but means that the cpu can't be run at 14, which is the maximum frequency.
33 lines
350 B
ArmAsm
33 lines
350 B
ArmAsm
.code
|
|
|
|
LEDS = $efff
|
|
|
|
DIVNL = $efe8
|
|
DIVNH = $efe9
|
|
DIVDL = $efea
|
|
DIVDH = $efeb
|
|
|
|
DIVQL = $efec
|
|
DIVQH = $efed
|
|
DIVRL = $efee
|
|
DIVRH = $efef
|
|
|
|
main:
|
|
lda #$c8
|
|
sta DIVNL
|
|
lda #$01
|
|
sta DIVNH
|
|
lda #$0d
|
|
sta DIVDL
|
|
lda #$00
|
|
sta DIVDH
|
|
lda DIVQL
|
|
sta LEDS
|
|
wai
|
|
bra main
|
|
|
|
.segment "VECTORS"
|
|
|
|
.addr main
|
|
.addr main
|
|
.addr main
|