I'm trying to write a subroutine for MARIE that will cube a number using repeated addition. I know I need to add the number by itself equal to its amount three times (so if its 4 I'll need to add 4 to itself 4 times, times 3). I don't have a real good idea on how to loop 3 more times. Also not sure on how to use JnS.
From examples I've seen they use JnS to store values. Here's what I have
/Subroutine for finding cube of number
/
Load Num /Load the first number
Store Count /Store this number to use for looping repeated addition
Loop, Load Sum /Load the sum for first number into AC
AddI Num /Add the value in AC of first number
Store Sum /Store the sum
Load Count /Load Count again
Subt One /Subtract one from our counter
Store Count /Store this new number for our counter
Skipcond 800 /If Count > 0, skip next instruction
Jump Loop /Continue loop if Count is greater than 0