34 lines
454 B
Plaintext
34 lines
454 B
Plaintext
|
#inputs
|
||
|
read BASE
|
||
|
read EXPONENT
|
||
|
|
||
|
setVar ONE 1
|
||
|
setVar ZERO 0
|
||
|
|
||
|
#newVar mulCOUNTER
|
||
|
#newVar mulOUT
|
||
|
|
||
|
copyVar BASE powOUT
|
||
|
jumpMark powLoop
|
||
|
|
||
|
copyVar powOUT IN_A
|
||
|
copyVar BASE IN_B
|
||
|
copyVar ZERO mulOUT
|
||
|
copyVar ZERO mulCOUNTER
|
||
|
jump mulLoop
|
||
|
jumpMark next
|
||
|
add powCOUNTER ONE powCOUNTER
|
||
|
if powCOUNTER != EXPONENT jump powLoop
|
||
|
|
||
|
write mulOUT
|
||
|
|
||
|
halt
|
||
|
|
||
|
jumpMark mulLoop
|
||
|
add mulOUT IN_A mulOUT
|
||
|
add mulCOUNTER ONE mulCOUNTER
|
||
|
if IN_B != mulCOUNTER jump mulLoop
|
||
|
jump next
|
||
|
|
||
|
halt
|