Boot Sector

Posted on 2004-11-24
Last Modified: 2008-03-06
I'm using asm112 to write a program to floppy boot sector.

Here's the code

        mov     ax,07c0
        mov     ds,ax
        xor     bx,bx
        mov     ah,0e
        mov     si,offset(string)
@1      lodsb
        cmp     al,00
        je      @2
        int     10
        jmps    @1
@2      xor     ah,ah
        int     16
        callf   ffff:0000

string  db      'Sorry, this disk is not bootable.' 0a 0d
        db      'Please insert another disk and press any key to reboot.' 0a 0d 00

THIS works fine. However i want to create it myself in DEBUG. Heres what i'm doing

f 0000 ffff 00; fill address range in debug.
r cx: 01ff;
w 0 0 0 1; write blank address range to floppy boot sec

a0000; start assembling at offset 0000
   mov ax,07c0
   mov ds,ax
   mov es,ax
   mov cs,ax
   mov ss,ax
  db 'Hello World $'
   mov ah,09
   mov dx,offset for db
   int 21
   int 20

rcx: 01ff
w 0 0 0 1

then i clear memory again and reload the floppy boot sector to make sure it
is written.

However when i start the computer with the floppy i get nothing.

Any suggestions. I have tried various things and even used jmp from first address to 003e. and started my code there but no joy still.

PS. I'd offer more points if only i had them.
Question by:Newt6398
    LVL 7

    Expert Comment

    I'm not familiar with your method of writing to the floppy boot sector. Are you sure it is doing its job properly?
    LVL 1

    Author Comment

    Not 100% put i do recall doing it in this way a year or so ago and it worked fine. I'm just missing something crutial. But i cannot remember.
    LVL 11

    Accepted Solution

    Nett6398, theres nothing wrong with writing to the floppy that way.. one point, int 21h is a dos function call and wont be present at boot time ;-) may you should use int 10h

    Have Fun!

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    Suggested Solutions

    Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
    ADCs have gained traction within the last decade, largely due to increased demand for legacy load balancing appliances to handle more advanced application delivery requirements and improve application performance.
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    731 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now