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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T03:22:44+00:00 2026-06-16T03:22:44+00:00

What means this segment: MOV SI,SP PUSH AX POP ES How does ES get

  • 0

What means this segment:

MOV     SI,SP
PUSH    AX
POP     ES

How does ES get 0000:7c00 (and further DS)

In this MBR model?

0000:7C00 FA            CLI                     disable int's
0000:7C01 33C0          XOR     AX,AX           set stack seg to 0000
0000:7C03 8ED0          MOV     SS,AX
0000:7C05 BC007C        MOV     SP,7C00         set stack ptr to 7c00
0000:7C08 8BF4          MOV     SI,SP           SI now 7c00
0000:7C0A 50            PUSH    AX
0000:7C0B 07            POP     ES              ES now 0000:7c00
0000:7C0C 50            PUSH    AX
0000:7C0D 1F            POP     DS              DS now 0000:7c00
0000:7C0E FB            STI                     allow int's
0000:7C0F FC            CLD                     clear direction
0000:7C10 BF0006        MOV     DI,0600         DI now 0600

I released that it’s like some special case (or undocumented procedure) – before and after interruption CLI / STI , is blocked.

/upd
source added: http://www.nondot.org/sabre/os/files/Booting/mbr.txt

  • 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-16T03:22:45+00:00Added an answer on June 16, 2026 at 3:22 am

    Here’s my interpretation of the code:

    0000:7C00 FA        CLI               disable int's
    0000:7C01 33C0      XOR     AX,AX     AX = 0x0000
    0000:7C03 8ED0      MOV     SS,AX     SS = 0x0000
    0000:7C05 BC007C    MOV     SP,7C00   SS:SP = 0x0000:0x7C00
    0000:7C08 8BF4      MOV     SI,SP     SI = 0x7C00
    0000:7C0A 50        PUSH    AX
    0000:7C0B 07        POP     ES        ES = 0x0000
    0000:7C0C 50        PUSH    AX
    0000:7C0D 1F        POP     DS        DS = 0x0000
    0000:7C0E FB        STI               allow int's
    0000:7C0F FC        CLD               clear direction
    0000:7C10 BF0006    MOV     DI,0600   DI = 0x0600
    
                        MOV CX,0100       CX = 0x0100
                        REP MOVSW         Copy 256 words (512 bytes)
                                            from 0x0000:0x7C00 to
                                            0x0000:0x0600
                        JMP ??            Jump to relocated code
    

    I made up the last 3 instructions; but I can almost guarantee this is what the actual MBR does. The reason for this is that the MBR normally loads an OS’s boot sector at 0x7C00 and can’t overwrite itself, and therefore has to relocate itself first.

    I don’t know why they didn’t use MOV ES,AX and MOV DS,AX instead of push/pop. Both versions cost 2 bytes though (e.g. 2 bytes for MOV ES,AX vs. one byte for PUSH AX plus another byte for POP ES) so the difference is irrelevant (code size is the most important thing when you’ve only got 512 bytes to use and 66 of them must be partition table and magic signature at the end).

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

Sidebar

Related Questions

I got this code from the wordpress <head profile=http://gmpg.org/xfn/11> What does this means? what
Does anyone know why this code doesn't work. This means, the alert is NOT
For example, in JavaScript, !important means 'not important'. In CSS, it means 'this is
I have no idea what this means. But here is the code that it
If I understand it correctly this means extern void foo(); that the function foo
Can someone please tell me what this means: 07-04 09:54:38.048: I/DetailActivity(15496): Title that is
Please have a look at the following machine code ‎0111001101110100011100100110010101110011011100110110010101100100 This means something. I
NOTE: I'm using a BSD based system so if I remember correctly this means
I have my dot files in Github publicly. This means that I have only
I think beestings change the html every time. this means html is not able

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.