Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9243013
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T08:42:48+00:00 2026-06-18T08:42:48+00:00

Working on a project. Professor gave us a .zip file with some tests, so

  • 0

Working on a project. Professor gave us a .zip file with some tests, so we can see if our project is working correctly. We are building a small kernel in c++.

Anyhow, there is a thread that waits for a keyboard interrupt (event9.wait()) and after that it should put characters in a buffer or end the program (if you press “esc”).

while (!theEnd) {

        event9.wait();

        status = inportb(0x64); // reading status reg. from 64h
        while (status & 0x01){ //while status indicates that keys are pressed
                ....

I checked and I am certain that it waits for the interrupt regularly. The problem occurs because status&0x01 is 0.

Then I got the part of code that gets the characters from 0x60 and it worked just fine.

Is there something wrong with the code of test files? And if yes, what? If the code is correct what could cause the problem?

I could change the test files, but I need a good reason to do so. And so far the only reason I have is that it doesn’t work.

*note: comments are translated from Serbian, but I am almost certain they are translated correctly.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T08:42:50+00:00Added an answer on June 18, 2026 at 8:42 am

    I think status & 0x01 is perfectly fine. However, you would need to read the port again after reading port 0x60 – it may well be that you do that later on in the code, but I personally would just re-write the code to:

        while ((status = inportb(0x64)) & 0x01){ //while status indicates that keys are pressed
                ....
    

    Note that you shouldn’t read port 0x64 again inside the loop in this case.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

While working a project tonight, I ended up using one .js resource file for
I'm working on a large-size dual AS3/Flex project (some parts are pure AS3, other
So basically I am working on a class project where we make our own
I'm working on a project for an embedded processor where I have some data
List the name of division that ALL employees are working on some project(s). Namly,
Preface: This question is about a project I am working on with a professor
I am currently working on a research project for my Finance professor, and I
I'm working on a project for class, and the professor wants us to use
I am working on a VC++ project under VS2008. My resource files contain some
I had a working project. After rearranging some code, I tried to recompile my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.