itch.iohttp://itch.iohttps://itch.io/t/4151590/power-of-script-v2"Power of" Script v2https://itch.io/t/4151590/power-of-script-v2Sat, 28 Sep 2024 17:45:05 GMTSat, 28 Sep 2024 17:45:05 GMTSat, 28 Sep 2024 17:45:05 GMTThe 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
]]>
https://itch.io/t/4148949/power-of-script"Power of" Scripthttps://itch.io/t/4148949/power-of-scriptFri, 27 Sep 2024 20:26:51 GMTFri, 27 Sep 2024 20:26:51 GMTFri, 27 Sep 2024 20:26:51 GMTThis 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
]]>
https://itch.io/t/4145785/multiplication-scriptMultiplication Scripthttps://itch.io/t/4145785/multiplication-scriptThu, 26 Sep 2024 20:04:15 GMTThu, 26 Sep 2024 20:04:15 GMTThu, 26 Sep 2024 20:04:15 GMTThis script multiplies 2 with 2 and at the end will output the result. (tbh this is just to show off as you can multiply using the 'mul' instruction)

The first 2 lines controls what gets multiplied with 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 2 r1
jmp_eq r2 r1 24
    add r3 r0 r3
    add r2 1 r2
jmp 8
mov r3 rout
hlt
]]>
https://itch.io/t/4145503/division-scriptDivision scripthttps://itch.io/t/4145503/division-scriptThu, 26 Sep 2024 18:02:51 GMTThu, 26 Sep 2024 18:02:51 GMTThu, 26 Sep 2024 18:02:51 GMTThis 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
]]>