I am trying to learn assembly in real mode .I wanted to read the boot sector of the hard disk ,So below is the code
org 100h
start:
xor ax, ax
mov es, ax ; ES <- 0
mov cx, 1 ; cylinder 0, sector 1
mov dx, 0080h ; DH = 0 (head), drive = 80h (0th hard disk)
mov bx, buff ; segment offset of the buffer
mov ax, 0201h ; AH = 02 (disk read), AL = 01 (number of sectors to read)
int 13h
jnc .read
.read:
mov ax, cs ; set up segments
mov ds, ax
mov es, ax
mov al, 03h
mov ah, 0
int 10h
mov si, buff
call print_string
.done:
jmp .done
print_string:
lodsb ; grab a byte from SI
test al, al ; logical or AL by itself
jz .done ; if the result is zero, get out
mov ah, 0x0E
int 0x10 ; otherwise, print out the character!
jmp print_string
.done:
ret
buff dw 512
My execution environment is DosBox0.70 and exe file is .COM. I am expecting to see 512 bytes on screen but when I run my .COM file its just blank screen there.There are couple of reason that I could see behind it
1)Is given code not returning from Bios interrupt properly(int 13h). 2)String should terminate with null ,which is not happening here.
But not sure is it the above reasons causing it to happen and if so how do I reactify theses issues??