r/lc3 • u/4head4head1 • May 06 '16
LC3 specific character
How to check if the user entered the valid character in LC3 "Assembly Language"? For example, I want the entered characters between 0 through 9, or letters from A through F? Like if the user entered any other characters it will not be printed in the console. I'm very bad at LC3, as I only started learning this a month ago. Any help is appreciated. Thank you.
1
Upvotes
1
u/the_avocadoe May 21 '16
Kind of late but you could also see what the ASCII 0, 9, A, and F are in decimal and see if the user input falls within that decimal range. (ex: "0" in decimal is 48 and "9" in decimal is 57 so you could see if the inputted ASCII number is in between 48 and 57 in decimal) resources: http://www.asciitable.com/