0

I'm trying to create a calculator in MARIE Assembly Language. After some brain storming, I have addition, subtraction, and multiplication codes. I'm completely new to this language and would like to get some help on how to get started. Any help will be appreciated. Thanks

ORG 100 /Start
Input
Store A
Input
Store B
Load A /Put Number A into AC
Subt B /Substract from AC
Store Sum /Save sum
Output
Halt /End program
A, Dec 0 / values
B, Dec 0 / values
Sum, Dec 0 / Result, initially 0 overwritten by code
END


ORG 100 /Start
Input
Store A
Input
Store B
Load A /Put Number A into AC
ADD B /Add from AC
Store Sum /Save sum
Output
Halt /End program
A, Dec 0 / values
B, Dec 0 / values
Sum, Dec 0 / Result, initially 0 overwritten by code
END

Input /Input A value
Store A
Input /Input B value
Store B
Loop, Load B
Skipcond 800 If AC > 0, continue loop
Jump Endloop
Subt One
Store B
Load C
Add A
Store C
Jump Loop
Endloop, Load C
Output
Halt
C, DEC 0
A, DEC 0
B, DEC 0
One, DEC 1

2
Contributors
1
Reply
3
Views
8 Years
Discussion Span
Last Post by faisal977
0

ORG 100
Load One
Store X
Loop, Load X
Subt Ten
SkipCond 000
Jump Endloop
Add X
Store Sum
Load X
Add One
Store X
Jump Loop
Endloop,Load Sum
Output
Halt
Sum, Dec 0
X, Dec 0
One, Dec 1
Ten, Dec 10
END

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.