And yes, I'm not trying to make it close as possible from the original, but make it sounds nice and recognizable.
Well, I'm sleepy so just here's just the SPC file:
Click!
Good night :)
FREE SPACE!
Now, let's assume that you took 3F8000, you need to remove the last two zeroes and put this value in the tool now. For example, 3F8000 would turn in 3F80.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;Potency routine ($02-$03 will hand the result)
;$00 must be the Base and $01 the Exponent
;Note: the result it's a 16 bits value.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Potency:
DEC $01 ;\Fix the
DEC $01 ;/Exponent
LDA $00 ;\$02 will be
STA $02 ;/the "second" base
LDX $01 ;Set up Loop
.LoopForIToExponentDo
LDA $00 ;\The "real" base
STA $4202 ;/Set at the multiply register A
LDA $02 ;\The "second" base
STA $4203 ;/Set at the multiply register B
NOP #8 ;Waste cycles. We need time to the multiplication works
LDA $4216 ;\Hand the result
STA $02 ;/Store first digit
LDA $4217 ;\Hand the result
STA $03 ;/Store second digit
DEX ;Decremet exponent/Loop
BPL .LoopForIToExponentDo ;If the loop doesn't end, return
RTS ;Finally, end...
LDA #$Base
STA $00
LDA #$Exponent
STA $01
JSR Potency
REP #$30
LDA $02
*Random Code*
SEP #$30
LDA #$Base
STA $00
LDA #$Exponent
STA $01
JSR Potency
LDA $02
*Random Code*
LDA $03
*Another Random Code*