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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T03:21:01+00:00 2026-05-31T03:21:01+00:00

Hi i have redirected divide overflow interrupt to point at my custom created interrupt

  • 0

Hi i have redirected divide overflow interrupt to point at my custom created interrupt which prints ‘hello man here i am’ on the screen, instead it print weird ascii characters. Can someone tell me why? here is the code

[ORG 100h]
jmp start
message:    dw      'hello man here i am'


prntstr:    push ax
            push bx
            push cx
            push dx
            push si
            push di
            push bp
            push ds
            push es
            push cs
            pop ds

            mov ah, 0x13
            mov al, 1
            mov bh, 0
            mov bl, 7
            mov dx,0x0a03
            mov cx,11
            push cs
            push es
            mov bp,message
            int 0x10
            pop es
            pop ds
            pop bp
            pop di
            pop si
            pop dx
            pop cx
            pop bx
            pop ax
            ret
tsr:        mov ah, 0
            int 0x16
            call prntstr
            iret
            ;mov ah,4ch
            ;mov al, 6
            ;int 0x21
            ;iret


divs:       mov ax,0x8569
            mov dl,2
            div dl
            ret


start:      xor ax,ax
            mov es,ax
            mov word[es:0*4], tsr
            mov [es:0*4+2],cs
            call divs

            mov ax,0x4c00
            int 0x21

one more thing i do not understand about the code is where i set offset at es:0*4 — i assument that 00 is the location of the divide overflow interrupt? what is the 0*4 for coz anything multiplied by zero would mean the same, so why the 4 ? 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-05-31T03:21:02+00:00Added an answer on May 31, 2026 at 3:21 am

    As to you weird character problems, I think:

    push cs
    push es
    

    should be:

    push cs
    pop  es
    

    Otherwise:

    1. Your pushes and pops are unbalanced.
    2. Your es segment register is not set up for es:bp to point to the message correctly. It will print whatever is at offset message in the segment es was pointing to when your interrupt fired rather than in the code segment where your actual message is.
    3. It will also eventually crash.

    For the 0*4 issue, I’m not sure. It’s been a while since I did x86 but I know you can scale indirect addressing modes such as with:

    mov eax, dwarray[edx*4]
    

    to ensure the correct memory locations are accessed. This scaled edx up to the correct value before adding to the dwarray base address.

    I don’t think that was needed for immediate offsets though, so I suspect it was just boilerplate code for being able to change any interrupt by just replacing the 0 with the relevant interrupt number.

    And, as an aside, you probably don’t want to be changing interrupt vectors without ensuring that interrupts are disabled during the process. If an interrupt fires after you’ve written the offset of tsr, but before you’ve written the segment, the results will not be pretty.

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

Sidebar

Related Questions

i have created a dashboard to which all my users are being redirected to
1) I have created a custom object Hello . Added two lookup fields to
I have page which is redirected from htaccess. now I can pass the German
I have a form which is supposed to be redirected to order success page
I have an hosting account on Godaddy which has been redirected for last few
I have a batch file which calls a java program. The output is redirected
I have a website where all requests are redirected silently (via .htaccess ) to
I have a (wordpress) blog where after commenting the users are redirected back to
I need to have : http://www.example.com/v1/my-project/ redirected to http://example.com/my-project/ so : (1) remove the
i have 2 pages : Login.aspx and Satis.aspx. i redirected from Login.aspx to Satis.aspx

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.