Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

AsembSim

8-Bit Assembly Code Simulator · By Ali107

"Power of" Script

A topic by Ali107 created 91 days ago Views: 24
Viewing posts 1 to 1

This script uses the `mul` instruction to do 2^4 and at the end will output the result as 16.

The first 2 lines tells what number power of what, you can change the values to whatever value you want, though it requires some changes to the first two lines if you want to put in a number greater than 127.

mov 2 r0
mov 4 r1
mov 1 r3
jmp_ge r2 r1 28
    mul r3 r0 r3
    add r2 1 r2
jmp 12
mov r3 rout
hlt