As an improvement of my previous project, I wanted to make a full fledged kernel loader, that would present a prompt (Linux like

For that, I wrote a decent MBR, with all details pertaining to a FAT file system embedded on it, like the Bios parameter block etc, that corresponds to a 124 MB USB disk. (Stole it from my previous MBR

Secondly, I put my program at sector 12, (zero based index), just after some wierd info ...
My program is 2 KB long.
The MBR would load this sector 12 at 0x0:7E00 (just below the MBR) and jump to it.
Everything goes fine till this point.
The program also loads successfully. While executing, I just wanted to load 512 bytes of the FAT into the memory.
(see code).
It too loads successfully.
I type 'd' at the prompt (just one command that I have added) to dump the FAT on to the screen. I should be getting values ... I got some. Fine till now...
The problem is:
the next time I press 'd', it dumps some values and gets stuck.
I think this is some stack related problem. or, it doesnt return to the executing code properly. Could you please check it for me?
Thanks
Vimal