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

  • Home
  • SEARCH
  • 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 6612527
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T20:06:33+00:00 2026-05-25T20:06:33+00:00

I am prigramming in assembly Language, x86 in C++ and I need to know

  • 0

I am prigramming in assembly Language, x86 in C++ and I need to know the getch equivalent in assembly language instead of C++ language as I dont want to use any function from the C++ programming language.

I found the code on the web but it saves the given value to a variable and created in C++. I want to use the function only to stop the program until any key is pressed. I dont have to use the entered key value in further programming.

  • 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-05-25T20:06:33+00:00Added an answer on May 25, 2026 at 8:06 pm

    This is an OS-specific question. For example if you’re using Linux, you can issue a read system call like this:

    ; Allocate some stack buffer...
    sub esp, 256
    
    mov eax, 3      ; 3 = __NR_read from <linux/asm/unistd.h>
    mov ebx, 0      ; File descriptor (0 for stdin)
    mov ecx, esp    ; Buffer
    mov edx, 256    ; Length
    
    int 80h         ; Execute syscall.
    

    This is actually the more antiquated way to issue a syscall on x86 Linux, but it’s the one I know off the top of my head. There’s also sysenter which is faster. And there is a shared library mapped into every process that abstracts the syscall interface based on what your hardware supports. (linux-gate.so.)

    As a matter of taste, I would argue against the approach of doing system calls from assembly language. It is much simpler to do it from C. Call into the assembly code (or produce inline assembly) for the stuff that absolutely needs to be in assembly language. But in general for most practical matters you will find it better not to waste your time talking to OS interfaces in assembly. (Unless it’s a learning exercise, in which case I’m all for it.)

    Update: You mentioned as a comment to @Anders K. that you are writing something to put on the MBR. You should have mentioned this earlier in the question. One approach is to use a BIOS call: I believe the one you want is int 16h with ah=0. Another would be to install a keyboard interrupt handler. Here’s what the BIOS call would look like:

    xor ah, ah    ; ah = 0
    int 16h       ; call BIOS function 16h
    
    ; al now contains an ASCII code.
    ; ah now contians the raw scancode.
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am studying x86 assembly language via the book called Programming from the Ground
Question: I want code for: syntax highlighting (of programming languages) Language: C# or assembly
I've been programming for x86 & x86-64 in assembly language for few months. Now,
I'm going through a book focusing on x86 programming (Professional Assembly Language, WROX 2005).
I've recently picked up Michael Abrash's The Zen of Assembly Language (from 1990) and
I know that assembly language is typically not cross-platform. And even with things like
In assembly language programming, what (if anything) prevents a stack from growing until it
Possible Duplicate: Is there any reason to use C instead of C++ for embedded
I want to learn how to programming with assembly language for 8086/88 processor, but
Lets say I want to create a new programming language or use some language

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.