cos2000v1/programs/verifier.asm

100 lines
1.9 KiB
NASM
Raw Normal View History

include "..\include\mem.h"
include "..\include\divers.h"
2004-11-19 18:23:06 +01:00
org 0h
start:
2019-07-09 18:30:00 +02:00
header exe 1
realstart:
2019-07-09 18:30:00 +02:00
invoke savestate
invoke print, msg
mov bp,1000h
xor di,di
xor cx,cx
xor edx,edx
verifall:
mov ah,1
int 16h
jz nokey
cmp al,' '
je enend
nokey:
mov dx,di
push edx
mov dx,cx
inc dx
push edx
mov ax,cx
inc ax
mov si,100
mul si
mov si,2880
div si
mov dx,ax
push edx
2019-07-09 18:30:00 +02:00
invoke print, msg2
call gauge
2019-07-09 18:30:00 +02:00
invoke verifysector,cx
jc errors
je noprob
inc di
noprob:
inc cx
cmp cx,2880
jnz verifall
enend:
cmp di,0
je noatall
2019-07-09 18:30:00 +02:00
invoke print, error2
jmp someof
noatall:
2019-07-09 18:30:00 +02:00
invoke print, noerror
someof:
mov ah,0
int 16h
2019-07-09 18:30:00 +02:00
invoke restorestate
retf
errors:
2019-07-09 18:30:00 +02:00
invoke print, error
mov ah,0
int 16h
2019-07-09 18:30:00 +02:00
invoke restorestate
retf
error db '\g10,10Erreur avec le lecteur de disquette !',0
error2 db '\g10,10Le disque est defectueux, appuyez sur une touche pour quitter',0
noerror db '\g10,10Pas de secteurs defectueux, appuyez sur une touche pour continuer',0
msg db '\m02\e\c07\g29,00- Test de surface du disque -\g02,49<Pressez espace pour quitter>',0
msg2 db '\g10,20%u %%\g10,16%u cluster testes. \h34%u cluster defectueux. ',0
gauge:
push ax dx
mov ax,cx
mul [sizeof]
div [max]
xor edx,edx
mov dx,[sizeof]
sub dx,ax
push dx
push '<27>'
mov dx,ax
push dx
push '<27>'
2019-07-09 18:30:00 +02:00
push gauges
invoke print
pop dx ax
2019-07-09 18:30:00 +02:00
ret
max dw 2879
sizeof dw 50
gauges db '\g10,18\c05%cM\c07%cM',0
importing
use VIDEO.LIB,print
use VIDEO,savestate
use VIDEO,restorestate
use DISQUE,verifysector
endi