PLEASE READ . I WANT TO Write a program to multiply and divide two numbers on the MARIE Program

Thread Starter

Dũng Hồ

Joined Oct 16, 2019
4
hi DH,
Welcome to AAC.
As this is Homework, please post your attempt at solving the problem, we can then guide you.
E
I WANT TO Write a program to multiply two numbers
and divide two numbers in the MARIE Program
 
Last edited by a moderator:

Thread Starter

Dũng Hồ

Joined Oct 16, 2019
4
hi DH,
Welcome to AAC.
As this is Homework, please post your attempt at solving the problem, we can then guide you.
E
INPUT
Store X
INPUT
Store Y
loop ,Load num
Add X
Store num

Load Y

Subt one

Store Y

Skipcond 400

Jump loop

Load num

Output

Halt

X, DEC 0

Y, DEC 0

one, DEC 1

num, DEC 0
 

absf

Joined Dec 29, 2010
1,968
Code:
    ORG 100
    INPUT        /input from KBD to AC
    Store X        /store in X
    INPUT        /2nd input
    Store Y        /store in Y
loop ,    Load num    /get num
    Add X        /AC=num+X
    Store num    /num=AC
    Load Y
    Subt one 
    Store Y        /Y=Y-1
    Skipcond 400    /Is Y=0?
    Jump loop    /NO, JMP loop

    Load num    /YES, output num
    Output
    Halt

X,       DEC 0        /let X=6
Y,       DEC 0        /let Y=5
one,     DEC 1
num,     DEC 0
Please use code tags.
 
Last edited:
Top