Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

For LMC, write assembly code to add two numbers and then subtract a third number

ID: 3673562 • Letter: F

Question

For LMC, write assembly code to add two numbers and then subtract a third number (the subtraction answer should be positive)

Mailbox         Mnemonic    Instruction Description

00                   

01                   

02                   

03                   

04                               

05                   

06                   

07                   

08                   

09                   

10                   

11                   

12                   

—————————————————————————

98                    DAT 00            data

99                    DAT 00            data

Explanation / Answer

Hi below i have written a sample LMC for your reference which adds two numbers,

IN

STO A

IN

ADD A

OUT

HLT

A DAT

ADDS THE FIRST NUMBER INPUT TO ITSELF,
THEN SUBTRACTS THE SECOND INPUT FROM THE TOTAL

00 IN;
01 STA 90;
02 IN;
03 STA 91;
04 LDA 90;
05 ADD 90;
06 SUB 91;
07 OUT;
08 HLT;

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote