MARIEプログラムを使用してアセンブリを学んでいますが、本からこの質問をするのが難しいことがわかりません:
ある数値を別の数値で割り、商と剰余を 2 つの異なるメモリ ロケーションに格納します。
これは私がこれまでに持っているものです。何が間違っていますか? 参考までに、プログラムには除算や乗算が組み込まれていないため、ループを使用して実行する必要がありますが、何かが足りないと思います。
プログラムはここにあります http://computerscience.jbpub.com/ecoa/2e/downloads/MarieSim-v1.3.01.zip
ORG 100
Input / Enter a number
Store X / Saves the number
Input / Enter a number
Store Y / Saves the number
Load Zero / Move 0 into AC
Store Z / Set Z to 0
If, Load Z / Load Z
Skipcond 400 / If AC=0 (Z=0), skip the next instruction
Jump Endif / Jump to Endif if X is not greater than 1
Then, Load X
Subt Y / X - Y
Store X / X = X - Y
Endif, Load Z / Load Z into AC
Add One / Add 1 to Z
Store Z / Z = Z + 1
Output / Print to screen
Halt / Terminate program
X, Dec 0 / X has starting value
Y, Dec 0 / Y has starting value
Z, Dec 0
One, Dec 1 / Use as a constant
Zero, Dec 0 / Use as a constant
END