2007-03-13 21:56:55 +01:00
model tiny , stdcall
p486
locals
jumps
codeseg
option procalign : byte
2004-06-12 23:34:04 +02:00
org 0100h
ent equ 32h
2007-03-13 21:56:55 +01:00
jmp copycos
2004-06-12 23:34:04 +02:00
2007-03-31 21:22:04 +02:00
message db 0Dh , 0Ah , 'COS 2000 V1.4Fr programme d' 'installation' , 0Dh , 0AH , 'Inserez une disquette formatee et appuyez sur entre...' , 0Dh , 0AH , 'Attention le contenu de celle ci peut etre altere !!!' , 0Dh , 0AH , '$'
2007-03-13 21:56:55 +01:00
message2 db 0Dh , 0AH , 'Creation du secteur de demarrage...' , 0Dh , 0Ah , '$'
message3 db 0Dh , 0AH , 'Copie des fichiers systeme...' , 0Dh , 0Ah , '$'
errormsg db 0Dh , 0AH , 'Erreur d' 'installation, contactez moi a COS2000@MULTIMANIA.COM !' , 0Dh , 0AH , '$'
ok db 0Dh , 0AH , 'COS2000 a ete correctement installe, veuillez redemarrer votre PC' , 0Dh , 0AH , '$'
2004-06-12 23:34:04 +02:00
files db '*.*' , 0
boot db 'boot.bin' , 0
dat db 'data' , 0
retu db 0Dh , 0AH , '$'
dt a db 43 dup ( 0 )
copycos:
mov ah , 9
mov dx , offset message
int 21h
xor ax , ax
int 16h
mov ah , 4ah
mov bx , 1000h
int 21h
jc error
mov ah , 48h
mov bx , 65536 / 16
int 21h
jc error
mov fs , ax
mov ah , 3Bh
mov dx , offset dat
int 21h
jc error
mov ah , 1Ah
mov dx , offset dta
int 21h
jc error
mov ah , 4eh
xor cx , cx
mov dx , offset files
int 21h
jc error
mov ah , 09
mov dx , offset message3
int 21h
allfile:
2007-03-13 21:56:55 +01:00
mov [ byte ptr offset dta + 43 ], '$'
2004-06-12 23:34:04 +02:00
mov ah , 9
mov dx , offset dta + 30
int 21h
push dx
mov ah , 09
mov dx , offset retu
int 21h
pop dx
mov ax , 3D00h
int 21h
jc error
mov bx , ax
mov ax , 4202h
xor cx , cx
xor dx , dx
int 21h
jc error
cmp dx , 0
jne error
cmp ax , 0
je error
mov bp , ax
mov ax , 4200h
xor cx , cx
xor dx , dx
int 21h
jc error
push fs
pop ds
mov ah , 3fh
mov cx , 0FFFFh
xor dx , dx
int 21h
push cs
pop ds
jc error
mov ah , 3eh
int 21h
jc error
mov ah , 3ch
push cs
pop es
2004-06-13 00:58:25 +02:00
mov di , offset dta + 30 - 3
2007-03-13 21:56:55 +01:00
mov [ word ptr di ], ":a"
mov [ byte ptr di + 2 ], "\"
2004-06-12 23:34:04 +02:00
xor cx , cx
mov dx , di
int 21h
jc error
mov bx , ax
push fs
pop ds
xor dx , dx
mov ah , 40h
mov cx , bp
int 21h
push cs
pop ds
jc error
mov ah , 3eh
int 21h
jc error
mov ah , 4fh
int 21h
2007-03-13 21:56:55 +01:00
jnc al lfile
2004-06-12 23:34:04 +02:00
mov ah , 09
mov dx , offset message2
int 21h
mov ax , 3D00h
mov dx , offset boot
int 21h
jc error
push fs
pop ds
mov ah , 3fh
2004-06-13 00:58:25 +02:00
mov cx , 0FFFFh
2004-06-12 23:34:04 +02:00
xor dx , dx
int 21h
push cs
pop ds
jc error
mov ah , 3eh
int 21h
jc error
push fs
pop es
mov ax , 0301h
mov dx , 0
mov cx , 0001h
xor bx , bx
int 13h
mov ah , 09
2007-03-13 21:56:55 +01:00
mov dx , offset ok
2004-06-12 23:34:04 +02:00
int 21h
xor ax , ax
int 16h
ret
error:
mov ah , 09
mov dx , offset errormsg
int 21h
xor ax , ax
int 16h
ret
2007-03-13 21:56:55 +01:00