feat: reprogrammation en utilisant la librairie video

This commit is contained in:
Nicolas Hordé 2004-11-29 22:41:00 +00:00
parent a3008f75fe
commit c8330e5e86
1 changed files with 120 additions and 241 deletions

View File

@ -10,32 +10,11 @@ include ..\include\mem.h
include ..\include\divers.h include ..\include\divers.h
start: start:
push cs header exe <,1,0,,,offset imports,,>
push cs
push cs realstart:
push cs push offset msginit
pop ds call [print]
pop es
pop fs
pop gs
mov ah,21
mov cl,7
int 47h
mov ah,3
int 48h
mov ax,0002
int 47h
mov ah,2
int 47h
mov ah,6
int 47h
mov ah,6
int 47h
mov ah,42
int 47h
mov ah,13
mov si,offset msg
int 47h
xor bp,bp xor bp,bp
mov dl,' ' mov dl,' '
call setdelimiter0 call setdelimiter0
@ -48,11 +27,8 @@ noret:
mov ah,16 mov ah,16
mov di,offset dir mov di,offset dir
int 48h int 48h
mov si,di push offset prompt
mov ah,13 call [print]
int 47h
mov si,offset prompt
int 47h
mov di,offset buffer mov di,offset buffer
waitchar: waitchar:
mov ax,0 mov ax,0
@ -62,9 +38,8 @@ waitchar:
jne norr jne norr
cmp bp,0 cmp bp,0
je waitchar je waitchar
mov ah,13 push word ptr cs:[bp-8]
mov si,cs:[bp-8] call [print]
int 47h
push cs push cs
pop es pop es
call copy0 call copy0
@ -84,14 +59,13 @@ norr:
je waitchar je waitchar
mov [di],al mov [di],al
inc di inc di
mov dl,al push ax
mov ah,7 call [showchar]
int 47h
jmp waitchar jmp waitchar
escape: escape:
cmp di,offset buffer cmp di,offset buffer
je waitchar je waitchar
mov ah,18h mov ah,24
int 47h int 47h
mov dx,offset buffer mov dx,offset buffer
mov cx,di mov cx,di
@ -99,20 +73,21 @@ escape:
js waitchar js waitchar
je waitchar je waitchar
sub bh,cl sub bh,cl
mov ah,19h mov ah,25
int 47h int 47h
mov di,offset buffer mov di,offset buffer
mov byte ptr [di],0 mov byte ptr [di],0
backspace: backspace:
cmp di,offset buffer cmp di,offset buffer
je waitchar je waitchar
mov ah,18h mov ah,24
int 47h int 47h
dec bh dec bh
mov dl,' ' mov ah,25
mov ah,0Eh
int 47h int 47h
mov ah,19h push ' '
call [showchar]
mov ah,25
int 47h int 47h
dec di dec di
mov byte ptr [di],0 mov byte ptr [di],0
@ -186,27 +161,23 @@ noaddext:
xor bp,bp xor bp,bp
jmp replay jmp replay
reallyerror: reallyerror:
mov ah,13 push offset Error_Syntax
mov si,offset Error_Syntax call [print]
int 47h push word ptr cs:[bp-8]
mov ah,13 call [print]
mov si,cs:[bp-8]
int 47h
jmp replay jmp replay
errorprec: errorprec:
mov ah,13 push offset derror
mov si,offset derror call [print]
int 47h
jmp replay jmp replay
Code_Exit: Code_Exit:
pop ax pop ax
db 0CBh retf
Code_Version: Code_Version:
mov ah,13 push offset Version_Text
mov si,offset Version_Text call [print]
int 47h
ret ret
Version_Text db 'Cos 2000 version 1.2Fr par Nico',0 Version_Text db 'Cos 2000 version 1.2Fr par Nico',0
@ -228,8 +199,8 @@ showalls:
add bx,8 add bx,8
cmp si,0 cmp si,0
je endoff je endoff
mov ah,13 push si
int 47h call [print]
mov ah,6 mov ah,6
int 47h int 47h
jmp showalls jmp showalls
@ -247,238 +218,138 @@ Code_Mode:
int 47h int 47h
ret ret
present db 'Le volume insere est nomme ',0 present db 'Le volume insere est nomme %0, Numero de serie : %hD\l\l',0
present2 db ', Numero de serie : ',0
nomdisque db 13 dup (0) nomdisque db 13 dup (0)
Code_Dir: Code_Dir:
mov si,offset present mov ah,12
mov ah,13 int 48h
int 47h push edx
mov ah,11 mov ah,11
mov di,offset nomdisque mov di,offset nomdisque
int 48h int 48h
mov si,di push di
mov ah,13 push offset present
int 47h call [print]
mov si,offset present2 xor bp,bp
mov ah,13
int 47h
mov ah,12
int 48h
mov ah,10
mov cx,32
int 47h
mov ah,6
int 47h
mov ah,6
int 47h
xor ebp,ebp
mov di,offset bufferentry mov di,offset bufferentry
mov si,di
mov ah,7 mov ah,7
int 48h int 48h
jc nofiles jc nofiles
go: go:
mov ah,46 push word ptr [di+Entries.FileAttr]
int 47h push dword ptr [di+Entries.FileSize]
mov ah,05 push word ptr [di+Entries.FileTime]
int 47h push word ptr [di+Entries.FileDate]
int 47h push word ptr [di+Entries.FileTimeCrea]
int 47h push word ptr [di+Entries.FileDateCrea]
mov ah,44 push di
mov dx,[si+Entries.FileDateCrea] push offset line
int 47h call [print]
mov ah,05
int 47h
int 47h
int 47h
mov ah,45
mov dx,[si+Entries.FileTimeCrea]
int 47h
mov ah,05
int 47h
int 47h
int 47h
mov ah,44
mov dx,[si+Entries.FileDate]
int 47h
mov ah,05
int 47h
int 47h
int 47h
mov ah,45
mov dx,[si+Entries.FileTime]
int 47h
mov ah,05
int 47h
int 47h
int 47h
mov ah,48
mov edx,[si+Entries.FileSize]
int 47h
mov ah,05
int 47h
int 47h
int 47h
mov ah,47
mov dl,[si+Entries.FileAttr]
int 47h
mov ah,6
int 47h
inc bp inc bp
mov ah,8 mov ah,8
int 48h int 48h
jnc go jnc go
nofiles: nofiles:
mov edx,ebp push ebp
mov ah,6 push offset filess
int 47h call [print]
mov ah,8
int 47h
mov si,offset filess
mov ah,13
int 47h
ret ret
bufferentry db 32 dup (0) bufferentry db 32 dup (0)
filess db ' Fichier(s) au total',0 line db '\c07%n %d %t %d %t %z %a\l',0
filess db '\l\l%u Fichier(s) au total\l',0
changing db 'Changement de repertoire vers ',0 changing db 'Changement de repertoire vers ',0
code_cd: code_cd:
mov cx,0 mov cx,0
call gettypeditem0 call gettypeditem0
push si push offset changing
mov si,offset changing call [print]
mov ah,13
int 47h
pop si
int 47h
mov ah,6
int 47h
mov si,di mov si,di
mov ah,13 mov ah,13
int 48h int 48h
jnc okchange jnc okchange
mov si,offset errorchanging push offset errorchanging
mov ah,13 call [print]
int 47h
okchange: okchange:
ret ret
errorchanging db 'Impossible d''atteindre ce dossier',0 errorchanging db '\c04Impossible d''atteindre ce dossier',0
code_refresh: code_refresh:
mov ah,3 mov ah,3
int 48h int 48h
jnc okrefresh jnc okrefresh
mov si,offset errorrefreshing push offset errorrefreshing
mov ah,13 call [print]
int 47h
ret ret
okrefresh: okrefresh:
mov si,offset present mov ah,12
mov ah,13 int 48h
int 47h push edx
mov ah,11 mov ah,11
mov di,offset nomdisque mov di,offset nomdisque
int 48h int 48h
mov si,di push di
mov ah,13 push offset present
int 47h call [print]
mov si,offset present2 ret
mov ah,13 errorrefreshing db '\c04Impossible de lire le support',0
int 47h
mov ah,12
int 48h
mov ah,10
mov cx,32
int 47h
mov ah,6
int 47h
ret
errorrefreshing db 'Impossible de lire le support',0
extcom db '.CE ',0 extcom db '.CE',0
Code_Mem: Code_Mem:
mov si,offset msgs push offset msg
mov ah,13 call [print]
int 47h
mov ah,6
int 47h
mov ah,6
int 47h
mov si,offset menu
mov ah,13
int 47h
mov ah,6
int 47h
mov ah,18h
int 47h
xor cx,cx xor cx,cx
listmcb: listmcb:
mov ah,4 mov ah,4
int 49h int 49h
jc fino jc fino
inc cx inc cx
mov ah,18h ;placement mémoire
int 47h
push gs
pop ds
mov bh,0
mov si,MB.Names
mov ah,14h
int 47h
mov bh,15
xor edx,edx
mov dx,ds:[MB.Sizes]
shl edx,4
mov ah,0Fh
int 47h
mov bh,24
cmp ds:[MB.IsResident],true
push cs
pop ds
jne notresident
mov si,offset resident
mov ah,14h
int 47h
jmp suitelistmcb
notresident:
mov si,offset nonresident
mov ah,14h
int 47h
suitelistmcb:
mov bh,30
cmp gs:[MB.Reference],0
je next
cmp gs:[MB.Reference],1000h
jb next
mov ax,gs:[MB.Reference]
dec ax
dec ax
mov ds,ax
mov si,MB.Names
mov ah,14h
int 47h
next:
mov bh,46
xor edx,edx
mov dx,gs mov dx,gs
inc dx inc dx
inc dx inc dx
push cx push edx
mov cx,16 ;parent
mov ah,11h cmp gs:[MB.Reference],0
int 47h je next
mov ah,6h mov dx,gs:[MB.Reference]
int 47h dec dx
pop cx dec dx
push dx
push offset MB.Names
jmp suitemn
next:
push cs
push offset none
suitemn:
;Resident
cmp gs:[MB.IsResident],true
jne notresident
push offset resident
jmp suitelistmcb
notresident:
push offset nonresident
suitelistmcb:
;taille memoire
xor edx,edx
mov dx,gs:[MB.Sizes]
shl edx,4
push 6
push edx
;nom
push gs
push offset MB.Names
push offset line2
call [print]
jmp listmcb jmp listmcb
fino: fino:
ret ret
resident db 'oui',0 resident db "oui",0
nonresident db 'non',0 nonresident db "non",0
msgs db 'Plan de la memoire',0 line2 db "%0P\h15%w\h24%0\h30%0P\h46%hW\l",0
menu db 'Nom Taille Res Parent Mem',0 msg db "Plan de la memoire\l\lNom Taille Res Parent Mem\l",0
none db ".",0
;converti le jeux scancode/ascii en fr ax->ax ;converti le jeux scancode/ascii en fr ax->ax
@ -618,10 +489,10 @@ Help_Dir db 0
Help_refresh db 0 Help_refresh db 0
Help_cd db 0 Help_cd db 0
Help_Mem db 0 Help_Mem db 0
derror db 'Erreur de Syntaxe !',0 derror db '\c04Erreur de Syntaxe !',0
Error_Syntax db 'La commande ou l''executable n''existe pas ! F1 pour ',0 Error_Syntax db '\c04La commande ou l''executable n''existe pas ! F1 pour ',0
prompt db '>',0 prompt db '\c07>',0
msg db 'Interpreteur de commande COS V1.9',0 msginit db '\m02\e\c07\l\lInterpreteur de commande COS V1.9',0
include str0.asm include str0.asm
@ -629,5 +500,13 @@ dir db 32 dup (0)
buffer db 256 dup (0) buffer db 256 dup (0)
buffer2 db 256 dup (0) buffer2 db 256 dup (0)
imports:
db "VIDEO.LIB::print",0
print dd 0
db "VIDEO.LIB::showhex",0
showhex dd 0
db "VIDEO.LIB::showchar",0
showchar dd 0
dw 0
end start end start