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

Division script

A topic by Ali107 created 63 days ago Views: 32
Viewing posts 1 to 1

This is a script you can load into AsembSim. Right now, this divides 127 by 2 and at the end will output the result and remainder.

The first 2 lines controls what get divided by what, you can change the values to whatever you want, though requires slight change to the first two lines if you want to put in a number greater than 127. Dividing by zero will just make it get stuck in an infinite loop.

mov 127 r0
mov 2 r1
jmp_ls r0 r1 24
    sub r0 r1 r0
    add r2 1 r2
jmp 8
mov r0 rout
mov r2 rout
hlt