Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Review the official documentation for the Irvine library function ReadKey (http:

ID: 3687618 • Letter: R

Question

Review the official documentation for the Irvine library function ReadKey (http://programming.msjc.edu/asm/help/source/irvinelib/readkey.htm). After you have reviewed the documentation and developed an understanding for how this function operates, write an assembly program that passively scans keyboard inputs and displays the following information on the screen as each key is pressed:

8-bit ASCII Code

8-bit Virtual Scan Code

16-bit Virtual Key Code

32-bit Keyboard Flags

Display a formatted label for each of the previously mentioned items. Display the 8-bit ASCII code as a character symbol. Display the Virtual Scan Code and Virtual Key Code as integers. Show the Keyboard flags as a binary string representation of 0s and 1s. Attempt to determine which bits are controlled by the various control keys on the keyboard (i.e. the Shift, Alt, and Control keys would all trigger a flag to raise when depressed). As you begin mapping out control flags, create an aesthetic on your program's output that provides any sort of visual cue indicating the control key depressions along with their associated bits in the Keyboard Flags.

As your program runs, the display should update each time a new key is pressed with information about the current state of the keyboard. The program should cycle in an infinite loop.

Explanation / Answer

#include //including sfr registers for ports of the controller #include //LCD Module Connections sbit RS = P0^0; sbit EN = P0^1; sbit D0 = P2^0; sbit D1 = P2^1; sbit D2 = P2^2; sbit D3 = P2^3; sbit D4 = P2^4; sbit D5 = P2^5; sbit D6 = P2^6; sbit D7 = P2^7; //End LCD Module Connections //Keypad Connections sbit R1 = P1^0; sbit R2 = P1^1; sbit R3 = P1^2; sbit R4 = P1^3; sbit C1 = P1^4; sbit C2 = P1^5; sbit C3 = P1^6; sbit C4 = P1^7; //End Keypad Connections void Delay(int a) { int j; int i; for(i=0;i
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote