T
T
Type Programmer2017-06-02 22:23:42
assembler
Type Programmer, 2017-06-02 22:23:42

How to make a program that formats the HDD (Help with error parsing)?

I am writing a program for formatting the HDD, only BIOS tools, I decided to do this
- Check how many heads and sectors are on the HDD (Here it freezes ...), 08h,13h
- Loop:
- Add 1 to the track
- If the tracks run out, the next head too , 1 to the head, nuzzling the track
- Formatting through 05h, int 13h
- Loop again
Well, the code

#make_boot#

org 7c00h 
use16

jmp start   

start_p:
mov ah,14
xor bl,bl
mov bx,run
call puts 
ret


quit:
mov ah,0
int 16h 
int 19h

puts:
mov al,[bx]
test al,al
jz quit
inc bx
int 10h
jmp puts

end1:
mov ah,14
xor bl,bl
mov bx,finish
call puts


formate:
mov dl,80h
mov ah,05h
int 13h
ret

new_head:
mov dh,[a]
inc dh
mov [a],dh 
mov ch,0
jmp p0     


start:  
call start_p   
mov dl,80h
mov ah,08h
int 13h Зависает где-то тут ошибка возможно то что не нашло HDD хотя он есть и, код с таким же 80h но чтение работает
mov al,'>'
mov ah,0x0E
mov bh,0
int 10h
push bx
push cx
mov [a],dh
mov [b],ch
mov dl,0
mov ch,0
p0:          
push dx
push cx
call formate
inc ch
mov ah,[b]
cmp ch,ah
jz new_head 
mov ah,[a]  
cmp bh,ah
jz end1
pop cx
pop dx
jmp p0


  

finish db 0Ah,0Dh,'HDD formated',0Ah,0Dh,0
run    db 0Ah,0Dh,'For start formate HDD press any key',0Ah,0Dh,0
a db 255
b db 255      
INT 19h

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question