Marie Machine Simulation using Conditional Branches
Input / Read number from keyboard
Store Num / Save read number in num variable
Loop1, Output / Print current value of AC
Subt One / Decrement AC by 1
Skipcond 400 / Skip next instruction if AC = 0
Jump Loop1 / Repeat loop when AC > 0
Load One / Start AC in 1
Store Index / Save AC as current index
Loop2, Load Index / Load current index
Output / Print current index value
Add One / Increment AC by 1
Store Index / Update current index with value in AC
Subt Num / Compare index with read Num
Skipcond 800 / Skip next instruction if AC > 0
Jump Loop2 / Repeat loop when AC < Num
Halt / End program
Num, Dec 0
Index, Dec 0
One, Dec 1