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 6803937
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T19:24:19+00:00 2026-05-26T19:24:19+00:00

I’ve read about the code to make the computer beep but I can’t get

  • 0

I’ve read about the code to make the computer beep but I can’t get it to work. The following code asks the user to enter digits. The digits are displayed on the screen but if the user types a non-digit character it’s supposed to beep. When I run the program and type a non-digit character, it just crashes.

INCLUDE Irvine32.inc

.data

enterDigits     BYTE        'Please type some digits: ', 0

.code

main PROC

    mov EDX, OFFSET enterDigits
    call    WriteString

L1:</b>

    call    ReadChar
    cmp AL, 0Dh
    je  FINISHED
    cmp AL, 30h
    jl  BEEP
    cmp AL, 39h
    jg  BEEP
    call    WriteChar
    loop    L1  

BEEP:</b>

    mov AH, 02h
    mov DL, 07h
    int 21h
    jmp L1

FINISHED:</b>

    call    CRLF
    call    CRLF

exit</b>

main ENDP</b>

END main


If I replace BEEP with:

BEEP:</b>

    mov AL, 33h
    call    WriteChar
    jmp L1

It will print a 3 when you type a non-digit character. Don’t know if that makes any difference or not.

  • 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-26T19:24:20+00:00Added an answer on May 26, 2026 at 7:24 pm

    If you look at the source for WriteChar here, you can see that it is invoking the Windows API WriteConsole method rather than use an MSDOS API. I believe you aren’t going to be able to call a DOS API method because you’re running in a mode incompatible with the kernel managing the hardware and I/O functions.

    You might try adjusting the compatibility mode of your exe to use Windows 95 (right click on EXE, go to Compatibility tab).

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

Sidebar

Related Questions

I need to clean up various Word 'smart' characters in user input, including but
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
Seemingly simple, but I cannot find anything relevant on the web. What is the
I have a French site that I want to parse, but am running into
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and

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.