Mastering LC-3: Create a Number Guessing Game Lab Report

School
Kean University**We aren't endorsed by this school
Course
BIO 1400
Subject
Computer Science
Date
Dec 12, 2024
Pages
4
Uploaded by CoachField15629
Laboratory ReportCourse ID:CPS 2390Lab Input & Output with LC-3: 5Student:Hailey HerreraInstructor: Dr. Jing-Chiou LiouDate:10/24/24
Background image
Description :This LC-3 program was made to have the user guess a number as they inputcharacters up to 9 guesses. The character is 6 so I will use branchesdepending on the value of the number that is left over at the end. Ifnegative then it will be too big. If it’s positive then it will be too bigand zero will be justright.System configuration :COMPUTER :ROG Zephyrus M15 GU502LU_GU502LUPROCESSOR :Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz2.59 GHzOPERATING SYSTEM :Windows 11 Home, 23H2LOCATION :1000 Morris ave Upperclassmen hallLC-3 USED :LC3 edit and simulateProcedure & Notes :Key colors :Step 1 :When user inputs a 7 there will be a message that says it istoo bigStep 2 :when user inputs 3 there will be a message that tells them itis too smallStep 3 :lastly when user inputs 6 it will be correct.Step 4 :code uses IN and PUTS (mentioned in slides)MACHINE CODE :.ORIG X3000AND R0, R0, #0AND R1, R1, #0AND R2, R2, #0AND R3, R3, #0LD R2, SIXLD R3, COUNTERINADD R1, R0, #0ADD R0, R1, R2
Background image
BRn TOOLOWBRp TOOHIGHBRz GGAGAIN:INADD R1, R0, #0ADD R0, R1, R2BRn TOOLOWBRp TOOHIGHBRz GG;if its 0 it will subtract 6TOOLOW:;too low when number is negLEA R0, LOWPUTSADD R1, R0, #0ADD R3, R3, #1ADD R0, R3, #-9BRn AGAINBRz LOSETOOHIGH:;when the number is too highLEA R0, HIGHPUTSADD R1, R0, #0ADD R3, R3, #1ADD R0, R3, #-9;subtracting 9 againBRn AGAINBRz LOSEGG:ADD R3, R3, #1LEA R0, WINPUTSAND R3, R3, #0ADD R3, R3, R0PUTSLEA R0, WIN2PUTSHALTLOSE:LEA R0, GAMEOVERPUTS
Background image
HALTSIX .FILL #-54COUNTER .FILL #0LOW .STRINGZ "Too small."HIGH .STRINGZ "Too big."WIN .STRINGZ "Correct!"WIN2 .STRINGZ " It was 6!!!!"GAMEOVER .STRINGZ "Game over. Correct answer is 6.".ENDRegisters :R0 :Mainly holds the message and what will be displayed in the consoleat the endR1 :Holds the users inputR2 :Holds the number 6 to check if it will be to high or too lowR3 :Holds the counter and tracks the amount of times user has guessedIssues encountered:I didn’t really know too much about output and input since the lastlab. I struggled a lot with it but I feel a little more confident after thislab.Results and Reports :Reference and Acknowledgement★ The book, idk just wishful thinking for the final really just a lot ofgoogle and trying to read
Background image