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 v2

A topic by Ali107 created 90 days ago Views: 38
Viewing posts 1 to 1
(2 edits)

The Update v1.1.0 introduces an instruction that pauses program execution and wait for user's key character input. The update also introduces commenting.

I modified the "Power of" Script so that it allows the user to insert 2 numbers between 0-9, then calculates based on the user input.

; Input Number between 0-9
hlt_in
sub r0 48 r1
jmp_gr r1 9 0
 
; Input power number between 0-9
hlt_in
sub r0 48 r2
jmp_gr r2 9 12
 
; Calculates power between the two inputs
mov 1 r4
jmp_ge r3 r2 44
    mul r4 r1 r4
    add r3 1 r3
jmp 28
 
mov r4 rout ; outputs the result
hlt