Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

how to fix my code in assembly language using pep 8 . It needs to do the following. Write a program to add 4 0

how to fix my code in assembly language using pep8.It needs to do the following. Write a program to add 40(decimal) and -10(decimal). There is no input, so these integers should be stored in memory. Output the result. Verify you can do the above program WITH INPUT. There is a video in this weeks module called
Add2Integers. if you could please help me fix the errors
ASCII: ;ERROR: Must have mnemonic or dot command after symbol definition.
.WORD 40
.WORD -10
.WORD 0
BR main
main:
LDA 0, x ; Load 40 into the accumulator
ADD 2, x ; Add -10 to the value in the accumulator
STA 4, x ; Store the result in memory
LDA 4, x ; Load the result into the accumulator
DECO 4, x ; Output the result as a decimal number
STOP ; Stop the program
.END

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions