Am suppose to exit a loop when ctrl+d(x04) is typed in lc-3
so I’m trying to detect this from console input by using getc.
Is there a easy way doing this?
Or I have to convert input to a negative number and add with x04?
Can some one help me?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The easiest way to do this is to check R0 to see if it is set to 4.
A marginally easier way would be to simply add -4 to the input rather than inverting the input and adding +4.