Loops 我的MARIE-Sim跳转功能无法正常工作
我目前正在研究玛丽模拟器,我正试图得到三个输入的小数,并将它们相乘。我将代码保存为.mas并尝试将其组装。它说我有一个错误,但是程序集列表完全是空的!我发现,当我从代码中删除跳转操作时,代码会进行汇编和运行,但是,我需要跳转来获得正确的答案。我看到的每一个地方,跳转都是我写的,所以我不知道我是否错了,我的Sim卡是否被窃听了,或者是什么Loops 我的MARIE-Sim跳转功能无法正常工作,loops,assembly,simulation,marie,Loops,Assembly,Simulation,Marie,我目前正在研究玛丽模拟器,我正试图得到三个输入的小数,并将它们相乘。我将代码保存为.mas并尝试将其组装。它说我有一个错误,但是程序集列表完全是空的!我发现,当我从代码中删除跳转操作时,代码会进行汇编和运行,但是,我需要跳转来获得正确的答案。我看到的每一个地方,跳转都是我写的,所以我不知道我是否错了,我的Sim卡是否被窃听了,或者是什么 ORG 100 /Starting point // Gustavo Brandao. No Partners Input /Req
ORG 100 /Starting point // Gustavo Brandao. No Partners
Input /Request user input for first number
Store NumA /Store the number
Output /Display number to screen
Input /Request user for a second number
Store NumB /Store number
Output /Display number
Input /Request user for third number
Store NumC /Show number
Output /Display number
Loop, Load NumA /Load the first number, will also loop from here
Add Sum /Add with zero and location which will save the sum
Store Sum /Store the sum
Load NumB /Load the second number for the skip condition control
Subt One /decrement the number
Store NumB /Store the number. when 0, code will skip the jump
Skipcond 000 /Skip when the second number reaches zero
Jump Loop /Used to repeat addition until second number reaches zero
Load Sum
Store NumA /Storing sum in NumA slot to make code easier to read
Loop, Load NumA /Loading the previous sum
Add FSum /Adding previous sum to zero and final sum location
Store FSum /Storing final sum
Load NumC /Second skip condition control
Subt One /decrememting number
Store NumC /Storing skip condition
Skipcond 000 /When the third inputed number is zero, loop will end
Jump Loop /Loops back to second part of code
Load FSum /load the final sum for output
Output /Display final sum
HALT
NumA, Dec 0 /First number; Will be overwritten with input
NumB, Dec 0 /Second number
NumC, Dec 0 /Third number
Sum, Dec 0 /Stores the sum for the first multiplication process
FSum, Dec 0 /Stores sum for the second multiplication process
One, Dec 1 /Used to decrement values
所以我才意识到我不能在程序中有两个“循环”,因为它无法识别跳转到哪个。我把第二个命名为Loop2,它成功了。我得到了错误的答案,但这并不是一个小小的调整无法解决的问题,所以我才意识到我不能在程序中有两个“循环”,因为它无法识别要跳转到哪个。我把第二个命名为Loop2,它成功了。我得到了错误的答案,但这不是一个小小的调整无法解决的问题您有两次定义
循环
标签吗?允许吗?您已经定义了两次循环标签了吗?允许吗?