MARIE assembly language

Thread Starter

m8763

Joined Dec 2, 2008
6
The following is what I came up with as an answer.

Load x
Subt one
Skipcond 800
Jump Next
Load x
Add x
Store y


Clear
Store x

Load y
Add one
Store y

Next, Halt
x, dec 20
y, dec 10
one, dec 1

Can anyone correct my mistakes, if any, please?
 

beenthere

Joined Apr 20, 2004
15,819
In my very limited knowledge of assemblers, MARIE is absolutely new. My experience with assembly language is that you have to be fully conversant with the processor and its instruction set in order to write code. The assembler imposes constraints as to syntax acceptable to itself, but has very little to do with the actual functioning of the code.

Your directives would never get parsed correctly by any assembler I have used, but I don't have any knowledge of MARIE. It is otherwise conventional to begin with an ORG statement to tell the assembler where the code block is to start. One follows with directives that EQUate labels to fixed addresses, and so on.
 
Last edited:

atferrari

Joined Jan 6, 2004
4,771
Is it MARIE currently in use? What micros?

Hi BT,

The OP seems to be asking about syntax only, isn't it?
 
Last edited:

Thread Starter

m8763

Joined Dec 2, 2008
6
This is the best solution with comments:

If, Load X / Load X
Subt One / Subtract 1, store result in AC
Skipcond 800 / If AC>0 (X>1), skip the next instruction
Jump Endif / Jump to Endif if X is not greater than 1
Then, Load X / Reload X so it can be doubled
Add X / Double X
Store Y / Y= X + X
Load Zero / Move 0 into AC
Store X / Set X to 0
Endif, Load Y / Load Y into AC
Add One / Add 1 to Y
Store Y / Y = Y + 1
Halt / Terminate program
X, Dec ? / X has starting value, not given in problem
Y, Dec ? / Y has starting value, not given in problem
One, Dec 1 / Use as a constant
Zero, Dec 0 / Use as a constant
 

RiJoRI

Joined Aug 15, 2007
536
Is it MARIE currently in use? What micros?
Found on Giggle:
# Our model computer, the Machine Architecture that is Really Intuitive and Easy, MARIE, was designed for the singular purpose of illustrating basic computer system concepts.
# While this system is too simple to do anything useful in the real world, a deep understanding of its functions will enable you to comprehend system architectures that are much more complex. (Emphasis added)
Training wheels?

And for the OP, look up MarieSim, and put your code through that.

--Rich
 
Top