mardi 11 septembre 2018

LC-3 Conditionals (New to this)

I have to write a program that asks for 3 positive numbers (less than 10). Then output the largest and smallest number. I feel like I'm at a dead end, and have no idea what to do next. Any Help will be greatly appreciated.

.ORIG x3000

LEA R0, MyNameID ;Show name and ID

PUTS

LEA R0, EnterNum1 ;Print enter number 1

PUTS

GETC R1

OUT

LEA R0, EnterNum2 ;Print enter number 2

PUTS

GETC R2

OUT

LEA R0, EnterNum3 ;Print enter number 3

PUTS

GETC R3

OUT

halt

MyNameID .STRINGZ "\nName, ID number: "

EnterNum1 .STRINGZ "\nPlease enter number 1:"

EnterNum2 .STRINGZ "\nPlease enter number 2:"

EnterNum3 .STRINGZ "\nPlease enter number 3:"

SmallestNum .STRINGZ "\nThe smallest number is:"

LargestNum .STRINGZ "\nThe largest number is:"

.end

Aucun commentaire:

Enregistrer un commentaire