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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T11:42:24+00:00 2026-05-22T11:42:24+00:00

There is an assembly language command: add dl, 48d What is the exact purpose

  • 0

There is an assembly language command:

add dl, 48d

What is the exact purpose and meaning of this assembly language statement? When I write the code

mov al, 02
mov dl, al
mov ah, 02
int 21h

it gives output as b. But when I write,

mov al, 02
mov dl, al
add dl, 48d
mov ah, 02
int 21h

it gives 2 as output. What is this statement doing, exactly?

  • 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-22T11:42:25+00:00Added an answer on May 22, 2026 at 11:42 am

    Looks like x86 assembler. This command is adding 48 (48 decimal) to the content of the lower 8 bit of the (E)DX register. See x86 general purpose registers, but for real explanations see the x86 Wikipedia page, section “x86 registers”.

    On x86, you can access parts of a register. Historically, this was done so that the 8086 (16 bit registers) was as compatible as possible with the 8080 (8 bit registers). That scheme was then extended on the 80286/80386 with 32 bit registers and then again to 64 bit in the AMD x64 mode.

    So you can access the whole 32 bit register as EDX (when in protected mode) and the lower 16 bit register as DX. Now this 16 bit part (DX) is further divided into two parts: the upper 8 bit are accessed as DH, the lower 8 bit as DL.

    Edit after the question was edited:

    Let’s explain the cited code from back to front: at the end, interrupt 21hex is called which on IBM PC compatible systems is responsible for various DOS API calls. Setting the 8 bit register AH to 2 results in character output to be executed. The character to output resides in 8 bit register DL.

    So in your first example the ASCII character 02 is printed, but that is a control character so the output shouldn’t be b as you state it is but something invisible (02 is start of text). The second example takes the 2, then adds 48 which gives 50 (decimal). That’s the ASCII code for the character 2.

    My god, I really feel old now… I’ve done that stuff 20 years ago.

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

Sidebar

Related Questions

This is a somewhat low-level question. In x86 assembly there are two SSE instructions:
Is there a way to add assembly attributes to a Managed C++ assembly? In
Why is assembly language code often needed along with C/C++ ? What can't be
There is a pdf version of assembly language instructions reference from intel , but
I am reading the book Art of Assembly Language . There I came across
I wonder if there exists some kind of universal and easy-to-code opcode (or assembly)
There are three assembly version attributes. What are differences? Is it ok if I
I would like to know how .NET teams out there are handling assembly reference
Any assembly interpreters out there? What I'm looking for: I have some assembly firmware
There is very strange assembly reference problem and loading problem I experience with 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.