Write short assembly programs


1. Verifying Triangle Numbers
This problem tests your ability to write short assembly programs that utilize branching/control structures
You are given the task of determining whether a certain number entered by a user is a triangle number. A triangle number is the number of objects needed to form a triangle. For instance, think about the arrangement of bowling pins: there are tens pins required, and they are placed in the shape of a triangle. See the following links if you desire more information: Triangle Number (Wikipedia), Triangle Number (Wolfram MathWorld), Ten-pin Bowling (Wikipedia)
Assumptions:
Your subroutine will begin at memory location 0x3000
All registers except R1 are storing 0.
The number entered by the user has already been processed and stored in register R1.
The number entered by the user is nonzero and positive.
You are to write the subroutine (in LC-3 assembly) that determines if the number entered by the user is a triangle number. If this number is a triangle number, store 1 in register R4. If the number is not a triangle number, store 0 in register R4. The program should then halt.

Request for Solution File

Ask an Expert for Answer!!
Electrical Engineering: Write short assembly programs
Reference No:- TGS0426610

Expected delivery within 24 Hours