0AEC:0100 33C0 XOR AX,AX
0AEC:0102 8ED0 MOV SS,AX
0AEC:0104 BC007C MOV SP,7C00
0AEC:0107 FB STI
0AEC:0108 50 PUSH AX
0AEC:0109 07 POP ES
0AEC:010A 50 PUSH AX
0AEC:010B 1F POP DS
0AEC:010C FC CLD
hello every, i'm new to os.i hope all you can help me,thanks...
the code above is windows mbr begin code. the answer i want to know is
why use STi before Push ax pop es push ax pop ds.
Something about windows MBR
-
nirvana111
- Posts: 20
- Joined: Wed Jun 21, 2006 7:55 am
- Location: China
generally it is a good idea to always have interupts enabled as much as possible
therefore, before doing anything that doesnt require interupts to be dissabled, they make sure they are
if this is at the begining, do not assume interupts are enabled when the bootsector is called -- its not required, so the MBR is making sure by enabling them itself
just a guess, been a long time since i looked at the MBR ASM, and you didnt give much context
btw:
your formatting indicates that your using debug to unasseble it?
it might help if you loaded it to the same address it expects to be at before (U)nassebling -- also be aware -- debug is not aware of the 386 extensions -- therefore, it may not always unassemble correctly -- as most of those instructions work just fine in RMode (though it will usually be obvious as there will be a data byte in the instruction stream -- but instructions beyond that cannot be relied on, as overrides will alter the length and operation of the following instruction)
therefore, before doing anything that doesnt require interupts to be dissabled, they make sure they are
if this is at the begining, do not assume interupts are enabled when the bootsector is called -- its not required, so the MBR is making sure by enabling them itself
just a guess, been a long time since i looked at the MBR ASM, and you didnt give much context
btw:
your formatting indicates that your using debug to unasseble it?
it might help if you loaded it to the same address it expects to be at before (U)nassebling -- also be aware -- debug is not aware of the 386 extensions -- therefore, it may not always unassemble correctly -- as most of those instructions work just fine in RMode (though it will usually be obvious as there will be a data byte in the instruction stream -- but instructions beyond that cannot be relied on, as overrides will alter the length and operation of the following instruction)
-
nirvana111
- Posts: 20
- Joined: Wed Jun 21, 2006 7:55 am
- Location: China
- AndrewAPrice
- Member

- Posts: 2327
- Joined: Mon Jun 05, 2006 11:00 pm
- Location: USA (and Australia)
Re: Something about windows MBR
Don't loose sleep over it, it's Microsoft after all.nirvana111 wrote:the code above is windows mbr begin code. the answer i want to know is why use STi before Push ax pop es push ax pop ds.
-
nirvana111
- Posts: 20
- Joined: Wed Jun 21, 2006 7:55 am
- Location: China
- carbonBased
- Member

- Posts: 389
- Joined: Sat Nov 20, 2004 12:00 am
- Location: Wellesley, Ontario, Canada
- Contact: