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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T13:00:37+00:00 2026-06-04T13:00:37+00:00

I have a program reading characters in raw mode. That is, any characters input

  • 0

I have a program reading characters in raw mode. That is, any characters input are read immediately instead of being buffered.

I would like to know how to perform a backspace. That is, when I press the Backspace key, it should delete the character on the left and move the cursor one place to the left.

I have tried outputting a Backspace character followed by a Space character. This deletes the character on the left, but moves the cursor two spaces to the right, for some reason.

I have also tried outputting the Backspace character by itself. This moves the cursor one space to the left, but doesn’t delete the character.

My assembler is YASM and I am using 64-bit Linux. Below is some relevant code.

First, here’s the function I use to output a character:

printchar:                       
        mov     [buf], al      ; Backup whatever was in al.
                               ; buf is declared as resb 1 in section .bss
        mov     edx, 1
        mov     ecx, buf
        mov     ebx, 1
        mov     eax, 4
        int     0x80
        mov     al, [buf]    ; restore char that was previously in al
        ret

The following code prints a Backspace. It doesn’t move the cursor one place to the left, like your regular Backspace does.

    mov     al, 0x08 ; ASCII for Backspace
    call    printchar

This code prints a Backspace followed by a Space. It moves the cursor TWO spaces to the right instead of just one.

    mov     al, 0x08 ; ASCII for Backspace
    call    printchar
    mov     al, 0x20 ; ASCII for Space
    call    printchar

Len suggested printing a Backspace, followed by a Space, followed by a Backspace. This seems to work:

    mov     al, 0x08 ; ASCII for Backspace
    call    printchar
    mov     al, 0x20 ; ASCII for Space
    call    printchar
    mov     al, 0x08 ; ASCII for Backspace
    call    printchar

Please note that, as I previously mentioned, I am reading characters in raw mode. Thanks in advance!

  • 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-04T13:00:38+00:00Added an answer on June 4, 2026 at 1:00 pm

    I have also tried outputting the Backspace character by itself. This moves the cursor one space to the left, but doesn’t delete the character.

    You’re almost there! Try outputting a backspace, then a regular space to black out the character the cursor is now on top of, then another backspace to move the cursor back once again.

    It seems like a hack, but it’s actually quite common!

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

Sidebar

Related Questions

I have a C++ program that is reading in info from a file, that
I have a Pygame program that needs text input. The way it does this
I have a program that should read from a file.It reads some amount of
I have a simple RabbitMQ test program randomly enqueuing messages, and another reading them,
I have program that has a variable that should never change. However, somehow, it
I have program, that must interact with a console program before my program can
I have program that runs fast enough. I want to see the number of
I have a program that works with a variety of files on both the
I have a program that only allows one instance of itself to run. I
I have a program which I would like to run every X min the

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.