Compare commits
No commits in common. "develop" and "master" have entirely different histories.
Binary file not shown.
Before Width: | Height: | Size: 47 KiB |
Binary file not shown.
Before Width: | Height: | Size: 40 KiB |
36
MAKEFILE
36
MAKEFILE
|
@ -11,31 +11,9 @@ all:
|
||||||
make
|
make
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
cd commande
|
copy:
|
||||||
make
|
make all
|
||||||
cd ..
|
|
||||||
|
|
||||||
cd programs
|
|
||||||
make
|
|
||||||
cd ..
|
|
||||||
|
|
||||||
install:
|
|
||||||
if not exist data mkdir data
|
|
||||||
copy noyau\systeme.sys data
|
|
||||||
copy noyau\boot.bin data
|
|
||||||
copy commande\commande.ce data
|
|
||||||
copy lib\*.lib data
|
|
||||||
copy programs\*.ce data
|
|
||||||
copy programs\exem-lib.lib data
|
|
||||||
copy programs\cos.rip data
|
|
||||||
copy install\setup.com .
|
|
||||||
|
|
||||||
copy: clean all
|
|
||||||
copy noyau\systeme.sys b:
|
|
||||||
copy commande\*.ce b:
|
|
||||||
copy lib\*.lib b:
|
|
||||||
copy programs\*.ce b:
|
|
||||||
copy programs\*.lib b:
|
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
cd lib
|
cd lib
|
||||||
|
@ -49,11 +27,3 @@ clean:
|
||||||
cd install
|
cd install
|
||||||
make clean
|
make clean
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
cd commande
|
|
||||||
make clean
|
|
||||||
cd ..
|
|
||||||
|
|
||||||
cd programs
|
|
||||||
make clean
|
|
||||||
cd ..
|
|
|
@ -2,14 +2,12 @@
|
||||||
|
|
||||||
## Copies d'écran de COS2000
|
## Copies d'écran de COS2000
|
||||||
![screen](https://github.com/dahut87/cos2000v1/raw/develop/Graphisme/screenshots/bootnew.jpg)
|
![screen](https://github.com/dahut87/cos2000v1/raw/develop/Graphisme/screenshots/bootnew.jpg)
|
||||||
![screen](https://github.com/dahut87/cos2000v1/raw/develop/Graphisme/screenshots/ceexplorer.jpg)
|
|
||||||
![screen](https://github.com/dahut87/cos2000v1/raw/develop/Graphisme/screenshots/chargement.jpg)
|
![screen](https://github.com/dahut87/cos2000v1/raw/develop/Graphisme/screenshots/chargement.jpg)
|
||||||
![screen](https://github.com/dahut87/cos2000v1/raw/develop/Graphisme/screenshots/dir.jpg)
|
![screen](https://github.com/dahut87/cos2000v1/raw/develop/Graphisme/screenshots/dir.jpg)
|
||||||
![screen](https://github.com/dahut87/cos2000v1/raw/develop/Graphisme/screenshots/editeur.jpg)
|
![screen](https://github.com/dahut87/cos2000v1/raw/develop/Graphisme/screenshots/editeur.jpg)
|
||||||
![screen](https://github.com/dahut87/cos2000v1/raw/develop/Graphisme/screenshots/gestionnaire.jpg)
|
![screen](https://github.com/dahut87/cos2000v1/raw/develop/Graphisme/screenshots/gestionnaire.jpg)
|
||||||
![screen](https://github.com/dahut87/cos2000v1/raw/develop/Graphisme/screenshots/installation.jpg)
|
![screen](https://github.com/dahut87/cos2000v1/raw/develop/Graphisme/screenshots/installation.jpg)
|
||||||
![screen](https://github.com/dahut87/cos2000v1/raw/develop/Graphisme/screenshots/interpreteur.jpg)
|
![screen](https://github.com/dahut87/cos2000v1/raw/develop/Graphisme/screenshots/interpreteur.jpg)
|
||||||
![screen](https://github.com/dahut87/cos2000v1/raw/develop/Graphisme/screenshots/librairies.jpg)
|
|
||||||
![screen](https://github.com/dahut87/cos2000v1/raw/develop/Graphisme/screenshots/logo.jpg)
|
![screen](https://github.com/dahut87/cos2000v1/raw/develop/Graphisme/screenshots/logo.jpg)
|
||||||
![screen](https://github.com/dahut87/cos2000v1/raw/develop/Graphisme/screenshots/pci.jpg)
|
![screen](https://github.com/dahut87/cos2000v1/raw/develop/Graphisme/screenshots/pci.jpg)
|
||||||
![screen](https://github.com/dahut87/cos2000v1/raw/develop/Graphisme/screenshots/video.jpg)
|
![screen](https://github.com/dahut87/cos2000v1/raw/develop/Graphisme/screenshots/video.jpg)
|
||||||
|
|
|
@ -1,20 +1,17 @@
|
||||||
asm= lzasm /z/t
|
lnk_boot = tlink /x
|
||||||
lnk= elink
|
asm= tasm /t/m5/zi
|
||||||
|
lnk= tlink /x/t
|
||||||
|
|
||||||
all: commande.ce
|
all: commande.exe
|
||||||
|
|
||||||
commande.ce: commande.obj
|
commande.exe: commande.asm str0.asm
|
||||||
$(lnk) commande.obj commande.ce
|
$(asm) commande
|
||||||
|
$(lnk) commande
|
||||||
commande.obj: commande.asm
|
ren commande.com commande.exe
|
||||||
$(asm) commande.asm
|
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
del *.obj
|
del *.obj
|
||||||
del *.ce
|
del *.exe
|
||||||
del *.bak
|
|
||||||
del *.lib
|
|
||||||
del *.com
|
del *.com
|
||||||
del *.bin
|
|
||||||
del *.sys
|
del *.sys
|
||||||
del *.err
|
del *.err
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,857 @@
|
||||||
|
;Librairie qui prend en charge le format de STR ASCIIZ
|
||||||
|
;# nombre 8
|
||||||
|
;@ str 7
|
||||||
|
;& nom 6
|
||||||
|
|
||||||
|
;High Low
|
||||||
|
;0 variable 4 hex
|
||||||
|
;1 byte 3 dec
|
||||||
|
;2 word 2 oct
|
||||||
|
;3 3 octets 1 bin
|
||||||
|
;4 dword 5 adresse
|
||||||
|
;5 5 octets 6 nom
|
||||||
|
;6 ... 7 str
|
||||||
|
; 8 nombre
|
||||||
|
|
||||||
|
|
||||||
|
;Renvoie carry si la syntaxe de ds:si n'est pas respect‚ par rapport a es:di
|
||||||
|
CheckSyntax0:
|
||||||
|
push ax bx dx bp si di ds es
|
||||||
|
push es di
|
||||||
|
push cs
|
||||||
|
pop es
|
||||||
|
mov di,offset temp2
|
||||||
|
call copy0
|
||||||
|
mov si,di
|
||||||
|
push cs
|
||||||
|
pop ds
|
||||||
|
pop di es
|
||||||
|
call getdelimiter0
|
||||||
|
mov bp,dx
|
||||||
|
mov dl,' '
|
||||||
|
call setdelimiter0
|
||||||
|
call compressdelimiter0
|
||||||
|
call uppercase0
|
||||||
|
call getnbitems0
|
||||||
|
;call xch
|
||||||
|
;mov ax,cx
|
||||||
|
;call getnbitem0
|
||||||
|
;call xch
|
||||||
|
;cmp ax,cx
|
||||||
|
;call xch
|
||||||
|
;jne notequalatall
|
||||||
|
mov bx,cx
|
||||||
|
xor cx,cx
|
||||||
|
itemer:
|
||||||
|
call whatisitem0
|
||||||
|
mov dx,ax
|
||||||
|
call xch
|
||||||
|
call whatisitem0
|
||||||
|
call xch
|
||||||
|
cmp ax,dx
|
||||||
|
jne prob
|
||||||
|
cmp al,6
|
||||||
|
jb equal
|
||||||
|
call cmpitems0
|
||||||
|
je equal
|
||||||
|
prob:
|
||||||
|
cmp dl,4
|
||||||
|
ja nosize
|
||||||
|
cmp al,8
|
||||||
|
je equal
|
||||||
|
cmp al,4
|
||||||
|
jne notequalatall
|
||||||
|
cmp dh,ah
|
||||||
|
ja notequalatall
|
||||||
|
jmp equal
|
||||||
|
nosize:
|
||||||
|
cmp al,7
|
||||||
|
jne noname
|
||||||
|
cmp ah,0
|
||||||
|
jne notequalatall
|
||||||
|
jmp equal
|
||||||
|
noname:
|
||||||
|
cmp al,8
|
||||||
|
je equal
|
||||||
|
jmp notequalatall
|
||||||
|
equal:
|
||||||
|
inc cx
|
||||||
|
cmp cx,bx
|
||||||
|
jne itemer
|
||||||
|
cld
|
||||||
|
ackno:
|
||||||
|
mov dx,bp
|
||||||
|
call setdelimiter0
|
||||||
|
pop es ds di si bp dx bx ax
|
||||||
|
ret
|
||||||
|
notequalatall:
|
||||||
|
stc
|
||||||
|
jmp ackno
|
||||||
|
xch:
|
||||||
|
push ds
|
||||||
|
push es
|
||||||
|
pop ds
|
||||||
|
pop es
|
||||||
|
xchg si,di
|
||||||
|
ret
|
||||||
|
|
||||||
|
temp2 db 256 dup (0)
|
||||||
|
|
||||||
|
;Compare les ‚l‚ments cx de deux chaine ds:si et es:di
|
||||||
|
Cmpitems0:
|
||||||
|
push cx dx si di
|
||||||
|
push cx di
|
||||||
|
call getpointeritem0
|
||||||
|
mov si,di
|
||||||
|
xor cx,cx
|
||||||
|
inc cx
|
||||||
|
call getpointeritem0
|
||||||
|
mov dx,di
|
||||||
|
sub dx,si
|
||||||
|
dec cx
|
||||||
|
pop di cx
|
||||||
|
push ds si
|
||||||
|
push es
|
||||||
|
pop ds
|
||||||
|
mov si,di
|
||||||
|
call getpointeritem0
|
||||||
|
pop si ds
|
||||||
|
mov cx,dx
|
||||||
|
rep cmpsb
|
||||||
|
pop di si dx cx
|
||||||
|
ret
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
;Renvoie l'‚l‚ment cx de ds:si dans edx si nb et dans es:di si str ou name
|
||||||
|
gettypeditem0:
|
||||||
|
push bx cx si
|
||||||
|
call getpointeritem0
|
||||||
|
mov si,di
|
||||||
|
xor cx,cx
|
||||||
|
inc cl
|
||||||
|
call getpointeritem0
|
||||||
|
mov bx,di
|
||||||
|
dec bx
|
||||||
|
mov cl,0
|
||||||
|
xchg cl,ds:[bx]
|
||||||
|
call gettyped0
|
||||||
|
xchg cl,ds:[bx]
|
||||||
|
pop si cx bx
|
||||||
|
ret
|
||||||
|
|
||||||
|
;Renvoie ds:si dans edx si nb et dans es:di si str ou name
|
||||||
|
gettyped0:
|
||||||
|
push ax
|
||||||
|
call whatis0
|
||||||
|
cmp al,5
|
||||||
|
jb number
|
||||||
|
cmp al,6
|
||||||
|
je pointer
|
||||||
|
push ds
|
||||||
|
pop es
|
||||||
|
call getpointeritem0
|
||||||
|
jmp endofGettypeditem0
|
||||||
|
number:
|
||||||
|
mov edx,cs:lastnumber
|
||||||
|
jmp endofgettypeditem0
|
||||||
|
pointer:
|
||||||
|
call str0toadress
|
||||||
|
endofgettypeditem0:
|
||||||
|
pop ax
|
||||||
|
ret
|
||||||
|
|
||||||
|
;Renvoie dans ax le type de la str0 point‚e par ds:si ‚l‚ment cx
|
||||||
|
whatisitem0:
|
||||||
|
push bx cx si di
|
||||||
|
call getpointeritem0
|
||||||
|
mov si,di
|
||||||
|
xor cx,cx
|
||||||
|
inc cl
|
||||||
|
call getpointeritem0
|
||||||
|
mov bx,di
|
||||||
|
dec bx
|
||||||
|
mov cl,0
|
||||||
|
xchg cl,ds:[bx]
|
||||||
|
call whatis0
|
||||||
|
xchg cl,ds:[bx]
|
||||||
|
pop di si cx bx
|
||||||
|
ret
|
||||||
|
|
||||||
|
;Renvoie dans ax le type de la str0 point‚e par ds:si
|
||||||
|
;High Low
|
||||||
|
;0 variable 4 hex
|
||||||
|
;1 byte 3 dec
|
||||||
|
;2 word 2 oct
|
||||||
|
;3 3 octets 1 bin
|
||||||
|
;4 dword 5 adresse
|
||||||
|
;5 5 octets 6 name
|
||||||
|
;6 ... 7 str
|
||||||
|
whatis0:
|
||||||
|
push bx cx edx
|
||||||
|
mov cl,2
|
||||||
|
call str0isbase
|
||||||
|
jnc finbase
|
||||||
|
mov cl,8
|
||||||
|
call str0isbase
|
||||||
|
jnc finbase
|
||||||
|
mov cl,10
|
||||||
|
call str0isbase
|
||||||
|
jnc finbase
|
||||||
|
mov cl,16
|
||||||
|
call str0isbase
|
||||||
|
jc testadress
|
||||||
|
finbase:
|
||||||
|
mov bx,cx
|
||||||
|
xor ch,ch
|
||||||
|
mov al,cs:[bx+offset basenn-2]
|
||||||
|
call str0toint
|
||||||
|
mov cs:Lastnumber,edx
|
||||||
|
cmp edx,0000FFFFh
|
||||||
|
ja bits32
|
||||||
|
cmp dx,00FFh
|
||||||
|
ja bits16
|
||||||
|
mov ah,1
|
||||||
|
jmp endofwhat
|
||||||
|
bits16:
|
||||||
|
mov ah,2
|
||||||
|
jmp endofwhat
|
||||||
|
bits32:
|
||||||
|
mov ah,3
|
||||||
|
jmp endofwhat
|
||||||
|
testadress:
|
||||||
|
call str0isadress
|
||||||
|
jc testname
|
||||||
|
mov ax,0005h
|
||||||
|
jmp endofwhat
|
||||||
|
testname:
|
||||||
|
;call str0isname
|
||||||
|
;jc testvarstr
|
||||||
|
;jnc isok
|
||||||
|
;mov al,06h
|
||||||
|
cmp byte ptr [si],'&'
|
||||||
|
jne testvarstr
|
||||||
|
mov al,06h
|
||||||
|
call getlength0
|
||||||
|
dec cl
|
||||||
|
mov ah,cl
|
||||||
|
jmp endofwhat
|
||||||
|
testvarstr:
|
||||||
|
cmp byte ptr [si],'@'
|
||||||
|
jne testnumber
|
||||||
|
mov al,07h
|
||||||
|
call getlength0
|
||||||
|
dec cl
|
||||||
|
mov ah,cl
|
||||||
|
jmp endofwhat
|
||||||
|
testnumber:
|
||||||
|
cmp byte ptr [si],'#'
|
||||||
|
jne isstr
|
||||||
|
mov al,8
|
||||||
|
call getlength0
|
||||||
|
dec cl
|
||||||
|
mov ah,cl
|
||||||
|
jmp endofwhat
|
||||||
|
isstr:
|
||||||
|
mov al,07h
|
||||||
|
call getlength0
|
||||||
|
mov ah,cl
|
||||||
|
endofwhat:
|
||||||
|
pop edx cx bx
|
||||||
|
ret
|
||||||
|
|
||||||
|
Lastnumber dd 0
|
||||||
|
|
||||||
|
;Renvoie non carry si la str ds:si point‚e peut ˆtre une adresse
|
||||||
|
str0isadress:
|
||||||
|
;push
|
||||||
|
stc
|
||||||
|
;pop
|
||||||
|
ret
|
||||||
|
|
||||||
|
;Renvoie en es:di le pointeur str0 ds:si
|
||||||
|
Str0toAdress:
|
||||||
|
;push
|
||||||
|
stc
|
||||||
|
;pop
|
||||||
|
ret
|
||||||
|
|
||||||
|
;Renvoie non carry si la str ds:si point‚e peut ˆtre un nom de fichier
|
||||||
|
str0isname:
|
||||||
|
push ax si di
|
||||||
|
isname:
|
||||||
|
mov al,[si]
|
||||||
|
inc si
|
||||||
|
cmp al,0
|
||||||
|
je itsok
|
||||||
|
mov di,offset non
|
||||||
|
verify:
|
||||||
|
mov ah,[di]
|
||||||
|
inc di
|
||||||
|
cmp ah,0FFh
|
||||||
|
je isname
|
||||||
|
cmp ah,al
|
||||||
|
jne verify
|
||||||
|
stc
|
||||||
|
jmp itsdead
|
||||||
|
itsok:
|
||||||
|
clc
|
||||||
|
itsdead:
|
||||||
|
pop di si ax
|
||||||
|
ret
|
||||||
|
|
||||||
|
non db '/<>|"?*:\',01,0FFh
|
||||||
|
|
||||||
|
;Renvoie non carry si le texte point‚ par si est de la base cl
|
||||||
|
str0isbase:
|
||||||
|
push ax cx si di es
|
||||||
|
push cs
|
||||||
|
pop es
|
||||||
|
mov ah,cl
|
||||||
|
isstrbase:
|
||||||
|
mov al,[si]
|
||||||
|
cmp al,0
|
||||||
|
je okbase
|
||||||
|
mov cl,ah
|
||||||
|
xor ch,ch
|
||||||
|
mov di,cx
|
||||||
|
cmp al,es:[di-2+offset basen]
|
||||||
|
je verifbase
|
||||||
|
xor ch,ch
|
||||||
|
inc cl
|
||||||
|
mov di,offset base
|
||||||
|
cld
|
||||||
|
repne scasb
|
||||||
|
cmp cx,0
|
||||||
|
je nobase
|
||||||
|
inc si
|
||||||
|
jmp isstrbase
|
||||||
|
okbase:
|
||||||
|
clc
|
||||||
|
endbase:
|
||||||
|
pop es di si cx ax
|
||||||
|
ret
|
||||||
|
verifbase:
|
||||||
|
cmp byte ptr [si+1],0
|
||||||
|
je okbase
|
||||||
|
nobase:
|
||||||
|
stc
|
||||||
|
jmp endbase
|
||||||
|
|
||||||
|
temp dw 0
|
||||||
|
|
||||||
|
;Converti un str de base cl en int dans edx
|
||||||
|
str0toint:
|
||||||
|
push eax bx ecx si edi ebp es
|
||||||
|
push cs
|
||||||
|
pop es
|
||||||
|
mov ah,cl
|
||||||
|
mov cs:temp,si
|
||||||
|
gotos:
|
||||||
|
cmp byte ptr [si+1], 0
|
||||||
|
je oklo
|
||||||
|
inc si
|
||||||
|
jmp gotos
|
||||||
|
oklo:
|
||||||
|
mov edi,1
|
||||||
|
xor ebp,ebp
|
||||||
|
mov bl,cl
|
||||||
|
baseto:
|
||||||
|
cmp si,cs:temp
|
||||||
|
jb endbaseto
|
||||||
|
mov al,[si]
|
||||||
|
xor ecx,ecx
|
||||||
|
mov cl,bl
|
||||||
|
inc cl
|
||||||
|
push di
|
||||||
|
mov di,offset base
|
||||||
|
cld
|
||||||
|
repne scasb
|
||||||
|
pop di
|
||||||
|
jne noop
|
||||||
|
sub cl,bl
|
||||||
|
neg cl
|
||||||
|
mov eax,edi
|
||||||
|
mul ecx
|
||||||
|
add ebp,eax
|
||||||
|
mov eax,edi
|
||||||
|
mov cl,bl
|
||||||
|
mul ecx
|
||||||
|
mov edi,eax
|
||||||
|
noop:
|
||||||
|
dec si
|
||||||
|
jmp baseto
|
||||||
|
endbaseto:
|
||||||
|
mov edx,ebp
|
||||||
|
pop es ebp edi si ecx bx eax
|
||||||
|
ret
|
||||||
|
base db '0123456789ABCDEF'
|
||||||
|
basen db 'B O D H'
|
||||||
|
basenn db 1,0,0,0,0,0,2,0,3,0,0,0,0,0,4
|
||||||
|
|
||||||
|
;Renvoie en es:di la partie de cx caractŠres a partir de la gauche de ds:si
|
||||||
|
Left0:
|
||||||
|
push ax cx si di
|
||||||
|
cld
|
||||||
|
rep movsb
|
||||||
|
mov al,0
|
||||||
|
stosb
|
||||||
|
pop di si cx ax
|
||||||
|
ret
|
||||||
|
|
||||||
|
;Renvoie en es:di la partie de cx caractŠres a partir de la droite de ds:si
|
||||||
|
Right0:
|
||||||
|
push ax cx dx si di
|
||||||
|
mov dx,cx
|
||||||
|
call getlength0
|
||||||
|
add si,cx
|
||||||
|
sub si,dx
|
||||||
|
mov cx,dx
|
||||||
|
cld
|
||||||
|
rep movsb
|
||||||
|
mov al,0
|
||||||
|
stosb
|
||||||
|
pop di si dx cx ax
|
||||||
|
ret
|
||||||
|
|
||||||
|
;Renvoie en es:di la partie de cx caractŠres a partir de la position bx de ds:si
|
||||||
|
middle0:
|
||||||
|
push ax cx si di
|
||||||
|
add si,bx
|
||||||
|
cld
|
||||||
|
rep movsb
|
||||||
|
mov al,0
|
||||||
|
stosb
|
||||||
|
pop di si cx ax
|
||||||
|
ret
|
||||||
|
|
||||||
|
;Rempli de cx caractŠres dl a partir de la position bx de ds:si
|
||||||
|
Fill0:
|
||||||
|
push ax bx cx si di es
|
||||||
|
push ds
|
||||||
|
pop es
|
||||||
|
add si,bx
|
||||||
|
mov al,dl
|
||||||
|
mov di,si
|
||||||
|
cld
|
||||||
|
rep stosb
|
||||||
|
pop es di si cx bx ax
|
||||||
|
ret
|
||||||
|
|
||||||
|
;Remplace tout les caractŠres al de ds:si par des caractŠres dl
|
||||||
|
ReplaceAllchar0:
|
||||||
|
push ax cx di es
|
||||||
|
call GetLength0
|
||||||
|
push ds
|
||||||
|
pop es
|
||||||
|
mov di,si
|
||||||
|
findandchange:
|
||||||
|
repne scasb
|
||||||
|
cmp cx,0
|
||||||
|
je endofchange
|
||||||
|
mov es:[di-1],dl
|
||||||
|
jmp findandchange
|
||||||
|
endofchange:
|
||||||
|
pop es di cx ax
|
||||||
|
ret
|
||||||
|
|
||||||
|
|
||||||
|
;Recherche un caractŠre dl dans la chaŒne ds:si
|
||||||
|
SearchChar0:
|
||||||
|
push ax cx di es
|
||||||
|
call GetLength0
|
||||||
|
push ds
|
||||||
|
pop es
|
||||||
|
mov di,si
|
||||||
|
mov al,dl
|
||||||
|
repne scasb
|
||||||
|
pop es di cx ax
|
||||||
|
ret
|
||||||
|
|
||||||
|
;Inverse la chaine point‚e en ds:si
|
||||||
|
invert0:
|
||||||
|
push ax cx si di es
|
||||||
|
call GetLength0
|
||||||
|
push ds
|
||||||
|
pop es
|
||||||
|
mov di,si
|
||||||
|
add di,cx
|
||||||
|
dec di
|
||||||
|
revert:
|
||||||
|
mov al,[si]
|
||||||
|
xchg al,es:[di]
|
||||||
|
mov [si],al
|
||||||
|
inc si
|
||||||
|
dec di
|
||||||
|
cmp si,di
|
||||||
|
je finishinvert
|
||||||
|
dec di
|
||||||
|
cmp si,di
|
||||||
|
je finishinvert
|
||||||
|
inc di
|
||||||
|
jmp revert
|
||||||
|
finishinvert:
|
||||||
|
pop es di si cx ax
|
||||||
|
ret
|
||||||
|
|
||||||
|
;Compares 2 chaines de caractŠres DS:SI et ES:DI zerof si non equal
|
||||||
|
cmpstr0:
|
||||||
|
push cx dx si di
|
||||||
|
call GetLength0
|
||||||
|
mov dx,cx
|
||||||
|
push ds si
|
||||||
|
push es
|
||||||
|
pop ds
|
||||||
|
mov si,di
|
||||||
|
call GetLength0
|
||||||
|
pop si ds
|
||||||
|
cmp cx,dx
|
||||||
|
jne NotEqual
|
||||||
|
repe cmpsb
|
||||||
|
NotEqual:
|
||||||
|
pop di si dx cx
|
||||||
|
ret
|
||||||
|
|
||||||
|
;Compares 2 chaines de caractŠres DS:SI et ES:DI zerof si non equal et renvoie le nb de caractŠre egaux dans dx
|
||||||
|
evalue0:
|
||||||
|
push cx si di
|
||||||
|
push ds si
|
||||||
|
push es
|
||||||
|
pop ds
|
||||||
|
mov si,di
|
||||||
|
call GetLength0
|
||||||
|
pop si ds
|
||||||
|
mov dx,cx
|
||||||
|
repe cmpsb
|
||||||
|
pushf
|
||||||
|
sub dx,cx
|
||||||
|
popf
|
||||||
|
pop di si cx
|
||||||
|
ret
|
||||||
|
|
||||||
|
|
||||||
|
;Insert une chaine ds:si en es:di a partir du caractŠre cx
|
||||||
|
insert0:
|
||||||
|
push cx di si
|
||||||
|
add di,cx
|
||||||
|
call getlength0
|
||||||
|
push si di ds
|
||||||
|
push es
|
||||||
|
pop ds
|
||||||
|
mov si,di
|
||||||
|
add di,cx
|
||||||
|
call copy20
|
||||||
|
pop ds di si
|
||||||
|
cld
|
||||||
|
inc di
|
||||||
|
rep movsb
|
||||||
|
pop si di cx
|
||||||
|
ret
|
||||||
|
|
||||||
|
;Detruit CX caractŠres a partir du caractŠre BX de DS:SI
|
||||||
|
delete0:
|
||||||
|
push cx dx si di es
|
||||||
|
push ds
|
||||||
|
pop es
|
||||||
|
mov dx,cx
|
||||||
|
call getlength0
|
||||||
|
sub cx,dx
|
||||||
|
sub cx,bx
|
||||||
|
inc cx
|
||||||
|
add si,bx
|
||||||
|
mov di,si
|
||||||
|
add si,dx
|
||||||
|
cld
|
||||||
|
rep movsb
|
||||||
|
pop es di si dx cx
|
||||||
|
ret
|
||||||
|
|
||||||
|
;Copie une chaine de ds:si en es:di
|
||||||
|
Copy0:
|
||||||
|
push ax cx si di
|
||||||
|
call GetLength0
|
||||||
|
cld
|
||||||
|
rep movsb
|
||||||
|
mov al,0
|
||||||
|
stosb
|
||||||
|
pop di si cx ax
|
||||||
|
ret
|
||||||
|
|
||||||
|
;Copie une chaine de ds:si en es:di
|
||||||
|
Copy20:
|
||||||
|
push ax cx si di
|
||||||
|
call GetLength0
|
||||||
|
cld
|
||||||
|
add si,cx
|
||||||
|
add di,cx
|
||||||
|
inc cx
|
||||||
|
std
|
||||||
|
rep movsb
|
||||||
|
pop di si cx ax
|
||||||
|
ret
|
||||||
|
|
||||||
|
;ConcatŠne le chaine ds:si avec es:di
|
||||||
|
Concat0:
|
||||||
|
push ax cx dx si di
|
||||||
|
call GetLength0
|
||||||
|
mov dx,cx
|
||||||
|
xchg si,di
|
||||||
|
push ds
|
||||||
|
push es
|
||||||
|
pop ds
|
||||||
|
call GetLength0
|
||||||
|
pop ds
|
||||||
|
xchg si,di
|
||||||
|
add di,cx
|
||||||
|
mov cx,dx
|
||||||
|
cld
|
||||||
|
rep movsb
|
||||||
|
mov al,0
|
||||||
|
stosb
|
||||||
|
pop di si dx cx ax
|
||||||
|
ret
|
||||||
|
|
||||||
|
;Met DL comme d‚limiteur par d‚faut
|
||||||
|
SetDelimiter0:
|
||||||
|
mov cs:delim,dl
|
||||||
|
ret
|
||||||
|
|
||||||
|
;Renvoie le d‚limiteur par d‚faut dans dl
|
||||||
|
GetDelimiter0:
|
||||||
|
mov dl,cs:delim
|
||||||
|
ret
|
||||||
|
delim db 0
|
||||||
|
|
||||||
|
;D‚truit les d‚limiteur qui sont cons‚cutifs dans ds:si
|
||||||
|
CompressDelimiter0:
|
||||||
|
push ax dx si di es
|
||||||
|
call Getlength0
|
||||||
|
push ds
|
||||||
|
pop es
|
||||||
|
mov di,si
|
||||||
|
mov al,cs:delim
|
||||||
|
xor dx,dx
|
||||||
|
Compressitems:
|
||||||
|
repne scasb
|
||||||
|
inc dx
|
||||||
|
againcomp:
|
||||||
|
cmp [di],al
|
||||||
|
jne nosup
|
||||||
|
mov si,di
|
||||||
|
mov bx,0
|
||||||
|
push cx
|
||||||
|
mov cx,1
|
||||||
|
call delete0
|
||||||
|
pop cx
|
||||||
|
jmp againcomp
|
||||||
|
nosup:
|
||||||
|
cmp cx,0
|
||||||
|
jne compressitems
|
||||||
|
mov cx,dx
|
||||||
|
pop es di si dx ax
|
||||||
|
ret
|
||||||
|
|
||||||
|
;Met le nombre d'‚l‚ments … cx
|
||||||
|
Setnbitems0:
|
||||||
|
push ax cx dx di es
|
||||||
|
mov dx,cx
|
||||||
|
call Getnbitems0
|
||||||
|
cmp cx,dx
|
||||||
|
je noadjust
|
||||||
|
ja subsome
|
||||||
|
push ds
|
||||||
|
pop es
|
||||||
|
mov di,si
|
||||||
|
sub cx,dx
|
||||||
|
neg cx
|
||||||
|
push cx
|
||||||
|
call getlength0
|
||||||
|
add di,cx
|
||||||
|
pop cx
|
||||||
|
mov al,cs:delim
|
||||||
|
mov ah,'a'
|
||||||
|
rep stosw
|
||||||
|
mov al,0
|
||||||
|
stosb
|
||||||
|
jmp noadjust
|
||||||
|
subsome:
|
||||||
|
mov cx,dx
|
||||||
|
call GetPointeritem0
|
||||||
|
dec di
|
||||||
|
mov byte ptr [di],0
|
||||||
|
noadjust:
|
||||||
|
pop es di dx cx
|
||||||
|
ret
|
||||||
|
|
||||||
|
;Renvoie la taille dx de l'‚l‚ment cx
|
||||||
|
Getitemsize:
|
||||||
|
push cx di
|
||||||
|
call getpointeritem0
|
||||||
|
mov dx,di
|
||||||
|
inc cx
|
||||||
|
call getpointeritem0
|
||||||
|
sub dx,di
|
||||||
|
neg dx
|
||||||
|
dec dx
|
||||||
|
pop di cx
|
||||||
|
ret
|
||||||
|
|
||||||
|
;Renvoie en es:di l'‚l‚ment cx de ds:si
|
||||||
|
Getitem0:
|
||||||
|
push si di cx ax
|
||||||
|
push di
|
||||||
|
call getPointeritem0
|
||||||
|
call getitemsize
|
||||||
|
mov si,di
|
||||||
|
pop di
|
||||||
|
mov cx,dx
|
||||||
|
rep movsb
|
||||||
|
mov al,0
|
||||||
|
stosb
|
||||||
|
pop ax cx di si
|
||||||
|
ret
|
||||||
|
|
||||||
|
;renvoi un pointeur di sur l'‚l‚ment cx de ds:si
|
||||||
|
GetPointeritem0:
|
||||||
|
push ax bx cx dx es
|
||||||
|
mov bx,cx
|
||||||
|
call Getlength0
|
||||||
|
push ds
|
||||||
|
pop es
|
||||||
|
mov di,si
|
||||||
|
mov al,cs:delim
|
||||||
|
xor dx,dx
|
||||||
|
Countnbitems:
|
||||||
|
cmp bx,dx
|
||||||
|
je finishpointer
|
||||||
|
repne scasb
|
||||||
|
inc dx
|
||||||
|
cmp cx,0
|
||||||
|
jne countnbitems
|
||||||
|
inc di
|
||||||
|
finishpointer:
|
||||||
|
pop es dx cx bx ax
|
||||||
|
ret
|
||||||
|
|
||||||
|
;Renvoie le nombre d'‚l‚ments cx de ds:si
|
||||||
|
GetNbitems0:
|
||||||
|
push ax dx di es
|
||||||
|
call Getlength0
|
||||||
|
push ds
|
||||||
|
pop es
|
||||||
|
mov di,si
|
||||||
|
mov al,cs:delim
|
||||||
|
xor dx,dx
|
||||||
|
Countitems:
|
||||||
|
repne scasb
|
||||||
|
inc dx
|
||||||
|
cmp cx,0
|
||||||
|
jne countitems
|
||||||
|
mov cx,dx
|
||||||
|
pop es di dx ax
|
||||||
|
ret
|
||||||
|
|
||||||
|
;renvoie la taille en octets CX de la chaine point‚e en ds:si
|
||||||
|
GetLength0:
|
||||||
|
push ax di es
|
||||||
|
push ds
|
||||||
|
pop es
|
||||||
|
mov di,si
|
||||||
|
mov al,0
|
||||||
|
mov cx,0FFFFh
|
||||||
|
cld
|
||||||
|
repne scasb
|
||||||
|
neg cx
|
||||||
|
dec cx
|
||||||
|
dec cx
|
||||||
|
pop es di ax
|
||||||
|
ret
|
||||||
|
|
||||||
|
;Met la taille en octets de la chaine point‚e ds:si a CX
|
||||||
|
SetLength0:
|
||||||
|
push bx
|
||||||
|
mov bx,cx
|
||||||
|
mov byte ptr [si+bx],0
|
||||||
|
pop bx
|
||||||
|
ret
|
||||||
|
|
||||||
|
;met en majuscule la chaine ds:si
|
||||||
|
UpperCase0:
|
||||||
|
push si ax
|
||||||
|
UpperCase:
|
||||||
|
mov al,ds:[si]
|
||||||
|
inc si
|
||||||
|
cmp al,0
|
||||||
|
je EndUpperCase
|
||||||
|
cmp al,'a'
|
||||||
|
jb UpperCase
|
||||||
|
cmp al,'z'
|
||||||
|
ja UpperCase
|
||||||
|
sub byte ptr [si-1],'a'-'A'
|
||||||
|
jmp UpperCase
|
||||||
|
EndUpperCase:
|
||||||
|
clc
|
||||||
|
pop ax si
|
||||||
|
ret
|
||||||
|
|
||||||
|
;met en majuscule la premiŠre lettre chaine ds:si
|
||||||
|
OneCase0:
|
||||||
|
push ax
|
||||||
|
OneUpperCase:
|
||||||
|
mov al,ds:[si]
|
||||||
|
cmp al,'a'
|
||||||
|
jb OneEndUpperCase
|
||||||
|
cmp al,'z'
|
||||||
|
ja OneEndUpperCase
|
||||||
|
sub byte ptr [si],'a'-'A'
|
||||||
|
OneEndUpperCase:
|
||||||
|
clc
|
||||||
|
pop ax
|
||||||
|
ret
|
||||||
|
|
||||||
|
;met en minuscule la chaine ds:si
|
||||||
|
LowerCase0:
|
||||||
|
push si ax
|
||||||
|
LowerCase:
|
||||||
|
mov al,ds:[si]
|
||||||
|
inc si
|
||||||
|
cmp al,0
|
||||||
|
je EndLowerCase
|
||||||
|
cmp al,'A'
|
||||||
|
jb LowerCase
|
||||||
|
cmp al,'Z'
|
||||||
|
ja LowerCase
|
||||||
|
add byte ptr [si-1],'a'-'A'
|
||||||
|
jmp LowerCase
|
||||||
|
EndLowerCase:
|
||||||
|
clc
|
||||||
|
pop ax si
|
||||||
|
ret
|
||||||
|
|
||||||
|
;Inverse la casse la chaine ds:si
|
||||||
|
InvertCase0:
|
||||||
|
push si ax
|
||||||
|
InvertCase:
|
||||||
|
mov al,ds:[si]
|
||||||
|
inc si
|
||||||
|
cmp al,0
|
||||||
|
je EndInvertCase
|
||||||
|
cmp al,'A'
|
||||||
|
jb InvertCase
|
||||||
|
cmp al,'Z'
|
||||||
|
jbe GoInvertCase
|
||||||
|
cmp al,'a'
|
||||||
|
jb InvertCase
|
||||||
|
cmp al,'z'
|
||||||
|
ja InvertCase
|
||||||
|
sub byte ptr [si-1],'a'-'A'
|
||||||
|
jmp InvertCase
|
||||||
|
GoInvertCase:
|
||||||
|
add byte ptr [si-1],'a'-'A'
|
||||||
|
jmp InvertCase
|
||||||
|
EndInvertCase:
|
||||||
|
clc
|
||||||
|
pop ax si
|
||||||
|
ret
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,25 @@
|
||||||
|
.model tiny
|
||||||
|
.486
|
||||||
|
smart
|
||||||
|
.code
|
||||||
|
|
||||||
|
org 0100h
|
||||||
|
|
||||||
|
start:
|
||||||
|
mov si,offset essai
|
||||||
|
call whatis0
|
||||||
|
|
||||||
|
|
||||||
|
mov si,offset pop1
|
||||||
|
mov di,offset pop2
|
||||||
|
call checksyntax0
|
||||||
|
ret
|
||||||
|
|
||||||
|
essai db '#',0
|
||||||
|
pop1 db 'essai 0FFh',0
|
||||||
|
pop2 db 'ESSAI 012H',0
|
||||||
|
include str0.asm
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
end start
|
|
@ -1,27 +1,14 @@
|
||||||
[bits 16] ;16 bits
|
[bits 16] ;16 bits
|
||||||
[org 0x0] ;Point d'entré en 0h
|
[org 0x0100] ;Point d'entré en 0100h
|
||||||
section .text ;Segment de code
|
section .text ;Segment de code
|
||||||
|
|
||||||
checks db "CE" ;signature de l'exe
|
start:
|
||||||
major db 1 ;N° version
|
mov ah,0x0D
|
||||||
checksum dd 0 ;Checksum de l'exe
|
mov si,msg
|
||||||
compressed db 0 ;a 1 si compressé par RLE
|
int 0x47 ;Afficher le texte (Showstring0)
|
||||||
exports dw 0 ;importation de fonctions
|
xor ax,ax
|
||||||
imports dw imported ;exportation de fonctions
|
int 0x16 ;Attendre l'appuie sur une touche
|
||||||
sections dw 0 ;sections des blocs mémoire
|
retf ;retour far
|
||||||
starting dw realstart
|
|
||||||
|
|
||||||
imported:
|
msg db 'Hello World',0
|
||||||
db "VIDEO.LIB::print",0
|
|
||||||
print dd 0
|
|
||||||
endofimport dd 0
|
|
||||||
|
|
||||||
realstart:
|
|
||||||
push msg
|
|
||||||
call far [cs:print] ;Afficher le texte (Showstring0)
|
|
||||||
xor ax,ax
|
|
||||||
int 0x16 ;Attendre l'appuie sur une touche
|
|
||||||
retf ;retour far
|
|
||||||
|
|
||||||
msg db 'Hello World !!',0
|
|
||||||
|
|
||||||
|
|
|
@ -3,29 +3,17 @@
|
||||||
Smart ;Optimisations
|
Smart ;Optimisations
|
||||||
.code ;Segment de code
|
.code ;Segment de code
|
||||||
|
|
||||||
org 0h ;Point d'entré en 0h
|
org 0100h ;Point d'entré en 0100h
|
||||||
|
|
||||||
checks db "CE" ;signature de l'exe
|
|
||||||
major db 1 ;N° version
|
|
||||||
checksum dd 0 ;Checksum de l'exe
|
|
||||||
compressed db 0 ;a 1 si compressé par RLE
|
|
||||||
exports dw 0 ;importation de fonctions
|
|
||||||
imports dw imported ;exportation de fonctions
|
|
||||||
sections dw 0 ;sections des blocs mémoire
|
|
||||||
starting dw realstart
|
|
||||||
|
|
||||||
imported:
|
|
||||||
db "VIDEO.LIB::print",0
|
|
||||||
print dd 0
|
|
||||||
|
|
||||||
start:
|
start:
|
||||||
push msg
|
mov ah,0Dh
|
||||||
call far [cs:print] ;Afficher le texte (Showstring0)
|
mov si,offset msg
|
||||||
xor ax,ax
|
int 47h ;Afficher le texte (Showstring0)
|
||||||
int 16h ;Attendre l'appuie sur une touche
|
xor ax,ax
|
||||||
db 0CBH ;retour far
|
int 16h ;Attendre l'appuie sur une touche
|
||||||
|
db 0CBH ;retour far
|
||||||
|
|
||||||
msg db 'Hello World !!',0
|
msg db 'Hello World',0
|
||||||
|
|
||||||
end start
|
end start
|
||||||
|
|
||||||
|
|
Binary file not shown.
32
include/3d.h
32
include/3d.h
|
@ -1,32 +0,0 @@
|
||||||
struc vertex3d
|
|
||||||
tx dd ?
|
|
||||||
ty dd ?
|
|
||||||
tz dd ?
|
|
||||||
ends vertex3d
|
|
||||||
|
|
||||||
struc mat
|
|
||||||
p1 dd ?
|
|
||||||
p2 dd ?
|
|
||||||
p3 dd ?
|
|
||||||
p4 dd ?
|
|
||||||
p5 dd ?
|
|
||||||
p6 dd ?
|
|
||||||
p7 dd ?
|
|
||||||
p8 dd ?
|
|
||||||
p9 dd ?
|
|
||||||
p10 dd ?
|
|
||||||
p11 dd ?
|
|
||||||
p12 dd ?
|
|
||||||
p13 dd ?
|
|
||||||
p14 dd ?
|
|
||||||
p15 dd ?
|
|
||||||
p16 dd ?
|
|
||||||
ends mat
|
|
||||||
|
|
||||||
main equ 4D4Dh
|
|
||||||
edit equ 3D3Dh
|
|
||||||
object equ 4000h
|
|
||||||
mesh equ 4100h
|
|
||||||
vertex equ 4110h
|
|
||||||
face equ 4120h
|
|
||||||
locale equ 4160h
|
|
|
@ -1,40 +1,40 @@
|
||||||
struc bmp_file
|
BMP_File struc
|
||||||
bmp_filetype db 'bm'
|
BMP_FileType db 'BM'
|
||||||
bmp_filesize dd ? ; taille du fichier
|
BMP_FileSize dd ? ; taille du fichier
|
||||||
bmp_reserved dd 0 ; toujours 0
|
BMP_Reserved dd 0 ; toujours 0
|
||||||
bmp_bitmapoffset dd ? ; offset de l'image
|
BMP_BitMapOffset dd ? ; offset de l'image
|
||||||
bmp_headersize dd ? ; taille de l'entete en octects
|
BMP_HeaderSize dd ? ; taille de l'entete en octects
|
||||||
bmp_width dd ? ; largeur en pixels de l'image
|
BMP_Width dd ? ; largeur en pixels de l'image
|
||||||
bmp_height dd ? ; hauteur en pixels de l'image
|
BMP_Height dd ? ; hauteur en pixels de l'image
|
||||||
bmp_planes dw 1 ; nombre de plan utilisés
|
BMP_Planes dw 1 ; nombre de plan utilisés
|
||||||
bmp_bitsperpixel dw ? ; nombre de bits par pixels
|
BMP_BitsPerPixel dw ? ; nombre de bits par pixels
|
||||||
bmp_compression dd ? ; méthode de compression
|
BMP_Compression dd ? ; méthode de compression
|
||||||
bmp_sizeofbitmap dd ? ; taille de l'image en octects
|
BMP_SizeOfBitMap dd ? ; taille de l'image en octects
|
||||||
bmp_horzresolution dd ? ; resolution horizontale en pixels par mètre
|
BMP_HorzResolution dd ? ; resolution horizontale en pixels par mètre
|
||||||
bmp_vertresolution dd ? ; resolution verticale en pixels par mètre
|
BMP_VertResolution dd ? ; resolution verticale en pixels par mètre
|
||||||
bmp_colorsused dd ? ; nombre de couleur dans la palette si 0: palette entière si bitperpixel<=8
|
BMP_ColorsUsed dd ? ; nombre de couleur dans la palette si 0: palette entière si BitPerPixel<=8
|
||||||
bmp_colorsimportant dd ? ; nombre de couleurs importantes masques pour les modes de plus de 8 bits par pixels
|
BMP_ColorsImportant dd ? ; nombre de couleurs importantes masques pour les modes de plus de 8 bits par pixels
|
||||||
bmp_redmask dd ?
|
BMP_RedMask dd ?
|
||||||
bmp_greenmask dd ?
|
BMP_GreenMask dd ?
|
||||||
bmp_bluemask dd ?
|
BMP_BlueMask dd ?
|
||||||
bmp_alphamask dd ?
|
BMP_AlphaMask dd ?
|
||||||
bmp_colorspacetype dd ?
|
BMP_ColorSpaceType dd ?
|
||||||
bmp_redx dd ?
|
BMP_RedX dd ?
|
||||||
bmp_redy dd ?
|
BMP_RedY dd ?
|
||||||
bmp_redz dd ?
|
BMP_RedZ dd ?
|
||||||
bmp_greenx dd ?
|
BMP_GreenX dd ?
|
||||||
bmp_greeny dd ?
|
BMP_GreenY dd ?
|
||||||
bmp_greenz dd ?
|
BMP_GreenZ dd ?
|
||||||
bmp_bluex dd ?
|
BMP_BlueX dd ?
|
||||||
bmp_bluey dd ?
|
BMP_BlueY dd ?
|
||||||
bmp_bluez dd ?
|
BMP_BlueZ dd ?
|
||||||
bmp_gammared dd ?
|
BMP_GammaRed dd ?
|
||||||
bmp_gammagreen dd ?
|
BMP_GammaGreen dd ?
|
||||||
bmp_gammeblue dd ?
|
BMP_GammeBlue dd ?
|
||||||
ends bmp_file
|
BMP_file ends
|
||||||
|
|
||||||
;bmp_compression peut prendre les valeurs suivantes:
|
;BMP_Compression peut prendre les valeurs suivantes:
|
||||||
bmp_comp_uncomp equ 0 ; pas de compression
|
BMP_COMP_UNCOMP equ 0 ; pas de compression
|
||||||
bmp_comp_rle8 equ 1 ; 8-bit run length encoding
|
BMP_COMP_RLE8 equ 1 ; 8-bit run length encoding
|
||||||
bmp_comp_rle4 equ 2 ; 4-bit tun length encoding
|
BMP_COMP_RLE4 equ 2 ; 4-bit tun length encoding
|
||||||
bmp_comp_bfe equ 3 ; bitfields encoding
|
BMP_COMP_BFE equ 3 ; bitfields encoding
|
||||||
|
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
|
@ -1,9 +1,3 @@
|
||||||
struc diskbuffer
|
|
||||||
size dw 12
|
|
||||||
current dw 0FFFFh
|
|
||||||
chain dw 128 dup (0FFFFh)
|
|
||||||
ends diskbuffer
|
|
||||||
|
|
||||||
struc dpt
|
struc dpt
|
||||||
steprate&headunload db 0DFh ;Vitesse de progression & mont‚e de la tˆte
|
steprate&headunload db 0DFh ;Vitesse de progression & mont‚e de la tˆte
|
||||||
dmaflag&headload db 002h ;Etat Dma et temps de descente de la tˆte
|
dmaflag&headload db 002h ;Etat Dma et temps de descente de la tˆte
|
||||||
|
@ -34,15 +28,6 @@ filegroup dw 0
|
||||||
filesize dd 0
|
filesize dd 0
|
||||||
ends entries
|
ends entries
|
||||||
|
|
||||||
;Pour recherches
|
|
||||||
struct find
|
|
||||||
files db 13 dup (0) ;le fichier
|
|
||||||
entryplace dw 0 ;En octet
|
|
||||||
adressdirectory dw 0 ;En cluster
|
|
||||||
firstsearch db 1 ;Premiere requete ?
|
|
||||||
result entries <>
|
|
||||||
ends find
|
|
||||||
|
|
||||||
struc bootinfo
|
struc bootinfo
|
||||||
vendor db 'COS2000A' ;Fabricant + n°série Formatage
|
vendor db 'COS2000A' ;Fabricant + n°série Formatage
|
||||||
sectorsize dw 512 ;octet/secteur
|
sectorsize dw 512 ;octet/secteur
|
||||||
|
|
|
@ -2,31 +2,3 @@ struc point
|
||||||
coordx db 0
|
coordx db 0
|
||||||
coordy db 0
|
coordy db 0
|
||||||
ends point
|
ends point
|
||||||
|
|
||||||
struc vgainf
|
|
||||||
lines db 0
|
|
||||||
columns db 0
|
|
||||||
x db 0
|
|
||||||
y db 0
|
|
||||||
xy dw 0
|
|
||||||
colors db 7
|
|
||||||
mode db 0FFh
|
|
||||||
pagesize dw 0
|
|
||||||
style db 0
|
|
||||||
font db 0
|
|
||||||
graphic db 0
|
|
||||||
nbpage db 0
|
|
||||||
color db 0
|
|
||||||
cursor db 0
|
|
||||||
segments dw 0
|
|
||||||
linesize dw 0
|
|
||||||
adress dw 0
|
|
||||||
base dw 0
|
|
||||||
scrolling db 1
|
|
||||||
ends vgainf
|
|
||||||
|
|
||||||
|
|
||||||
struc vertex2d
|
|
||||||
px dw ?
|
|
||||||
py dw ?
|
|
||||||
ends vertex2d
|
|
||||||
|
|
102
include/mem.h
102
include/mem.h
|
@ -1,58 +1,3 @@
|
||||||
struc regs
|
|
||||||
seip dd 0
|
|
||||||
seax dd 0
|
|
||||||
sebx dd 0
|
|
||||||
secx dd 0
|
|
||||||
sedx dd 0
|
|
||||||
sesi dd 0
|
|
||||||
sedi dd 0
|
|
||||||
sebp dd 0
|
|
||||||
sesp dd 0
|
|
||||||
scs dw 0
|
|
||||||
sds dw 0
|
|
||||||
ses dw 0
|
|
||||||
sfs dw 0
|
|
||||||
sgs dw 0
|
|
||||||
sss dw 0
|
|
||||||
seflags dd 0
|
|
||||||
;sst0 dt 0
|
|
||||||
;sst1 dt 0
|
|
||||||
;sst2 dt 0
|
|
||||||
;sst3 dt 0
|
|
||||||
;sst4 dt 0
|
|
||||||
;sst5 dt 0
|
|
||||||
;sst6 dt 0
|
|
||||||
;sst7 dt 0
|
|
||||||
ends regs
|
|
||||||
|
|
||||||
struc tuple ;vecteur d'interruption
|
|
||||||
off dw 0 ;adresse
|
|
||||||
seg dw 0 ;segment
|
|
||||||
ends tuple
|
|
||||||
|
|
||||||
union vector
|
|
||||||
data tuple <>
|
|
||||||
content dd 0
|
|
||||||
ends
|
|
||||||
|
|
||||||
struc ints ;bloc interruption
|
|
||||||
number db 0 ;numero de l'interruption
|
|
||||||
activated db 0 ;activé ou non
|
|
||||||
locked db 0 ;verrouillée
|
|
||||||
launchedlow dd 0
|
|
||||||
launchedhigh dd 0
|
|
||||||
calledlow dd 0
|
|
||||||
calledhigh dd 0
|
|
||||||
vector1 vector ?
|
|
||||||
vector2 vector ?
|
|
||||||
vector3 vector ?
|
|
||||||
vector4 vector ?
|
|
||||||
vector5 vector ?
|
|
||||||
vector6 vector ?
|
|
||||||
vector7 vector ?
|
|
||||||
vector8 vector ?
|
|
||||||
ends ints
|
|
||||||
|
|
||||||
struc mb ;Bloc de mémoire
|
struc mb ;Bloc de mémoire
|
||||||
check db "NH" ;signature du bloc de mémoire
|
check db "NH" ;signature du bloc de mémoire
|
||||||
isnotlast db 0 ;flag indiquant le dernier bloc
|
isnotlast db 0 ;flag indiquant le dernier bloc
|
||||||
|
@ -84,49 +29,4 @@ ends descriptor
|
||||||
|
|
||||||
|
|
||||||
free equ 0 ;Reference quand libre
|
free equ 0 ;Reference quand libre
|
||||||
|
memorystart equ 0052h ;premier bloc de la mémoire
|
||||||
|
|
||||||
|
|
||||||
macro exporting
|
|
||||||
label exports
|
|
||||||
endm
|
|
||||||
|
|
||||||
macro importing
|
|
||||||
label imports
|
|
||||||
endm
|
|
||||||
|
|
||||||
macro noimporting
|
|
||||||
label imports
|
|
||||||
dd 0
|
|
||||||
endm
|
|
||||||
|
|
||||||
macro noexporting
|
|
||||||
label imports
|
|
||||||
dd 0
|
|
||||||
endm
|
|
||||||
|
|
||||||
macro ende
|
|
||||||
dd 0
|
|
||||||
endm
|
|
||||||
|
|
||||||
macro endi
|
|
||||||
dd 0
|
|
||||||
endm
|
|
||||||
|
|
||||||
macro use lib:req,fonction:req
|
|
||||||
db "&lib&::&fonction&",0
|
|
||||||
label &fonction& dword
|
|
||||||
dd 0
|
|
||||||
endm
|
|
||||||
|
|
||||||
macro declare fonction:req
|
|
||||||
db "&fonction&",0
|
|
||||||
dw offset fonction
|
|
||||||
endm
|
|
||||||
|
|
||||||
macro heading versmaj:req,versmin:req,start:req
|
|
||||||
header exe <"CE",offset &versmaj&,offset &versmin&,0,offset exports,offset imports,0,offset &start&>
|
|
||||||
db "&fonction&",0
|
|
||||||
dw offset fonction
|
|
||||||
endif
|
|
||||||
endm
|
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
asm= lzasm /z/t
|
asm= lzasm
|
||||||
lnk= elink
|
lnk= elink
|
||||||
|
|
||||||
all: setup.com
|
all: setup.com
|
||||||
|
|
||||||
setup.com: setup.obj
|
setup.com: setup.obj
|
||||||
$(lnk) setup.obj setup.com /c
|
$(lnk) setup.obj setup.com
|
||||||
|
|
||||||
setup.obj:
|
setup.obj:
|
||||||
$(asm) setup.asm
|
$(asm) setup.asm
|
||||||
|
|
|
@ -11,7 +11,7 @@ ent equ 32h
|
||||||
|
|
||||||
jmp copycos
|
jmp copycos
|
||||||
|
|
||||||
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,'$'
|
message db 0Dh,0Ah,'COS 2000 V1.3.1BetaFr 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,'$'
|
||||||
message2 db 0Dh,0AH,'Creation du secteur de demarrage...',0Dh,0Ah,'$'
|
message2 db 0Dh,0AH,'Creation du secteur de demarrage...',0Dh,0Ah,'$'
|
||||||
message3 db 0Dh,0AH,'Copie des fichiers systeme...',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,'$'
|
errormsg db 0Dh,0AH,'Erreur d''installation, contactez moi a COS2000@MULTIMANIA.COM !',0Dh,0AH,'$'
|
||||||
|
|
1222
lib/3d.asm
1222
lib/3d.asm
File diff suppressed because it is too large
Load Diff
20
lib/MAKEFILE
20
lib/MAKEFILE
|
@ -1,17 +1,23 @@
|
||||||
asm= lzasm /z/t
|
asm= lzasm
|
||||||
lnk= elink
|
lnk= elink
|
||||||
|
|
||||||
all: detect.lib video.lib str0.lib bmp.lib graphic.lib 3d.lib math.lib
|
all: detect.lib video.lib
|
||||||
|
|
||||||
.asm.obj:
|
detect.lib: detect.obj
|
||||||
$(asm) $<
|
$(lnk) detect.obj detect.lib
|
||||||
|
|
||||||
.obj.lib:
|
video.lib: video.obj
|
||||||
$(lnk) $< $*.lib
|
$(lnk) video.obj video.lib
|
||||||
|
|
||||||
|
detect.obj:
|
||||||
|
$(asm) detect.asm
|
||||||
|
|
||||||
|
video.obj:
|
||||||
|
$(asm) video.asm
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
del *.obj
|
del *.obj
|
||||||
del *.ce
|
del *.exe
|
||||||
del *.bak
|
del *.bak
|
||||||
del *.lib
|
del *.lib
|
||||||
del *.com
|
del *.com
|
||||||
|
|
113
lib/bmp.asm
113
lib/bmp.asm
|
@ -1,72 +1,77 @@
|
||||||
model tiny,stdcall
|
.model tiny
|
||||||
p586N
|
.486
|
||||||
|
smart
|
||||||
locals
|
locals
|
||||||
jumps
|
.code
|
||||||
codeseg
|
|
||||||
option procalign:byte
|
|
||||||
|
|
||||||
include "..\include\mem.h"
|
|
||||||
include "..\include\divers.h"
|
|
||||||
include "..\include\bmp.h"
|
|
||||||
|
|
||||||
org 0h
|
org 0h
|
||||||
|
|
||||||
start:
|
include ..\include\mem.h
|
||||||
header exe <"CE",1,0,0,offset exports,offset imports,,>
|
include ..\include\bmp.h
|
||||||
|
|
||||||
exporting
|
|
||||||
declare showbmp
|
|
||||||
declare loadbmppalet
|
|
||||||
ende
|
|
||||||
|
|
||||||
importing
|
start:
|
||||||
use VIDEO,showpixel
|
header exe <,1,0,,,,offset exports,>
|
||||||
endi
|
|
||||||
|
exports:
|
||||||
|
db "showbmp",0
|
||||||
|
dw showbmp
|
||||||
|
db "loadbmppalet",0
|
||||||
|
dw loadbmppalet
|
||||||
|
dw 0
|
||||||
|
|
||||||
|
|
||||||
;==========SHOWBMP=========
|
;==========SHOWBMP=========
|
||||||
;Affiche le BMP pointée par DS:%0 en %1, %2
|
;Affiche le BMP pointée par DS:%0 en %1, %2
|
||||||
;<- DS:%0 BMP, %1 coordonnées X, %2 coordonnées Y
|
;<- DS:%0 BMP, %1 coordonnées X, %2 coordonnées Y
|
||||||
;->
|
;->
|
||||||
;==========================
|
;==========================
|
||||||
PROC showbmp FAR
|
showbmp PROC FAR
|
||||||
ARG @pointer:word, @x:word, @y:word
|
ARG pointer:word, x:word, y:word=taille
|
||||||
USES ax,bx,cx,dx,si,di
|
push bp
|
||||||
mov si,[@pointer]
|
mov bp,sp
|
||||||
cmp [word ptr (bmp_file si).bmp_filetype],"MB"
|
push ax bx cx dx si di
|
||||||
|
mov si,[pointer]
|
||||||
|
cmp word ptr [si+BMP_file.BMP_FileType],"MB"
|
||||||
jne @@errorshowing
|
jne @@errorshowing
|
||||||
mov edi,[(bmp_file si).bmp_bitmapoffset]
|
mov edi,[si+BMP_BitMapOffset]
|
||||||
add di,400h
|
|
||||||
add di,si
|
add di,si
|
||||||
|
mov ah,8
|
||||||
xor ebx,ebx
|
xor ebx,ebx
|
||||||
mov ecx,[(bmp_file si).bmp_height]
|
mov ecx,[si+offset BMP_File.BMP_height]
|
||||||
mov edx,[(bmp_file si).bmp_width]
|
mov edx,[si+offset BMP_File.BMP_width]
|
||||||
;and dx,11111100b
|
and dx,11111100b
|
||||||
cmp edx,[(bmp_file si).bmp_width]
|
cmp edx,[si+offset BMP_File.BMP_width]
|
||||||
;jae @@noadjust
|
jae @@noadjust
|
||||||
;add dx,4
|
add dx,4
|
||||||
@@noadjust:
|
@@noadjust:
|
||||||
sub edx,[(bmp_file si).bmp_width]
|
sub dx,[si+offset BMP_File.BMP_width]
|
||||||
@@bouclette:
|
@@bouclette:
|
||||||
|
mov al,[di]
|
||||||
push bx cx
|
push bx cx
|
||||||
add bx,[@x]
|
add bx,[x]
|
||||||
add cx,[@y]
|
add cx,[y]
|
||||||
call [cs:showpixel],bx,cx,[word ptr di]
|
int 47h
|
||||||
pop cx bx
|
pop cx bx
|
||||||
inc bx
|
inc bx
|
||||||
inc di
|
inc di
|
||||||
cmp ebx,[(bmp_file si).bmp_width]
|
cmp ebx,[si+offset BMP_File.BMP_width]
|
||||||
jb @@bouclette
|
jb @@bouclette
|
||||||
xor bx,bx
|
xor bx,bx
|
||||||
;add di,dx
|
add di,dx
|
||||||
dec cx
|
dec cx
|
||||||
cmp cx,0
|
cmp cx,0
|
||||||
jne @@bouclette
|
jne @@bouclette
|
||||||
clc
|
clc
|
||||||
ret
|
pop di si dx cx bx ax
|
||||||
|
pop bp
|
||||||
|
retf taille
|
||||||
|
|
||||||
@@errorshowing:
|
@@errorshowing:
|
||||||
stc
|
stc
|
||||||
ret
|
pop di si cx bx ax
|
||||||
ENDP showbmp
|
pop bp
|
||||||
|
retf taille
|
||||||
|
|
||||||
|
showbmp ENDP
|
||||||
|
|
||||||
|
|
||||||
;==========LOADBMPPALET=========
|
;==========LOADBMPPALET=========
|
||||||
|
@ -74,14 +79,16 @@ ENDP showbmp
|
||||||
;-> DS:%0 BMP
|
;-> DS:%0 BMP
|
||||||
;<-
|
;<-
|
||||||
;===============================
|
;===============================
|
||||||
PROC loadbmppalet FAR
|
loadbmppalet PROC FAR
|
||||||
ARG @pointer:word
|
ARG pointer:word=taille
|
||||||
USES ax,bx,cx,dx,si
|
push bp
|
||||||
mov si,[@pointer]
|
mov bp,sp
|
||||||
|
push ax bx cx dx si
|
||||||
|
mov si,[pointer]
|
||||||
mov bx,0400h+36h-4
|
mov bx,0400h+36h-4
|
||||||
mov cx,100h
|
mov cx,100h
|
||||||
mov dx, 3c8h
|
mov dx, 3c8h
|
||||||
@@paletteload:
|
paletteload:
|
||||||
mov al, cl
|
mov al, cl
|
||||||
dec al
|
dec al
|
||||||
out dx, al
|
out dx, al
|
||||||
|
@ -98,8 +105,10 @@ PROC loadbmppalet FAR
|
||||||
sub bx,4
|
sub bx,4
|
||||||
dec dx
|
dec dx
|
||||||
dec cl
|
dec cl
|
||||||
jnz @@paletteload
|
jnz paletteload
|
||||||
ret
|
pop si dx cx bx ax
|
||||||
ENDP loadbmppalet
|
pop bp
|
||||||
|
retf taille
|
||||||
|
loadbmppalet ENDP
|
||||||
|
|
||||||
|
end start
|
||||||
|
|
|
@ -13,18 +13,28 @@ org 0h
|
||||||
|
|
||||||
header exe <"CE",1,0,0,offset exports,,,>
|
header exe <"CE",1,0,0,offset exports,,,>
|
||||||
|
|
||||||
exporting
|
exports:
|
||||||
declare cpuinfo
|
db "cpuinfo",0
|
||||||
declare setinfo
|
dw cpuinfo
|
||||||
declare pciinfo
|
db "setinfo",0
|
||||||
declare getpciclass
|
dw setinfo
|
||||||
declare getpcisubclass
|
db "pciinfo",0
|
||||||
declare getcardinfo
|
dw pciinfo
|
||||||
declare pcireadbyte
|
db "getpciclass",0
|
||||||
declare pcireadword
|
dw getpciclass
|
||||||
declare pcireaddword
|
db "getpcisubclass",0
|
||||||
declare detectvmware
|
dw getpcisubclass
|
||||||
ende
|
db "getcardinfo",0
|
||||||
|
dw getcardinfo
|
||||||
|
db "pcireadbyte",0
|
||||||
|
dw pcireadbyte
|
||||||
|
db "pcireadword",0
|
||||||
|
dw pcireadword
|
||||||
|
db "pcireaddword",0
|
||||||
|
dw pcireaddword
|
||||||
|
db "detectvmware",0
|
||||||
|
dw detectvmware
|
||||||
|
dd 0
|
||||||
|
|
||||||
PROC detectvmware FAR
|
PROC detectvmware FAR
|
||||||
USES eax,ebx,ecx,edx
|
USES eax,ebx,ecx,edx
|
||||||
|
@ -307,7 +317,6 @@ subclass170 db 'dpio',0
|
||||||
PROC getcardinfo FAR
|
PROC getcardinfo FAR
|
||||||
ARG @bus:word,@device:word,@function:word,@pointer:word
|
ARG @bus:word,@device:word,@function:word,@pointer:word
|
||||||
USES eax,bx,di
|
USES eax,bx,di
|
||||||
mov di,[@pointer]
|
|
||||||
cmp [@function],0
|
cmp [@function],0
|
||||||
je @@amultiorfirst
|
je @@amultiorfirst
|
||||||
call pcireadbyte,[@bus],[@device],0,offset (pcidata).typed
|
call pcireadbyte,[@bus],[@device],0,offset (pcidata).typed
|
||||||
|
@ -318,6 +327,7 @@ PROC getcardinfo FAR
|
||||||
jmp @@notexist
|
jmp @@notexist
|
||||||
@@amultiorfirst:
|
@@amultiorfirst:
|
||||||
xor bx,bx
|
xor bx,bx
|
||||||
|
mov di,[@pointer]
|
||||||
@@goinfos:
|
@@goinfos:
|
||||||
call pcireadword,[@bus],[@device],[@function],bx
|
call pcireadword,[@bus],[@device],[@function],bx
|
||||||
inc bl
|
inc bl
|
||||||
|
@ -341,7 +351,7 @@ PROC getcardinfo FAR
|
||||||
ret
|
ret
|
||||||
endp getcardinfo
|
endp getcardinfo
|
||||||
|
|
||||||
;lit un octet du bus %0 device %1 function %2 nø %3 et le met en AL
|
;lit un octet du bus %0 device %1 function %2 n° %3 et le met en AL
|
||||||
PROC pcireadbyte FAR
|
PROC pcireadbyte FAR
|
||||||
ARG @bus:word,@device:word,@function:word,@pointer:word
|
ARG @bus:word,@device:word,@function:word,@pointer:word
|
||||||
USES bx,dx
|
USES bx,dx
|
||||||
|
@ -363,7 +373,7 @@ PROC pcireadbyte FAR
|
||||||
ret
|
ret
|
||||||
endp pcireadbyte
|
endp pcireadbyte
|
||||||
|
|
||||||
;lit 2 octet du bus %0 device %1 function %2 nø %3 et le met en AX
|
;lit 2 octet du bus %0 device %1 function %2 n° %3 et le met en AX
|
||||||
PROC pcireadword FAR
|
PROC pcireadword FAR
|
||||||
ARG @bus:word,@device:word,@function:word,@pointer:word
|
ARG @bus:word,@device:word,@function:word,@pointer:word
|
||||||
USES bx,dx
|
USES bx,dx
|
||||||
|
@ -385,7 +395,7 @@ PROC pcireadword FAR
|
||||||
ret
|
ret
|
||||||
endp pcireadword
|
endp pcireadword
|
||||||
|
|
||||||
;lit 4 octet du bus %0 device %1 function %2 nø %3 et le met en EAX
|
;lit 4 octet du bus %0 device %1 function %2 n° %3 et le met en EAX
|
||||||
PROC pcireaddword FAR
|
PROC pcireaddword FAR
|
||||||
ARG @bus:word,@device:word,@function:word,@pointer:word
|
ARG @bus:word,@device:word,@function:word,@pointer:word
|
||||||
USES bx,dx
|
USES bx,dx
|
||||||
|
|
230
lib/graphic.asm
230
lib/graphic.asm
|
@ -1,230 +0,0 @@
|
||||||
model tiny,stdcall
|
|
||||||
p586
|
|
||||||
locals
|
|
||||||
jumps
|
|
||||||
codeseg
|
|
||||||
option procalign:byte
|
|
||||||
|
|
||||||
include "..\include\mem.h"
|
|
||||||
include "..\include\graphic.h"
|
|
||||||
|
|
||||||
org 0h
|
|
||||||
|
|
||||||
header exe <"CE",1,0,0,offset exports,offset imports,,>
|
|
||||||
|
|
||||||
exporting
|
|
||||||
declare hline
|
|
||||||
declare line
|
|
||||||
declare polyfill
|
|
||||||
ende
|
|
||||||
|
|
||||||
importing
|
|
||||||
use VIDEO,showpixel
|
|
||||||
endi
|
|
||||||
|
|
||||||
PROC hline FAR
|
|
||||||
ARG @x1:word,@x2:word,@y:word,@color:word
|
|
||||||
USES cx,dx
|
|
||||||
mov cx,[@x1]
|
|
||||||
mov dx,[@x2]
|
|
||||||
cmp cx,dx
|
|
||||||
jbe @@boucle
|
|
||||||
xchg cx,dx
|
|
||||||
@@boucle:
|
|
||||||
call [cs:showpixel],cx,[@y],[@color]
|
|
||||||
inc cx
|
|
||||||
cmp cx,dx
|
|
||||||
jbe @@boucle
|
|
||||||
ret
|
|
||||||
endp hline
|
|
||||||
|
|
||||||
; affiche un pixel en %0 %1 couleur %2
|
|
||||||
PROC line FAR
|
|
||||||
ARG @x1:word,@y1:word,@x2:word,@y2:word,@color:word
|
|
||||||
USES ax,bx,cx,dx,si,di
|
|
||||||
LOCAL @@deltax:word,@@deltay:word
|
|
||||||
mov ax,[@x2]
|
|
||||||
sub ax,[@x1]
|
|
||||||
call absolute
|
|
||||||
mov [@@deltax],ax
|
|
||||||
mov cx,ax
|
|
||||||
mov ax,[@y2]
|
|
||||||
sub ax,[@y1]
|
|
||||||
call absolute
|
|
||||||
mov dx,ax
|
|
||||||
mov [@@deltay],ax
|
|
||||||
mov ax,-1
|
|
||||||
mov bx,-1
|
|
||||||
mov si,[@x1]
|
|
||||||
mov di,[@y1]
|
|
||||||
cmp si,[@x2]
|
|
||||||
jg @@x1greater
|
|
||||||
mov ax,1
|
|
||||||
@@x1greater:
|
|
||||||
cmp di,[@y2]
|
|
||||||
jg @@y1greater
|
|
||||||
mov bx,1
|
|
||||||
@@y1greater:
|
|
||||||
cmp cx,dx
|
|
||||||
jl @@deltaxgreater
|
|
||||||
mov dx,[@@deltax]
|
|
||||||
sar dx,1
|
|
||||||
xor cx,cx
|
|
||||||
@@boucle1:
|
|
||||||
add si,ax
|
|
||||||
add dx,[@@deltay]
|
|
||||||
cmp dx,[@@deltax]
|
|
||||||
jl @@above1
|
|
||||||
sub dx,[@@deltax]
|
|
||||||
add di,bx
|
|
||||||
@@above1:
|
|
||||||
call [cs:showpixel],si,di,[@color]
|
|
||||||
inc cx
|
|
||||||
cmp cx,[@@deltax]
|
|
||||||
jl @@boucle1
|
|
||||||
jmp @@endofline
|
|
||||||
@@deltaxgreater:
|
|
||||||
mov dx,[@@deltay]
|
|
||||||
sar dx,1
|
|
||||||
xor cx,cx
|
|
||||||
@@boucle2:
|
|
||||||
add di,bx
|
|
||||||
add dx,[@@deltax]
|
|
||||||
cmp dx,[@@deltay]
|
|
||||||
jle @@above2
|
|
||||||
sub dx,[@@deltay]
|
|
||||||
add si,ax
|
|
||||||
@@above2:
|
|
||||||
call [cs:showpixel],si,di,[@color]
|
|
||||||
inc cx
|
|
||||||
cmp cx,[@@deltay]
|
|
||||||
jl @@boucle2
|
|
||||||
@@endofline:
|
|
||||||
ret
|
|
||||||
endp line
|
|
||||||
|
|
||||||
;renvoie la valeur absolue de AX
|
|
||||||
PROC absolute NEAR
|
|
||||||
cmp ax,0
|
|
||||||
jg @@noabs
|
|
||||||
neg ax
|
|
||||||
@@noabs:
|
|
||||||
ret
|
|
||||||
endp absolute
|
|
||||||
|
|
||||||
ymax equ 200
|
|
||||||
|
|
||||||
; initialise un segment 2
|
|
||||||
PROC polyfill FAR
|
|
||||||
ARG @pointer:word,@nbfaces:word,@color:word;
|
|
||||||
LOCAL @@startx:word:200,@@endx:word:200,@@pas:dword,@@miny:word,@@maxy:word
|
|
||||||
USES eax,ebx,ecx,edx,si,di,es
|
|
||||||
mov di,bp
|
|
||||||
sub di,2
|
|
||||||
mov ax,16000
|
|
||||||
mov cx,(200+200)*2
|
|
||||||
push ss
|
|
||||||
pop es
|
|
||||||
std
|
|
||||||
rep stosw
|
|
||||||
mov si,[@pointer]
|
|
||||||
mov di,[@pointer]
|
|
||||||
add di,size vertex2d
|
|
||||||
mov [@@miny],ymax
|
|
||||||
mov [@@maxy],0
|
|
||||||
mov cx,[@nbfaces]
|
|
||||||
dec cx
|
|
||||||
@@boucle:
|
|
||||||
push si di cx
|
|
||||||
mov ax,[(vertex2d di).py]
|
|
||||||
cmp ax,[(vertex2d si).py]
|
|
||||||
je @@noexchange
|
|
||||||
jge @@nothingtodo
|
|
||||||
xchg si,di
|
|
||||||
@@nothingtodo:
|
|
||||||
xor eax,eax
|
|
||||||
mov ax,[(vertex2d si).px]
|
|
||||||
cwde
|
|
||||||
sal eax,8
|
|
||||||
mov ebx,eax
|
|
||||||
xor eax,eax
|
|
||||||
mov ax,[(vertex2d di).px]
|
|
||||||
sub ax,[(vertex2d si).px]
|
|
||||||
cwde
|
|
||||||
sal eax,8
|
|
||||||
xor ecx,ecx
|
|
||||||
mov cx,[(vertex2d di).py]
|
|
||||||
sub cx,[(vertex2d si).py]
|
|
||||||
cdq
|
|
||||||
idiv ecx
|
|
||||||
mov [@@pas],eax
|
|
||||||
add ebx,eax
|
|
||||||
mov dx,[(vertex2d si).py]
|
|
||||||
inc dx
|
|
||||||
cmp dx,[@@miny]
|
|
||||||
jge @@notinf
|
|
||||||
mov [@@miny],dx
|
|
||||||
@@notinf:
|
|
||||||
mov ax,[(vertex2d di).py]
|
|
||||||
cmp ax,[@@maxy]
|
|
||||||
jle @@boucle2
|
|
||||||
mov [@@maxy],ax
|
|
||||||
@@boucle2:
|
|
||||||
cmp dx,0
|
|
||||||
jl @@notgood
|
|
||||||
cmp dx,ymax
|
|
||||||
jge @@notgood
|
|
||||||
mov si,dx
|
|
||||||
shl si,1
|
|
||||||
neg si
|
|
||||||
cmp [word ptr bp+si-2],16000
|
|
||||||
jne @@notgoodforinf
|
|
||||||
mov eax,ebx
|
|
||||||
sar eax,8
|
|
||||||
mov [bp+si-2],ax
|
|
||||||
@@notgoodforinf:
|
|
||||||
mov eax,ebx
|
|
||||||
sar eax,8
|
|
||||||
mov [bp+si-200*2-2],ax
|
|
||||||
@@notgood:
|
|
||||||
add ebx,[@@pas]
|
|
||||||
inc dx
|
|
||||||
cmp dx,[(vertex2d di).py]
|
|
||||||
jle @@boucle2
|
|
||||||
@@noexchange:
|
|
||||||
pop cx di si
|
|
||||||
add si,size vertex2d
|
|
||||||
add di,size vertex2d
|
|
||||||
dec cx
|
|
||||||
js @@finished
|
|
||||||
jnz @@boucle
|
|
||||||
mov di,[@pointer]
|
|
||||||
mov cx,0FFFFh
|
|
||||||
jmp @@boucle
|
|
||||||
@@finished:
|
|
||||||
cmp [word ptr @@miny],0
|
|
||||||
jae @@noadj
|
|
||||||
mov [@@miny],0
|
|
||||||
@@noadj:
|
|
||||||
cmp [word ptr @@maxy],ymax
|
|
||||||
jb @@noadj2
|
|
||||||
mov [@@maxy],ymax-1
|
|
||||||
@@noadj2:
|
|
||||||
mov cx,[@@miny]
|
|
||||||
@@drawboucle:
|
|
||||||
mov si,cx
|
|
||||||
shl si,1
|
|
||||||
neg si
|
|
||||||
mov ax,[bp+si-2]
|
|
||||||
mov bx,[bp+si-200*2-2]
|
|
||||||
cmp bx,16000
|
|
||||||
jnz @@noinfatall
|
|
||||||
mov ax,bx
|
|
||||||
@@noinfatall:
|
|
||||||
call hline,ax,bx,cx,[@color]
|
|
||||||
inc cx
|
|
||||||
cmp cx,[@@maxy]
|
|
||||||
jna @@drawboucle
|
|
||||||
ret
|
|
||||||
endp polyfill
|
|
||||||
|
|
38
lib/math.asm
38
lib/math.asm
|
@ -1,38 +0,0 @@
|
||||||
model tiny,stdcall
|
|
||||||
p586
|
|
||||||
locals
|
|
||||||
jumps
|
|
||||||
codeseg
|
|
||||||
option procalign:byte
|
|
||||||
|
|
||||||
include "..\include\mem.h"
|
|
||||||
|
|
||||||
org 0h
|
|
||||||
|
|
||||||
header exe <"CE",1,0,0,offset exports,,,>
|
|
||||||
|
|
||||||
exporting
|
|
||||||
declare random
|
|
||||||
declare randomize
|
|
||||||
ende
|
|
||||||
|
|
||||||
randseed dw 1234h
|
|
||||||
|
|
||||||
PROC random FAR
|
|
||||||
USES dx
|
|
||||||
mov ax,[cs:randseed]
|
|
||||||
mov dx,8405h
|
|
||||||
mul dx
|
|
||||||
inc ax
|
|
||||||
mov [cs:randseed],ax
|
|
||||||
mov ax,dx
|
|
||||||
ret
|
|
||||||
endp random
|
|
||||||
|
|
||||||
PROC randomize FAR
|
|
||||||
USES ax,cx,dx
|
|
||||||
mov ah,0
|
|
||||||
int 1ah
|
|
||||||
mov [cs:randseed],dx
|
|
||||||
ret
|
|
||||||
endp randomize
|
|
993
lib/str0.asm
993
lib/str0.asm
|
@ -1,993 +0,0 @@
|
||||||
model tiny,stdcall
|
|
||||||
p586N
|
|
||||||
locals
|
|
||||||
jumps
|
|
||||||
codeseg
|
|
||||||
option procalign:byte
|
|
||||||
|
|
||||||
include "..\include\mem.h"
|
|
||||||
include "..\include\divers.h"
|
|
||||||
|
|
||||||
org 0h
|
|
||||||
|
|
||||||
header exe <"CE",1,0,0,offset exports,,,>
|
|
||||||
|
|
||||||
|
|
||||||
exporting
|
|
||||||
declare checksyntax
|
|
||||||
declare cmpitems
|
|
||||||
declare gettypeditem
|
|
||||||
declare gettyped
|
|
||||||
declare whatisitem
|
|
||||||
declare whatis
|
|
||||||
declare strtoadress
|
|
||||||
declare strisadress
|
|
||||||
declare strisname
|
|
||||||
declare strisbase
|
|
||||||
declare strtoint
|
|
||||||
declare left
|
|
||||||
declare right
|
|
||||||
declare middle
|
|
||||||
declare fill
|
|
||||||
declare replaceallchar
|
|
||||||
declare searchchar
|
|
||||||
declare invert
|
|
||||||
declare cmpstr
|
|
||||||
declare evalue
|
|
||||||
declare insert
|
|
||||||
declare delete
|
|
||||||
declare copy
|
|
||||||
declare concat
|
|
||||||
declare compressdelimiter
|
|
||||||
declare setnbitems
|
|
||||||
declare getitemsize
|
|
||||||
declare getitem
|
|
||||||
declare getpointeritem
|
|
||||||
declare getnbitems
|
|
||||||
declare getlength
|
|
||||||
declare setlength
|
|
||||||
declare uppercase
|
|
||||||
declare onecase
|
|
||||||
declare lowercase
|
|
||||||
declare invertcase
|
|
||||||
ende
|
|
||||||
|
|
||||||
;Librairie qui prend en charge le format de STR ASCIIZ
|
|
||||||
;# nombre 8
|
|
||||||
;? str 7
|
|
||||||
;& nom 6
|
|
||||||
|
|
||||||
;High Low
|
|
||||||
;0 variable 4 hex
|
|
||||||
;1 byte 3 dec
|
|
||||||
;2 word 2 oct
|
|
||||||
;3 3 octets 1 bin
|
|
||||||
;4 dword 5 adresse
|
|
||||||
;5 5 octets 6 nom
|
|
||||||
;6 ... 7 str
|
|
||||||
; 8 nombre
|
|
||||||
|
|
||||||
;Renvoie carry si la syntaxe de ds:si n'est pas respect‚ par rapport a es:di
|
|
||||||
PROC checksyntax FAR
|
|
||||||
ARG @src:word,@dest:word,@delim:word
|
|
||||||
USES ax,bx,cx,dx,si,di,ds,es
|
|
||||||
LOCAL @@temp:word:256
|
|
||||||
push ss
|
|
||||||
pop es
|
|
||||||
lea si,[@@temp]
|
|
||||||
mov di,[@dest]
|
|
||||||
call copy,[@src],si
|
|
||||||
call xch
|
|
||||||
call compressdelimiter,si,[@delim]
|
|
||||||
call getnbitems,si,[@delim]
|
|
||||||
mov bx,ax
|
|
||||||
call xch
|
|
||||||
call getnbitems,di,[@delim]
|
|
||||||
cmp bx,ax
|
|
||||||
jne @@notequalatall
|
|
||||||
xor cx,cx
|
|
||||||
@@itemer:
|
|
||||||
call xch
|
|
||||||
call whatisitem,si,cx,[@delim]
|
|
||||||
mov dx,ax
|
|
||||||
call xch
|
|
||||||
call whatisitem,di,cx,[@delim]
|
|
||||||
cmp ax,dx
|
|
||||||
jne @@prob
|
|
||||||
cmp al,6
|
|
||||||
jb @@equal
|
|
||||||
call cmpitems
|
|
||||||
je @@equal
|
|
||||||
@@prob:
|
|
||||||
cmp dl,4
|
|
||||||
ja @@nonumber
|
|
||||||
cmp dl,8
|
|
||||||
je @@equal
|
|
||||||
;cmp al,4
|
|
||||||
;jne @@notequalatall
|
|
||||||
cmp dh,ah
|
|
||||||
ja @@notequalatall
|
|
||||||
jmp @@equal
|
|
||||||
@@nonumber:
|
|
||||||
cmp al,7
|
|
||||||
jne @@nostr
|
|
||||||
cmp ah,0
|
|
||||||
jne @@notequalatall
|
|
||||||
jmp @@equal
|
|
||||||
@@nostr:
|
|
||||||
cmp al,6
|
|
||||||
jne @@noname
|
|
||||||
cmp dl,6
|
|
||||||
jne @@noname
|
|
||||||
cmp ah,0
|
|
||||||
jne @@notequalatall
|
|
||||||
jmp @@equal
|
|
||||||
@@noname:
|
|
||||||
cmp al,8
|
|
||||||
je @@equal
|
|
||||||
jmp @@notequalatall
|
|
||||||
@@equal:
|
|
||||||
inc cx
|
|
||||||
cmp cx,bx
|
|
||||||
jne @@itemer
|
|
||||||
cld
|
|
||||||
@@ackno:
|
|
||||||
ret
|
|
||||||
@@notequalatall:
|
|
||||||
stc
|
|
||||||
jmp @@ackno
|
|
||||||
endp checksyntax
|
|
||||||
|
|
||||||
xch:
|
|
||||||
push es
|
|
||||||
push ds
|
|
||||||
pop es
|
|
||||||
pop ds
|
|
||||||
ret
|
|
||||||
|
|
||||||
|
|
||||||
;Compare les ‚l‚ments cx de deux chaine ds:si et es:di
|
|
||||||
PROC cmpitems FAR
|
|
||||||
ARG @src:word,@dest:word,@item:word,@delim:word
|
|
||||||
USES ax,cx,si,di,es
|
|
||||||
push ds
|
|
||||||
pop es
|
|
||||||
call getpointeritem,[@src],[@item],[@delim]
|
|
||||||
mov si,ax
|
|
||||||
call getitemsize,[@src],[@item],[@delim]
|
|
||||||
mov di,[@dest]
|
|
||||||
mov cx,ax
|
|
||||||
cld
|
|
||||||
rep cmpsb
|
|
||||||
clc
|
|
||||||
ret
|
|
||||||
endp cmpitems
|
|
||||||
|
|
||||||
|
|
||||||
;Renvoie l'‚l‚ment cx de ds:si dans edx si nb et dans es:di si str ou name
|
|
||||||
PROC gettypeditem FAR
|
|
||||||
ARG @src:word,@item:word,@delim:word
|
|
||||||
USES bx,cx,si,di
|
|
||||||
mov si,[@src]
|
|
||||||
mov cx,[@item]
|
|
||||||
call getpointeritem,si,cx,[@delim]
|
|
||||||
mov di,ax
|
|
||||||
inc cx
|
|
||||||
call getpointeritem,si,cx,[@delim]
|
|
||||||
mov si,ax
|
|
||||||
dec si
|
|
||||||
mov cl,0
|
|
||||||
xchg cl,[ds:si]
|
|
||||||
call gettyped,di
|
|
||||||
xchg cl,[ds:si]
|
|
||||||
clc
|
|
||||||
ret
|
|
||||||
endp gettypeditem
|
|
||||||
|
|
||||||
|
|
||||||
;Renvoie eax si nb et dans ds:eax si str ou name
|
|
||||||
PROC gettyped FAR
|
|
||||||
ARG @src:word
|
|
||||||
USES si
|
|
||||||
mov si,[@src]
|
|
||||||
xor eax,eax
|
|
||||||
call whatis,si
|
|
||||||
cmp al,1
|
|
||||||
je @@bin
|
|
||||||
cmp al,2
|
|
||||||
je @@oct
|
|
||||||
cmp al,3
|
|
||||||
je @@dec
|
|
||||||
cmp al,4
|
|
||||||
je @@hex
|
|
||||||
cmp al,5
|
|
||||||
je @@pointer
|
|
||||||
mov ax,si
|
|
||||||
jmp @@endofgettypeditem
|
|
||||||
@@bin:
|
|
||||||
call strtoint,si,2
|
|
||||||
jmp @@endofgettypeditem
|
|
||||||
@@oct:
|
|
||||||
call strtoint,si,8
|
|
||||||
jmp @@endofgettypeditem
|
|
||||||
@@dec:
|
|
||||||
call strtoint,si,10
|
|
||||||
jmp @@endofgettypeditem
|
|
||||||
@@hex:
|
|
||||||
call strtoint,si,16
|
|
||||||
jmp @@endofgettypeditem
|
|
||||||
@@pointer:
|
|
||||||
call strtoadress,si
|
|
||||||
@@endofgettypeditem:
|
|
||||||
clc
|
|
||||||
ret
|
|
||||||
endp gettyped
|
|
||||||
|
|
||||||
;Renvoie dans ax le type de la str0 point‚e par ds:%0 ‚l‚ment %1 delim %3
|
|
||||||
PROC whatisitem FAR
|
|
||||||
ARG @src:word,@item:word,@delim:word
|
|
||||||
USES bx,cx,si,di
|
|
||||||
mov si,[@src]
|
|
||||||
mov cx,[@item]
|
|
||||||
call getpointeritem,si,cx,[@delim]
|
|
||||||
mov di,ax
|
|
||||||
inc cx
|
|
||||||
call getpointeritem,si,cx,[@delim]
|
|
||||||
mov si,ax
|
|
||||||
dec si
|
|
||||||
mov cl,0
|
|
||||||
xchg cl,[ds:si]
|
|
||||||
call whatis,di
|
|
||||||
xchg cl,[ds:si]
|
|
||||||
clc
|
|
||||||
ret
|
|
||||||
endp whatisitem
|
|
||||||
|
|
||||||
;Renvoie dans ax le type de la str0 point‚e par ds:%0
|
|
||||||
;High Low
|
|
||||||
;0 variable 4 hex
|
|
||||||
;1 byte 3 dec
|
|
||||||
;2 word 2 oct
|
|
||||||
;3 3 octets 1 bin
|
|
||||||
;4 dword 5 adresse
|
|
||||||
;5 5 octets 6 name
|
|
||||||
;6 ... 7 str
|
|
||||||
PROC whatis FAR
|
|
||||||
ARG @src:word
|
|
||||||
USES bx,cx,edx,si
|
|
||||||
mov si,[@src]
|
|
||||||
xor cx,cx
|
|
||||||
mov cl,2
|
|
||||||
call strisbase,si,cx
|
|
||||||
jnc @@finbase
|
|
||||||
mov cl,8
|
|
||||||
call strisbase,si,cx
|
|
||||||
jnc @@finbase
|
|
||||||
mov cl,10
|
|
||||||
call strisbase,si,cx
|
|
||||||
jnc @@finbase
|
|
||||||
mov cl,16
|
|
||||||
call strisbase,si,cx
|
|
||||||
jc @@testadress
|
|
||||||
@@finbase:
|
|
||||||
mov bx,cx
|
|
||||||
xor ch,ch
|
|
||||||
mov al,[cs:bx+offset basenn-2]
|
|
||||||
push eax
|
|
||||||
call strtoint,si,cx
|
|
||||||
mov edx,eax
|
|
||||||
pop eax
|
|
||||||
cmp edx,0000FFFFh
|
|
||||||
ja @@bits32
|
|
||||||
cmp dx,00FFh
|
|
||||||
ja @@bits16
|
|
||||||
mov ah,1
|
|
||||||
jmp @@endofwhat
|
|
||||||
@@bits16:
|
|
||||||
mov ah,2
|
|
||||||
jmp @@endofwhat
|
|
||||||
@@bits32:
|
|
||||||
mov ah,4
|
|
||||||
jmp @@endofwhat
|
|
||||||
@@testadress:
|
|
||||||
call strisadress,si
|
|
||||||
jc @@testname
|
|
||||||
mov ax,0005h
|
|
||||||
jmp @@endofwhat
|
|
||||||
@@testname:
|
|
||||||
call strisname
|
|
||||||
jc @@testnumber
|
|
||||||
xor ah,ah
|
|
||||||
cmp [byte ptr si],'&'
|
|
||||||
je @@okname
|
|
||||||
call getlength,si
|
|
||||||
mov ah,al
|
|
||||||
@@okname:
|
|
||||||
mov al,06h
|
|
||||||
jmp @@endofwhat
|
|
||||||
@@testnumber:
|
|
||||||
cmp [byte ptr si],'#'
|
|
||||||
jne @@testvarstr
|
|
||||||
xor ah,ah
|
|
||||||
mov al,08h
|
|
||||||
jmp @@endofwhat
|
|
||||||
@@testvarstr:
|
|
||||||
xor ah,ah
|
|
||||||
cmp [byte ptr si],'?'
|
|
||||||
je @@okvarstr
|
|
||||||
call getlength,si
|
|
||||||
mov ah,al
|
|
||||||
@@okvarstr:
|
|
||||||
mov al,07h
|
|
||||||
@@endofwhat:
|
|
||||||
clc
|
|
||||||
ret
|
|
||||||
endp whatis
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;Renvoie non carry si la str ds:si point‚e peut ˆtre une adresse
|
|
||||||
PROC strtoadress FAR
|
|
||||||
;push
|
|
||||||
stc
|
|
||||||
;pop
|
|
||||||
ret
|
|
||||||
endp strtoadress
|
|
||||||
|
|
||||||
|
|
||||||
;Renvoie en es:di le pointeur str0 ds:si
|
|
||||||
PROC strisadress FAR
|
|
||||||
;push
|
|
||||||
stc
|
|
||||||
;pop
|
|
||||||
ret
|
|
||||||
endp strisadress
|
|
||||||
|
|
||||||
;Renvoie non carry si la str ds:%0 point‚e peut ˆtre un nom de fichier
|
|
||||||
PROC strisname FAR
|
|
||||||
ARG @src:word
|
|
||||||
USES ax,si,di
|
|
||||||
mov si,[@src]
|
|
||||||
@@isname:
|
|
||||||
mov al,[si]
|
|
||||||
inc si
|
|
||||||
cmp al,0
|
|
||||||
je @@itsok
|
|
||||||
mov di,offset non
|
|
||||||
@@verify:
|
|
||||||
mov ah,[cs:di]
|
|
||||||
inc di
|
|
||||||
cmp ah,0FFh
|
|
||||||
je @@isname
|
|
||||||
cmp ah,al
|
|
||||||
jne @@verify
|
|
||||||
stc
|
|
||||||
jmp @@itsdead
|
|
||||||
@@itsok:
|
|
||||||
clc
|
|
||||||
@@itsdead:
|
|
||||||
ret
|
|
||||||
endp strisname
|
|
||||||
|
|
||||||
non db '/<>|"?*:\',01,0FFh
|
|
||||||
|
|
||||||
;Renvoie non carry si le texte point‚ par %0 est de la base %1
|
|
||||||
PROC strisbase FAR
|
|
||||||
ARG @src:word,@base:word
|
|
||||||
USES ax,cx,si,di,es
|
|
||||||
push cs
|
|
||||||
pop es
|
|
||||||
mov si,[@src]
|
|
||||||
@@isstrbase:
|
|
||||||
mov al,[si]
|
|
||||||
cmp al,0
|
|
||||||
je @@okbase
|
|
||||||
mov cx,[@base]
|
|
||||||
xor ch,ch
|
|
||||||
mov di,cx
|
|
||||||
cmp al,[es:di-2+offset basen]
|
|
||||||
je @@verifbase
|
|
||||||
xor ch,ch
|
|
||||||
inc cl
|
|
||||||
mov di,offset base
|
|
||||||
cld
|
|
||||||
repne scasb
|
|
||||||
cmp cx,0
|
|
||||||
je @@nobase
|
|
||||||
inc si
|
|
||||||
jmp @@isstrbase
|
|
||||||
@@okbase:
|
|
||||||
clc
|
|
||||||
@@endbase:
|
|
||||||
ret
|
|
||||||
@@verifbase:
|
|
||||||
cmp [byte ptr si+1],0
|
|
||||||
je @@okbase
|
|
||||||
@@nobase:
|
|
||||||
stc
|
|
||||||
jmp @@endbase
|
|
||||||
endp strisbase
|
|
||||||
|
|
||||||
base db '0123456789ABCDEF'
|
|
||||||
basen db 'b o d h'
|
|
||||||
basenn db 1,0,0,0,0,0,2,0,3,0,0,0,0,0,4
|
|
||||||
|
|
||||||
|
|
||||||
;Converti un str %0 de base %1 en int dans eax
|
|
||||||
PROC strtoint FAR
|
|
||||||
ARG @src:word,@base:word
|
|
||||||
USES ebx,ecx,edx,si,edi,es
|
|
||||||
push cs
|
|
||||||
pop es
|
|
||||||
mov si,[@src]
|
|
||||||
@@gotos:
|
|
||||||
cmp [byte ptr si+1], 0
|
|
||||||
je @@oklo
|
|
||||||
inc si
|
|
||||||
jmp @@gotos
|
|
||||||
@@oklo:
|
|
||||||
mov edi,1
|
|
||||||
xor ebx,ebx
|
|
||||||
@@baseto:
|
|
||||||
cmp [@src],si
|
|
||||||
ja @@endbaseto
|
|
||||||
mov al,[si]
|
|
||||||
xor ecx,ecx
|
|
||||||
mov cl,[byte ptr @base]
|
|
||||||
inc cl
|
|
||||||
push di
|
|
||||||
mov di,offset base
|
|
||||||
cld
|
|
||||||
repne scasb
|
|
||||||
pop di
|
|
||||||
jne @@noop
|
|
||||||
sub cl,[byte ptr @base]
|
|
||||||
neg cl
|
|
||||||
mov eax,edi
|
|
||||||
mul ecx
|
|
||||||
add ebx,eax
|
|
||||||
mov eax,edi
|
|
||||||
mov cl,[byte ptr @base]
|
|
||||||
mul ecx
|
|
||||||
mov edi,eax
|
|
||||||
@@noop:
|
|
||||||
dec si
|
|
||||||
jmp @@baseto
|
|
||||||
@@endbaseto:
|
|
||||||
mov eax,ebx
|
|
||||||
clc
|
|
||||||
ret
|
|
||||||
endp strtoint
|
|
||||||
|
|
||||||
|
|
||||||
;Renvoie en ds:%1 la partie de %2 caractŠres a partir de la gauche de ds:%0
|
|
||||||
PROC left FAR
|
|
||||||
ARG @src:word,@dest:word,@nb:word
|
|
||||||
USES ax,cx,si,di,es
|
|
||||||
push ds
|
|
||||||
pop es
|
|
||||||
mov si,[@src]
|
|
||||||
mov di,[@dest]
|
|
||||||
mov cx,[@nb]
|
|
||||||
cld
|
|
||||||
rep movsb
|
|
||||||
mov al,0
|
|
||||||
stosb
|
|
||||||
clc
|
|
||||||
ret
|
|
||||||
endp left
|
|
||||||
|
|
||||||
;Renvoie en ds:%1 la partie de %2 caractŠres a partir de la droite de ds:%0
|
|
||||||
PROC right FAR
|
|
||||||
ARG @src:word,@dest:word,@nb:word
|
|
||||||
USES ax,cx,si,di,es
|
|
||||||
push ds
|
|
||||||
pop es
|
|
||||||
mov si,[@src]
|
|
||||||
mov di,[@dest]
|
|
||||||
call getlength,si
|
|
||||||
add si,ax
|
|
||||||
sub si,[@nb]
|
|
||||||
mov cx,[@nb]
|
|
||||||
cld
|
|
||||||
rep movsb
|
|
||||||
mov al,0
|
|
||||||
stosb
|
|
||||||
clc
|
|
||||||
ret
|
|
||||||
endp right
|
|
||||||
|
|
||||||
;Renvoie en ds:%1 la partie de %3 caractŠres a partir de la position %2 de ds:%0
|
|
||||||
PROC middle FAR
|
|
||||||
ARG @src:word,@dest:word,@item:word,@nb:word
|
|
||||||
USES ax,cx,si,di,es
|
|
||||||
push ds
|
|
||||||
pop es
|
|
||||||
mov si,[@src]
|
|
||||||
mov di,[@dest]
|
|
||||||
mov cx,[@nb]
|
|
||||||
add si,[@item]
|
|
||||||
cld
|
|
||||||
rep movsb
|
|
||||||
mov al,0
|
|
||||||
stosb
|
|
||||||
clc
|
|
||||||
ret
|
|
||||||
endp middle
|
|
||||||
|
|
||||||
;Rempli de %3 caractŠres %2 a partir de la position %1 de ds:%0
|
|
||||||
PROC fill FAR
|
|
||||||
ARG @src:word,@item:word,@char:word,@nb:word
|
|
||||||
USES ax,cx,si,di,es
|
|
||||||
push ds
|
|
||||||
pop es
|
|
||||||
mov di,[@src]
|
|
||||||
add di,[@item]
|
|
||||||
mov ax,[@char]
|
|
||||||
mov cx,[@nb]
|
|
||||||
cld
|
|
||||||
rep stosb
|
|
||||||
clc
|
|
||||||
ret
|
|
||||||
endp fill
|
|
||||||
|
|
||||||
;Remplace tout les caractŠres %1 de ds:%0 par des caractŠres %2
|
|
||||||
PROC replaceallchar FAR
|
|
||||||
ARG @src:word,@char1:word,@char2:word
|
|
||||||
USES ax,cx,dx,di,es
|
|
||||||
mov di,[@src]
|
|
||||||
call getlength,di
|
|
||||||
mov cx,ax
|
|
||||||
mov ax,[@char1]
|
|
||||||
mov dx,[@char2]
|
|
||||||
push ds
|
|
||||||
pop es
|
|
||||||
@@findandchange:
|
|
||||||
repne scasb
|
|
||||||
cmp cx,0
|
|
||||||
je @@endofchange
|
|
||||||
mov [es:di-1],dl
|
|
||||||
jmp @@findandchange
|
|
||||||
@@endofchange:
|
|
||||||
clc
|
|
||||||
ret
|
|
||||||
endp replaceallchar
|
|
||||||
|
|
||||||
;Recherche un caractŠre dl dans la chaŒne ds:%0
|
|
||||||
PROC searchchar FAR
|
|
||||||
ARG @src:word,@char:word
|
|
||||||
USES cx,di,es
|
|
||||||
mov di,[@src]
|
|
||||||
call getlength,di
|
|
||||||
mov cx,ax
|
|
||||||
push ds
|
|
||||||
pop es
|
|
||||||
mov ax,[@char]
|
|
||||||
repne scasb
|
|
||||||
mov ax,di
|
|
||||||
dec ax
|
|
||||||
clc
|
|
||||||
ret
|
|
||||||
endp searchchar
|
|
||||||
|
|
||||||
;Inverse la chaine point‚e en ds:%0
|
|
||||||
PROC invert FAR
|
|
||||||
ARG @src:word
|
|
||||||
USES ax,cx,si,di
|
|
||||||
mov si,[@src]
|
|
||||||
call getlength,si
|
|
||||||
mov di,si
|
|
||||||
add di,ax
|
|
||||||
dec di
|
|
||||||
@@revert:
|
|
||||||
mov al,[si]
|
|
||||||
xchg al,[di]
|
|
||||||
mov [si],al
|
|
||||||
inc si
|
|
||||||
dec di
|
|
||||||
cmp si,di
|
|
||||||
ja @@finishinvert
|
|
||||||
dec di
|
|
||||||
cmp si,di
|
|
||||||
ja @@finishinvert
|
|
||||||
inc di
|
|
||||||
jmp @@revert
|
|
||||||
@@finishinvert:
|
|
||||||
clc
|
|
||||||
ret
|
|
||||||
endp invert
|
|
||||||
|
|
||||||
;Compares 2 chaines de caractŠres DS:%0 et DS:%1 zerof si non equal
|
|
||||||
PROC cmpstr FAR
|
|
||||||
ARG @src:word,@dest:word
|
|
||||||
USES cx,dx,si,di
|
|
||||||
push ds
|
|
||||||
pop es
|
|
||||||
mov si,[@src]
|
|
||||||
mov di,[@dest]
|
|
||||||
call getlength,di
|
|
||||||
mov cx,ax
|
|
||||||
call getlength,si
|
|
||||||
cmp cx,ax
|
|
||||||
jne @@notequal
|
|
||||||
repe cmpsb
|
|
||||||
@@notequal:
|
|
||||||
ret
|
|
||||||
endp cmpstr
|
|
||||||
|
|
||||||
;Compares 2 chaines de caractŠres DS:%0 et DS:%1 zerof si non equal et renvoie le nb de caractŠre egaux dans ax
|
|
||||||
PROC evalue FAR
|
|
||||||
ARG @src:word,@dest:word
|
|
||||||
USES cx,si,di,es
|
|
||||||
push ds
|
|
||||||
pop es
|
|
||||||
mov si,[@src]
|
|
||||||
mov di,[@dest]
|
|
||||||
call getlength ,di
|
|
||||||
mov cx,ax
|
|
||||||
repe cmpsb
|
|
||||||
pushf
|
|
||||||
jne @@noident
|
|
||||||
sub ax,cx
|
|
||||||
popf
|
|
||||||
clc
|
|
||||||
ret
|
|
||||||
@@noident:
|
|
||||||
sub ax,cx
|
|
||||||
dec ax
|
|
||||||
popf
|
|
||||||
clc
|
|
||||||
ret
|
|
||||||
endp evalue
|
|
||||||
|
|
||||||
;Insert une chaine ds:%0 en ds:%1 a partir du caractŠre %2
|
|
||||||
PROC insert FAR
|
|
||||||
ARG @src:word,@dest:word,@item:word
|
|
||||||
USES ax,cx,si,di,es
|
|
||||||
push es
|
|
||||||
pop ds
|
|
||||||
mov si,[@dest]
|
|
||||||
call getlength,si
|
|
||||||
mov cx,ax
|
|
||||||
add si,ax
|
|
||||||
mov di,si
|
|
||||||
call getlength,[@src]
|
|
||||||
add di,ax
|
|
||||||
sub cx,[@item]
|
|
||||||
inc cx
|
|
||||||
std
|
|
||||||
rep movsb
|
|
||||||
mov si,[@src]
|
|
||||||
mov di,[@dest]
|
|
||||||
add di,[@item]
|
|
||||||
mov cx,ax
|
|
||||||
cld
|
|
||||||
rep movsb
|
|
||||||
clc
|
|
||||||
ret
|
|
||||||
endp insert
|
|
||||||
|
|
||||||
|
|
||||||
;Detruit %2 caractŠres a partir du caractŠre %1 de DS:%0
|
|
||||||
PROC delete FAR
|
|
||||||
ARG @src:word,@item:word,@size:word
|
|
||||||
USES ax,cx,dx,si,di,es
|
|
||||||
push ds
|
|
||||||
pop es
|
|
||||||
mov si,[@src]
|
|
||||||
call getlength,si
|
|
||||||
mov cx,ax
|
|
||||||
sub cx,[@size]
|
|
||||||
sub cx,[@item]
|
|
||||||
inc cx
|
|
||||||
add si,[@item]
|
|
||||||
mov di,si
|
|
||||||
add si,[@size]
|
|
||||||
cld
|
|
||||||
rep movsb
|
|
||||||
clc
|
|
||||||
ret
|
|
||||||
endp delete
|
|
||||||
|
|
||||||
;Copie une chaine de ds:si en es:di
|
|
||||||
PROC copy FAR
|
|
||||||
ARG @src:word,@dest:word
|
|
||||||
USES ax,cx,si,di
|
|
||||||
mov si,[@src]
|
|
||||||
mov di,[@dest]
|
|
||||||
call getlength,si
|
|
||||||
mov cx,ax
|
|
||||||
cld
|
|
||||||
rep movsb
|
|
||||||
mov al,0
|
|
||||||
stosb
|
|
||||||
clc
|
|
||||||
ret
|
|
||||||
endp copy
|
|
||||||
|
|
||||||
|
|
||||||
;ConcatŠne le chaine ds:si avec ds:di
|
|
||||||
PROC concat FAR
|
|
||||||
ARG @src:word,@dest:word
|
|
||||||
USES ax,cx,si,di,es
|
|
||||||
push ds
|
|
||||||
pop es
|
|
||||||
mov si,[@src]
|
|
||||||
call getlength,si
|
|
||||||
mov cx,ax
|
|
||||||
mov di,[@dest]
|
|
||||||
call getlength,di
|
|
||||||
add di,ax
|
|
||||||
cld
|
|
||||||
rep movsb
|
|
||||||
mov al,0
|
|
||||||
stosb
|
|
||||||
clc
|
|
||||||
ret
|
|
||||||
endp concat
|
|
||||||
|
|
||||||
|
|
||||||
;D‚truit les d‚limiteur qui sont cons‚cutifs dans ds:%0 -> renvoie le nb d'item
|
|
||||||
PROC compressdelimiter FAR
|
|
||||||
ARG @src:word,@delim:word
|
|
||||||
USES cx,dx,si,di,es
|
|
||||||
mov di,[@src]
|
|
||||||
call getlength,di
|
|
||||||
mov cx,ax
|
|
||||||
push ds
|
|
||||||
pop es
|
|
||||||
mov ax,[@delim]
|
|
||||||
xor dx,dx
|
|
||||||
@@compressitems:
|
|
||||||
repne scasb
|
|
||||||
inc dx
|
|
||||||
@@againcomp:
|
|
||||||
cmp [di],al
|
|
||||||
jne @@nosup
|
|
||||||
call delete,di,0,1
|
|
||||||
jmp @@againcomp
|
|
||||||
@@nosup:
|
|
||||||
cmp cx,0
|
|
||||||
jne @@compressitems
|
|
||||||
mov ax,dx
|
|
||||||
clc
|
|
||||||
ret
|
|
||||||
endp compressdelimiter
|
|
||||||
|
|
||||||
;Met le nombre d'‚l‚ments de ds:%0 à %1
|
|
||||||
PROC setnbitems FAR
|
|
||||||
ARG @src:word,@size:word,@delim:word
|
|
||||||
USES ax,cx,di,es
|
|
||||||
mov di,[@src]
|
|
||||||
cmp [@size],0
|
|
||||||
je @@onlyzero
|
|
||||||
call getnbitems,di,[@delim]
|
|
||||||
cmp [@size],ax
|
|
||||||
je @@noadjust
|
|
||||||
jb @@subsome
|
|
||||||
push ds
|
|
||||||
pop es
|
|
||||||
sub ax,[@size]
|
|
||||||
neg ax
|
|
||||||
mov cx,ax
|
|
||||||
call getlength,di
|
|
||||||
add di,ax
|
|
||||||
mov ax,[@delim]
|
|
||||||
mov ah,'a'
|
|
||||||
rep stosw
|
|
||||||
xor al,al
|
|
||||||
stosb
|
|
||||||
jmp @@noadjust
|
|
||||||
@@subsome:
|
|
||||||
call getpointeritem,[@src],[@size],[@delim]
|
|
||||||
dec ax
|
|
||||||
mov di,ax
|
|
||||||
@@onlyzero:
|
|
||||||
mov [byte ptr di],0
|
|
||||||
@@noadjust:
|
|
||||||
clc
|
|
||||||
ret
|
|
||||||
endp setnbitems
|
|
||||||
|
|
||||||
;Renvoie la taille ax de l'‚l‚ment %0
|
|
||||||
PROC getitemsize FAR
|
|
||||||
ARG @src:word,@item:word,@delim:word
|
|
||||||
USES cx,dx
|
|
||||||
mov cx,[@item]
|
|
||||||
call getpointeritem,[@src],cx,[@delim]
|
|
||||||
mov dx,ax
|
|
||||||
inc cx
|
|
||||||
call getpointeritem,[@src],cx,[@delim]
|
|
||||||
sub ax,dx
|
|
||||||
dec ax
|
|
||||||
clc
|
|
||||||
ret
|
|
||||||
endp getitemsize
|
|
||||||
|
|
||||||
;Renvoie en ds:%1 l'‚l‚ment %2 de ds:%0
|
|
||||||
PROC getitem FAR
|
|
||||||
ARG @src:word,@dest:word,@item:word,@delim:word
|
|
||||||
USES ax,cx,si,di,es
|
|
||||||
push ds
|
|
||||||
pop es
|
|
||||||
call getpointeritem,[@src],[@item],[@delim]
|
|
||||||
mov si,ax
|
|
||||||
call getitemsize,[@src],[@item],[@delim]
|
|
||||||
mov di,[@dest]
|
|
||||||
mov cx,ax
|
|
||||||
cld
|
|
||||||
rep movsb
|
|
||||||
mov al,0
|
|
||||||
stosb
|
|
||||||
clc
|
|
||||||
ret
|
|
||||||
endp getitem
|
|
||||||
|
|
||||||
;renvoi un pointeur ax sur l'‚l‚ment %1 de ds:%0
|
|
||||||
PROC getpointeritem FAR
|
|
||||||
ARG @src:word,@item:word,@delim:word
|
|
||||||
USES cx,dx,di,es
|
|
||||||
mov di,[@src]
|
|
||||||
cmp [@item],0
|
|
||||||
je @@finishpointer
|
|
||||||
push ds
|
|
||||||
pop es
|
|
||||||
call getlength,di
|
|
||||||
mov cx,ax
|
|
||||||
push ds
|
|
||||||
pop es
|
|
||||||
mov ax,[@delim]
|
|
||||||
xor dx,dx
|
|
||||||
@@countnbitems:
|
|
||||||
cmp [@item],dx
|
|
||||||
je @@finishpointer
|
|
||||||
cld
|
|
||||||
repne scasb
|
|
||||||
inc dx
|
|
||||||
cmp cx,0
|
|
||||||
jne @@countnbitems
|
|
||||||
inc di
|
|
||||||
@@finishpointer:
|
|
||||||
mov ax,di
|
|
||||||
clc
|
|
||||||
ret
|
|
||||||
endp getpointeritem
|
|
||||||
|
|
||||||
;Renvoie le nombre d'‚l‚ments ax de ds:%0
|
|
||||||
PROC getnbitems FAR
|
|
||||||
ARG @src:word,@delim:word
|
|
||||||
USES cx,dx,di,es
|
|
||||||
mov di,[@src]
|
|
||||||
call getlength,di
|
|
||||||
mov cx,ax
|
|
||||||
push ds
|
|
||||||
pop es
|
|
||||||
mov ax,[@delim]
|
|
||||||
xor dx,dx
|
|
||||||
cld
|
|
||||||
@@countitems:
|
|
||||||
repne scasb
|
|
||||||
inc dx
|
|
||||||
cmp cx,0
|
|
||||||
jne @@countitems
|
|
||||||
mov ax,dx
|
|
||||||
clc
|
|
||||||
ret
|
|
||||||
endp getnbitems
|
|
||||||
|
|
||||||
;renvoie la taille en octets AX de la chaine point‚e en ds:%0
|
|
||||||
PROC getlength FAR
|
|
||||||
ARG @src:word
|
|
||||||
USES cx,di,es
|
|
||||||
push ds
|
|
||||||
pop es
|
|
||||||
mov di,[@src]
|
|
||||||
mov al,0
|
|
||||||
mov cx,0FFFFh
|
|
||||||
cld
|
|
||||||
repne scasb
|
|
||||||
neg cx
|
|
||||||
dec cx
|
|
||||||
dec cx
|
|
||||||
mov ax,cx
|
|
||||||
clc
|
|
||||||
ret
|
|
||||||
endp getlength
|
|
||||||
|
|
||||||
;Met la taille en octets de la chaine point‚e ds:%0 a %1
|
|
||||||
PROC setlength FAR
|
|
||||||
ARG @src:word,@size:word
|
|
||||||
USES si
|
|
||||||
mov si,[@src]
|
|
||||||
add si,[@size]
|
|
||||||
mov [byte ptr si],0
|
|
||||||
clc
|
|
||||||
ret
|
|
||||||
endp setlength
|
|
||||||
|
|
||||||
;met en majuscule la chaine ds:%0
|
|
||||||
PROC uppercase FAR
|
|
||||||
ARG @src:word
|
|
||||||
USES si,ax
|
|
||||||
mov si,[@src]
|
|
||||||
@@uppercase:
|
|
||||||
mov al,[ds:si]
|
|
||||||
inc si
|
|
||||||
cmp al,0
|
|
||||||
je @@enduppercase
|
|
||||||
cmp al,'a'
|
|
||||||
jb @@uppercase
|
|
||||||
cmp al,'z'
|
|
||||||
ja @@uppercase
|
|
||||||
sub [byte ptr si-1],'a'-'A'
|
|
||||||
jmp @@uppercase
|
|
||||||
@@enduppercase:
|
|
||||||
clc
|
|
||||||
ret
|
|
||||||
endp uppercase
|
|
||||||
|
|
||||||
;met en majuscule la premiŠre lettre chaine ds:%0
|
|
||||||
PROC onecase FAR
|
|
||||||
ARG @src:word
|
|
||||||
USES ax
|
|
||||||
mov si,[@src]
|
|
||||||
mov al,[ds:si]
|
|
||||||
cmp al,'a'
|
|
||||||
jb @@oneenduppercase
|
|
||||||
cmp al,'z'
|
|
||||||
ja @@oneenduppercase
|
|
||||||
sub [byte ptr si],'a'-'A'
|
|
||||||
@@oneenduppercase:
|
|
||||||
clc
|
|
||||||
ret
|
|
||||||
endp onecase
|
|
||||||
|
|
||||||
;met en minuscule la chaine ds:%0
|
|
||||||
PROC lowercase FAR
|
|
||||||
ARG @src:word
|
|
||||||
USES si,ax
|
|
||||||
mov si,[@src]
|
|
||||||
@@lowercase:
|
|
||||||
mov al,[ds:si]
|
|
||||||
inc si
|
|
||||||
cmp al,0
|
|
||||||
je @@endlowercase
|
|
||||||
cmp al,'A'
|
|
||||||
jb @@lowercase
|
|
||||||
cmp al,'Z'
|
|
||||||
ja @@lowercase
|
|
||||||
add [byte ptr si-1],'a'-'A'
|
|
||||||
jmp @@lowercase
|
|
||||||
@@endlowercase:
|
|
||||||
clc
|
|
||||||
ret
|
|
||||||
endp lowercase
|
|
||||||
|
|
||||||
;Inverse la casse la chaine ds:%0
|
|
||||||
PROC invertcase FAR
|
|
||||||
ARG @src:word
|
|
||||||
USES si,ax
|
|
||||||
mov si,[@src]
|
|
||||||
@@invertcase:
|
|
||||||
mov al,[ds:si]
|
|
||||||
inc si
|
|
||||||
cmp al,0
|
|
||||||
je @@endinvertcase
|
|
||||||
cmp al,'A'
|
|
||||||
jb @@invertcase
|
|
||||||
cmp al,'Z'
|
|
||||||
jbe @@goinvertcase
|
|
||||||
cmp al,'a'
|
|
||||||
jb @@invertcase
|
|
||||||
cmp al,'z'
|
|
||||||
ja @@invertcase
|
|
||||||
sub [byte ptr si-1],'a'-'A'
|
|
||||||
jmp @@invertcase
|
|
||||||
@@goinvertcase:
|
|
||||||
add [byte ptr si-1],'a'-'A'
|
|
||||||
jmp @@invertcase
|
|
||||||
@@endinvertcase:
|
|
||||||
clc
|
|
||||||
ret
|
|
||||||
endp invertcase
|
|
||||||
|
|
170
lib/video.asm
170
lib/video.asm
|
@ -11,41 +11,63 @@ org 0h
|
||||||
|
|
||||||
header exe <"CE",1,0,0,offset exports,offset imports,,>
|
header exe <"CE",1,0,0,offset exports,offset imports,,>
|
||||||
|
|
||||||
exporting
|
exports:
|
||||||
declare print
|
db "print",0
|
||||||
declare showdate
|
dw print
|
||||||
declare showtime
|
db "showdate",0
|
||||||
declare showname
|
dw showdate
|
||||||
declare showattr
|
db "showtime",0
|
||||||
declare showsize
|
dw showtime
|
||||||
declare showspace
|
db "showname",0
|
||||||
declare showint
|
dw showname
|
||||||
declare showsigned
|
db "showattr",0
|
||||||
declare showhex
|
dw showattr
|
||||||
declare showbin
|
db "showsize",0
|
||||||
declare showbcd
|
dw showsize
|
||||||
declare showstring
|
db "showspace",0
|
||||||
declare showstring0
|
dw showspace
|
||||||
declare showintr
|
db "showint",0
|
||||||
declare showintl
|
dw showint
|
||||||
declare showchar
|
db "showsigned",0
|
||||||
ende
|
dw showsigned
|
||||||
|
db "showhex",0
|
||||||
importing
|
dw showhex
|
||||||
use VIDEO,addline
|
db "showbin",0
|
||||||
use VIDEO,setcolor
|
dw showbin
|
||||||
use VIDEO,getxy
|
db "showbcd",0
|
||||||
use VIDEO,setxy
|
dw showbcd
|
||||||
use VIDEO,setvideomode
|
db "showstring",0
|
||||||
use VIDEO,setfont
|
dw showstring
|
||||||
use VIDEO,clearscreen
|
db "showstring0",0
|
||||||
use VIDEO,enablescroll
|
dw showstring0
|
||||||
use VIDEO,disablescroll
|
db "showintr",0
|
||||||
use VIDEO,showchars
|
dw showintr
|
||||||
use VIDEO,savestate
|
db "showintl",0
|
||||||
use VIDEO,restorestate
|
dw showintl
|
||||||
endi
|
dw 0
|
||||||
|
|
||||||
|
imports:
|
||||||
|
db "VIDEO::addline",0
|
||||||
|
addline dd 0
|
||||||
|
db "VIDEO::setcolor",0
|
||||||
|
setcolor dd 0
|
||||||
|
db "VIDEO::getxy",0
|
||||||
|
getxy dd 0
|
||||||
|
db "VIDEO::setxy",0
|
||||||
|
setxy dd 0
|
||||||
|
db "VIDEO::setvideomode",0
|
||||||
|
setvideomode dd 0
|
||||||
|
db "VIDEO::setfont",0
|
||||||
|
setfont dd 0
|
||||||
|
db "VIDEO::clearscreen",0
|
||||||
|
clearscreen dd 0
|
||||||
|
db "VIDEO::enablescroll",0
|
||||||
|
enablescroll dd 0
|
||||||
|
db "VIDEO::disablescroll",0
|
||||||
|
disablescroll dd 0
|
||||||
|
db "VIDEO::showchar",0
|
||||||
|
showchar dd 0
|
||||||
|
dw 0
|
||||||
|
|
||||||
;================PRINT==============
|
;================PRINT==============
|
||||||
;Affiche la chaine %0 en utilisant les parametres de formatage %x....%x
|
;Affiche la chaine %0 en utilisant les parametres de formatage %x....%x
|
||||||
|
@ -67,7 +89,7 @@ PROC print FAR
|
||||||
je @@special2
|
je @@special2
|
||||||
@@showit:
|
@@showit:
|
||||||
xor ch,ch
|
xor ch,ch
|
||||||
call [cs:showchars],cx,0FFFFh
|
call [cs:showchar],cx,0FFFFh
|
||||||
inc si
|
inc si
|
||||||
jmp @@strinaize0
|
jmp @@strinaize0
|
||||||
@@special:
|
@@special:
|
||||||
|
@ -78,7 +100,7 @@ PROC print FAR
|
||||||
@@notshowit:
|
@@notshowit:
|
||||||
mov cl,[byte ptr si+1]
|
mov cl,[byte ptr si+1]
|
||||||
cmp cl,'c'
|
cmp cl,'c'
|
||||||
je @@showchars
|
je @@showchar
|
||||||
cmp cl,'u'
|
cmp cl,'u'
|
||||||
je @@showint
|
je @@showint
|
||||||
cmp cl,'v'
|
cmp cl,'v'
|
||||||
|
@ -110,10 +132,10 @@ PROC print FAR
|
||||||
clc
|
clc
|
||||||
jmp @@no0
|
jmp @@no0
|
||||||
|
|
||||||
@@showchars:
|
@@showchar:
|
||||||
cmp [byte ptr si+2],'M'
|
cmp [byte ptr si+2],'M'
|
||||||
je @@showmultchar
|
je @@showmultchar
|
||||||
call [cs:showchars],[word ptr @@pointer+di+2],0FFFFh
|
call [cs:showchar],[word ptr @@pointer+di+2],0FFFFh
|
||||||
add si,2
|
add si,2
|
||||||
add di,2
|
add di,2
|
||||||
jmp @@strinaize0
|
jmp @@strinaize0
|
||||||
|
@ -121,10 +143,10 @@ PROC print FAR
|
||||||
mov cx,[offset @@pointer+di+2+2]
|
mov cx,[offset @@pointer+di+2+2]
|
||||||
cmp cx,0
|
cmp cx,0
|
||||||
je @@nextfunc
|
je @@nextfunc
|
||||||
@@showcharsx:
|
@@showcharx:
|
||||||
call [cs:showchars],[word ptr @@pointer+di+2],0FFFFh
|
call [cs:showchar],[word ptr @@pointer+di+2],0FFFFh
|
||||||
dec cx
|
dec cx
|
||||||
jnz @@showcharsx
|
jnz @@showcharx
|
||||||
@@nextfunc:
|
@@nextfunc:
|
||||||
add si,3
|
add si,3
|
||||||
add di,4
|
add di,4
|
||||||
|
@ -329,7 +351,7 @@ PROC print FAR
|
||||||
add al,[si+3]
|
add al,[si+3]
|
||||||
sub al,'0'
|
sub al,'0'
|
||||||
xor ah,ah
|
xor ah,ah
|
||||||
call [cs:setvideomode],ax
|
call [cs:setvideomode]
|
||||||
add si,4
|
add si,4
|
||||||
jmp @@strinaize0
|
jmp @@strinaize0
|
||||||
|
|
||||||
|
@ -358,12 +380,14 @@ PROC print FAR
|
||||||
jmp @@strinaize0
|
jmp @@strinaize0
|
||||||
|
|
||||||
@@savestate:
|
@@savestate:
|
||||||
call [cs:savestate]
|
mov ah,40
|
||||||
|
int 47h
|
||||||
add si,2
|
add si,2
|
||||||
jmp @@strinaize0
|
jmp @@strinaize0
|
||||||
|
|
||||||
@@restorestate:
|
@@restorestate:
|
||||||
call [cs:restorestate]
|
mov ah,41
|
||||||
|
int 47h
|
||||||
add si,2
|
add si,2
|
||||||
jmp @@strinaize0
|
jmp @@strinaize0
|
||||||
|
|
||||||
|
@ -398,6 +422,8 @@ PROC print FAR
|
||||||
sub bl,'0'
|
sub bl,'0'
|
||||||
xor bh,bh
|
xor bh,bh
|
||||||
call [cs:setxy],ax,bx
|
call [cs:setxy],ax,bx
|
||||||
|
mov ah,25
|
||||||
|
int 47h
|
||||||
add si,7
|
add si,7
|
||||||
jmp @@strinaize0
|
jmp @@strinaize0
|
||||||
|
|
||||||
|
@ -413,6 +439,7 @@ PROC print FAR
|
||||||
pop di si cx bx ax
|
pop di si cx bx ax
|
||||||
mov sp,bp
|
mov sp,bp
|
||||||
ret
|
ret
|
||||||
|
|
||||||
ENDP print
|
ENDP print
|
||||||
|
|
||||||
|
|
||||||
|
@ -428,12 +455,12 @@ PROC showdate FAR
|
||||||
mov dx,[@dates]
|
mov dx,[@dates]
|
||||||
and dx,11111b
|
and dx,11111b
|
||||||
call showintl,2,edx
|
call showintl,2,edx
|
||||||
call [cs:showchars],'/',0FFFFh
|
call [cs:showchar],'/',0FFFFh
|
||||||
mov dx,[@dates]
|
mov dx,[@dates]
|
||||||
shr dx,5
|
shr dx,5
|
||||||
and dx,111b
|
and dx,111b
|
||||||
call showintl,2,edx
|
call showintl,2,edx
|
||||||
call [cs:showchars],'/',0FFFFh
|
call [cs:showchar],'/',0FFFFh
|
||||||
mov dx,[@dates]
|
mov dx,[@dates]
|
||||||
shr dx,8
|
shr dx,8
|
||||||
and dx,11111111b
|
and dx,11111111b
|
||||||
|
@ -455,12 +482,12 @@ PROC showtime FAR
|
||||||
shr dx,11
|
shr dx,11
|
||||||
and dx,11111b
|
and dx,11111b
|
||||||
call showintl,2,edx
|
call showintl,2,edx
|
||||||
call [cs:showchars],':',0FFFFh
|
call [cs:showchar],':',0FFFFh
|
||||||
mov dx,[@times]
|
mov dx,[@times]
|
||||||
shr dx,5
|
shr dx,5
|
||||||
and dx,111111b
|
and dx,111111b
|
||||||
call showintl,2,edx
|
call showintl,2,edx
|
||||||
call [cs:showchars],':',0FFFFh
|
call [cs:showchar],':',0FFFFh
|
||||||
mov dx,[@times]
|
mov dx,[@times]
|
||||||
and dx,11111b
|
and dx,11111b
|
||||||
shl dx,1
|
shl dx,1
|
||||||
|
@ -479,12 +506,12 @@ PROC showname FAR
|
||||||
mov si,[@thename]
|
mov si,[@thename]
|
||||||
xor cx,cx
|
xor cx,cx
|
||||||
@@showthename:
|
@@showthename:
|
||||||
call [cs:showchars],[word ptr ds:si],0FFFFh
|
call [cs:showchar],[word ptr ds:si],0FFFFh
|
||||||
inc si
|
inc si
|
||||||
inc cx
|
inc cx
|
||||||
cmp cx,8
|
cmp cx,8
|
||||||
jne @@suiteaname
|
jne @@suiteaname
|
||||||
call [cs:showchars],' ',0FFFFh
|
call [cs:showchar],' ',0FFFFh
|
||||||
@@suiteaname:
|
@@suiteaname:
|
||||||
cmp cx,8+3
|
cmp cx,8+3
|
||||||
jb @@showthename
|
jb @@showthename
|
||||||
|
@ -506,7 +533,7 @@ PROC showattr FAR
|
||||||
@@noreadonly:
|
@@noreadonly:
|
||||||
push '-'
|
push '-'
|
||||||
@@readonly:
|
@@readonly:
|
||||||
call [cs:showchars]
|
call [cs:showchar]
|
||||||
push 0FFFFh
|
push 0FFFFh
|
||||||
test [@attr],00000010b
|
test [@attr],00000010b
|
||||||
je @@nohidden
|
je @@nohidden
|
||||||
|
@ -515,7 +542,7 @@ PROC showattr FAR
|
||||||
@@nohidden:
|
@@nohidden:
|
||||||
push '-'
|
push '-'
|
||||||
@@hidden:
|
@@hidden:
|
||||||
call [cs:showchars]
|
call [cs:showchar]
|
||||||
push 0FFFFh
|
push 0FFFFh
|
||||||
test [@attr],00000100b
|
test [@attr],00000100b
|
||||||
je @@nosystem
|
je @@nosystem
|
||||||
|
@ -524,7 +551,7 @@ PROC showattr FAR
|
||||||
@@nosystem:
|
@@nosystem:
|
||||||
push '-'
|
push '-'
|
||||||
@@system:
|
@@system:
|
||||||
call [cs:showchars]
|
call [cs:showchar]
|
||||||
push 0FFFFh
|
push 0FFFFh
|
||||||
test [@attr],00100000b
|
test [@attr],00100000b
|
||||||
je @@noarchive
|
je @@noarchive
|
||||||
|
@ -533,7 +560,7 @@ PROC showattr FAR
|
||||||
@@noarchive:
|
@@noarchive:
|
||||||
push '-'
|
push '-'
|
||||||
@@archive:
|
@@archive:
|
||||||
call [cs:showchars]
|
call [cs:showchar]
|
||||||
push 0FFFFh
|
push 0FFFFh
|
||||||
test [@attr],00010000b
|
test [@attr],00010000b
|
||||||
je @@nodirectory
|
je @@nodirectory
|
||||||
|
@ -542,7 +569,7 @@ PROC showattr FAR
|
||||||
@@nodirectory:
|
@@nodirectory:
|
||||||
push '-'
|
push '-'
|
||||||
@@directory:
|
@@directory:
|
||||||
call [cs:showchars]
|
call [cs:showchar]
|
||||||
ret
|
ret
|
||||||
ENDP showattr
|
ENDP showattr
|
||||||
|
|
||||||
|
@ -595,7 +622,7 @@ ENDP showsize
|
||||||
;<-
|
;<-
|
||||||
;==============================
|
;==============================
|
||||||
PROC showspace FAR
|
PROC showspace FAR
|
||||||
call [cs:showchars],' ',0FFFFh
|
call [cs:showchar],' ',0FFFFh
|
||||||
clc
|
clc
|
||||||
ret
|
ret
|
||||||
ENDP showspace
|
ENDP showspace
|
||||||
|
@ -626,7 +653,7 @@ PROC showint FAR
|
||||||
@@showinteger:
|
@@showinteger:
|
||||||
inc bx
|
inc bx
|
||||||
mov cl,[cs:bx]
|
mov cl,[cs:bx]
|
||||||
call [cs:showchars],cx,0FFFFh
|
call [cs:showchar],cx,0FFFFh
|
||||||
dec ax
|
dec ax
|
||||||
jnz @@showinteger
|
jnz @@showinteger
|
||||||
ret
|
ret
|
||||||
|
@ -673,7 +700,7 @@ PROC showintl FAR
|
||||||
@@showinteger:
|
@@showinteger:
|
||||||
inc bx
|
inc bx
|
||||||
mov cl,[cs:bx]
|
mov cl,[cs:bx]
|
||||||
call [cs:showchars],cx,0FFFFh
|
call [cs:showchar],cx,0FFFFh
|
||||||
dec ax
|
dec ax
|
||||||
jnz @@showinteger
|
jnz @@showinteger
|
||||||
ret
|
ret
|
||||||
|
@ -718,7 +745,7 @@ PROC showintr FAR
|
||||||
@@showinteger:
|
@@showinteger:
|
||||||
inc bx
|
inc bx
|
||||||
mov cl,[cs:bx]
|
mov cl,[cs:bx]
|
||||||
call [cs:showchars],cx,0FFFFh
|
call [cs:showchar],cx,0FFFFh
|
||||||
dec ax
|
dec ax
|
||||||
jnz @@showinteger
|
jnz @@showinteger
|
||||||
ret
|
ret
|
||||||
|
@ -756,9 +783,9 @@ PROC showsigned FAR
|
||||||
jbe @@notsigned
|
jbe @@notsigned
|
||||||
neg edx
|
neg edx
|
||||||
@@showminus:
|
@@showminus:
|
||||||
call [cs:showchars],'-',0FFFFh
|
call [cs:showchar],'-',0FFFFh
|
||||||
@@notsigned:
|
@@notsigned:
|
||||||
call showint,edx
|
call showint,edx,0FFFFh
|
||||||
ret
|
ret
|
||||||
ENDP showsigned
|
ENDP showsigned
|
||||||
|
|
||||||
|
@ -782,7 +809,7 @@ PROC showhex FAR
|
||||||
mov bx,dx
|
mov bx,dx
|
||||||
and bx,0fh
|
and bx,0fh
|
||||||
mov cl,[cs:bx+offset Tab]
|
mov cl,[cs:bx+offset Tab]
|
||||||
call [cs:showchars],cx,0FFFFh
|
call [cs:showchar],cx,0FFFFh
|
||||||
dec al
|
dec al
|
||||||
jnz @@Hexaize
|
jnz @@Hexaize
|
||||||
ret
|
ret
|
||||||
|
@ -808,7 +835,7 @@ PROC showbin FAR
|
||||||
rol edx,1
|
rol edx,1
|
||||||
mov cl,'0'
|
mov cl,'0'
|
||||||
adc cl,0
|
adc cl,0
|
||||||
call [cs:showchars],cx,0FFFFh
|
call [cs:showchar],cx,0FFFFh
|
||||||
dec al
|
dec al
|
||||||
jnz @@binaize
|
jnz @@binaize
|
||||||
ret
|
ret
|
||||||
|
@ -834,7 +861,7 @@ PROC showbcd FAR
|
||||||
mov cl,dl
|
mov cl,dl
|
||||||
and cl,0fh
|
and cl,0fh
|
||||||
add cl,'0'
|
add cl,'0'
|
||||||
call [cs:showchars],cx,0FFFFh
|
call [cs:showchar],cx,0FFFFh
|
||||||
dec al
|
dec al
|
||||||
jnz @@BCDaize
|
jnz @@BCDaize
|
||||||
ret
|
ret
|
||||||
|
@ -852,23 +879,12 @@ PROC showstring FAR
|
||||||
mov bl,[si]
|
mov bl,[si]
|
||||||
@@strinaize:
|
@@strinaize:
|
||||||
inc si
|
inc si
|
||||||
call [cs:showchars],[word ptr si],0FFFFh
|
call [cs:showchar],[word ptr si],0FFFFh
|
||||||
dec bl
|
dec bl
|
||||||
jnz @@strinaize
|
jnz @@strinaize
|
||||||
ret
|
ret
|
||||||
ENDP showstring
|
ENDP showstring
|
||||||
|
|
||||||
;==========showchars===========
|
|
||||||
;Affiche un caractčre %0 aprés le curseur
|
|
||||||
;-> %0 caractčre
|
|
||||||
;<-
|
|
||||||
;===============================
|
|
||||||
PROC showchar FAR
|
|
||||||
ARG @pointer:word
|
|
||||||
call [cs:showchars],[@pointer],0FFFFh
|
|
||||||
ret
|
|
||||||
ENDP showchar
|
|
||||||
|
|
||||||
;==========SHOWSTRING0===========
|
;==========SHOWSTRING0===========
|
||||||
;Affiche une chaine de caractère pointée par ds:%1 aprés le curseur
|
;Affiche une chaine de caractère pointée par ds:%1 aprés le curseur
|
||||||
;-> ds:%1 pointeur chaine type zéro terminal
|
;-> ds:%1 pointeur chaine type zéro terminal
|
||||||
|
@ -882,7 +898,7 @@ PROC showstring0 FAR
|
||||||
mov cl,[si]
|
mov cl,[si]
|
||||||
cmp cl,0
|
cmp cl,0
|
||||||
je @@no0
|
je @@no0
|
||||||
call [cs:showchars],cx,0FFFFh
|
call [cs:showchar],cx,0FFFFh
|
||||||
inc si
|
inc si
|
||||||
jmp @@strinaize0
|
jmp @@strinaize0
|
||||||
@@no0:
|
@@no0:
|
||||||
|
|
279
noyau/8259a.asm
279
noyau/8259a.asm
|
@ -91,7 +91,7 @@ endp seteoi
|
||||||
|
|
||||||
|
|
||||||
;Lit les masques d'un contr“leur IRQ dans ax, 0 master ou slave 1 ds %1
|
;Lit les masques d'un contr“leur IRQ dans ax, 0 master ou slave 1 ds %1
|
||||||
PROC readimr FAR
|
PROC readmaskirq FAR
|
||||||
ARG @controleur:word
|
ARG @controleur:word
|
||||||
USES bx,dx
|
USES bx,dx
|
||||||
mov bx,[@controleur]
|
mov bx,[@controleur]
|
||||||
|
@ -104,7 +104,7 @@ PROC readimr FAR
|
||||||
in al,dx
|
in al,dx
|
||||||
pop dx
|
pop dx
|
||||||
ret
|
ret
|
||||||
endp readimr
|
endp readmaskirq
|
||||||
|
|
||||||
;Lit le registre d'‚tat d'un contr“leur IRQ dans ax, 0 master ou slave 1 ds %1
|
;Lit le registre d'‚tat d'un contr“leur IRQ dans ax, 0 master ou slave 1 ds %1
|
||||||
PROC readisr FAR
|
PROC readisr FAR
|
||||||
|
@ -139,277 +139,4 @@ PROC readirr FAR
|
||||||
xor ah,ah
|
xor ah,ah
|
||||||
in al,dx
|
in al,dx
|
||||||
ret
|
ret
|
||||||
endp readirr
|
endp readirr
|
||||||
|
|
||||||
;carry si enable et pas carry si pas enable
|
|
||||||
PROC isenableirq FAR
|
|
||||||
ARG @irq:word
|
|
||||||
USES ax,cx,dx
|
|
||||||
mov ax,[@irq]
|
|
||||||
mov dx,MASTERPIC+IRQMASK
|
|
||||||
cmp al,7
|
|
||||||
jbe @@master
|
|
||||||
mov dx,SLAVEPIC+IRQMASK
|
|
||||||
@@master:
|
|
||||||
mov cl,al
|
|
||||||
and cx,7
|
|
||||||
in al,dx
|
|
||||||
neg al
|
|
||||||
bt ax,cx
|
|
||||||
ret
|
|
||||||
endp isenableirq
|
|
||||||
|
|
||||||
|
|
||||||
;carry si enable et pas carry si pas enable
|
|
||||||
PROC isinserviceirq FAR
|
|
||||||
ARG @irq:word
|
|
||||||
USES ax,cx,dx
|
|
||||||
mov ax,[@irq]
|
|
||||||
mov dx,MASTERPIC
|
|
||||||
cmp al,7
|
|
||||||
jbe @@master
|
|
||||||
mov dx,SLAVEPIC
|
|
||||||
@@master:
|
|
||||||
mov cl,al
|
|
||||||
mov al,ISR
|
|
||||||
out dx,al
|
|
||||||
and cx,7
|
|
||||||
in al,dx
|
|
||||||
neg al
|
|
||||||
bt ax,cx
|
|
||||||
ret
|
|
||||||
endp isinserviceirq
|
|
||||||
|
|
||||||
|
|
||||||
;carry si enable et pas carry si pas enable
|
|
||||||
PROC isrequestirq FAR
|
|
||||||
ARG @irq:word
|
|
||||||
USES ax,cx,dx
|
|
||||||
mov ax,[@irq]
|
|
||||||
mov dx,MASTERPIC
|
|
||||||
cmp al,7
|
|
||||||
jbe @@master
|
|
||||||
mov dx,SLAVEPIC
|
|
||||||
@@master:
|
|
||||||
mov cl,al
|
|
||||||
mov al,IRR
|
|
||||||
out dx,al
|
|
||||||
and cx,7
|
|
||||||
in al,dx
|
|
||||||
neg al
|
|
||||||
bt ax,cx
|
|
||||||
ret
|
|
||||||
endp isrequestirq
|
|
||||||
|
|
||||||
|
|
||||||
PROC installirqhandler FAR
|
|
||||||
USES eax,bx,cx,edx,si,di,ds,es
|
|
||||||
push fs
|
|
||||||
call mbcreate,offset interruptionbloc,256*size ints
|
|
||||||
mov es,ax
|
|
||||||
mov ax,0x0000
|
|
||||||
mov ds,ax
|
|
||||||
xor si,si
|
|
||||||
@@searchdummypointer:
|
|
||||||
mov fs,[(vector si).data.seg]
|
|
||||||
mov bx,[(vector si).data.off]
|
|
||||||
cmp [byte ptr fs:bx],0xCF ;iret
|
|
||||||
je @@founded
|
|
||||||
add si,size vector
|
|
||||||
cmp si,256*4
|
|
||||||
jb @@searchdummypointer
|
|
||||||
xor edx,edx
|
|
||||||
jmp @@suite
|
|
||||||
@@founded:
|
|
||||||
mov edx,[(vector si).content]
|
|
||||||
@@suite:
|
|
||||||
xor cx,cx
|
|
||||||
xor si,si
|
|
||||||
xor di,di
|
|
||||||
cli
|
|
||||||
@@copy:
|
|
||||||
mov [es:(ints di).number],cl
|
|
||||||
mov [es:(ints di).locked],0
|
|
||||||
mov [es:(ints di).vector1.content],0
|
|
||||||
mov [es:(ints di).vector3.content],0
|
|
||||||
mov [es:(ints di).vector4.content],0
|
|
||||||
mov [es:(ints di).vector5.content],0
|
|
||||||
mov [es:(ints di).vector6.content],0
|
|
||||||
mov [es:(ints di).vector7.content],0
|
|
||||||
mov [es:(ints di).vector8.content],0
|
|
||||||
mov [es:(ints di).launchedlow],0
|
|
||||||
mov [es:(ints di).launchedhigh],0
|
|
||||||
mov [es:(ints di).calledlow],0
|
|
||||||
mov [es:(ints di).calledhigh],0
|
|
||||||
mov eax,[(vector si).content]
|
|
||||||
cmp eax,edx
|
|
||||||
je @@notarealvector
|
|
||||||
mov [es:(ints di).vector1.content],eax
|
|
||||||
mov [es:(ints di).activated],1
|
|
||||||
jmp @@copynext
|
|
||||||
@@notarealvector:
|
|
||||||
mov [es:(ints di).vector1.content],0
|
|
||||||
mov [es:(ints di).activated],0
|
|
||||||
@@copynext:
|
|
||||||
mov bx,cx
|
|
||||||
shl bx,3
|
|
||||||
sub bx,cx
|
|
||||||
add bx,offset coupling
|
|
||||||
mov [(vector si).data.seg],cs
|
|
||||||
mov [(vector si).data.off],bx
|
|
||||||
add si,size vector
|
|
||||||
add di,size ints
|
|
||||||
inc cl
|
|
||||||
cmp cl,0
|
|
||||||
jne @@copy
|
|
||||||
@@end:
|
|
||||||
pop fs
|
|
||||||
sti
|
|
||||||
ret
|
|
||||||
endp installirqhandler
|
|
||||||
|
|
||||||
|
|
||||||
interruptionbloc db '/interrupts',0
|
|
||||||
|
|
||||||
|
|
||||||
PROC savecontext FAR
|
|
||||||
ARG @pointer:word
|
|
||||||
USES eax,si,ds
|
|
||||||
pushfd
|
|
||||||
push eax
|
|
||||||
push ebx
|
|
||||||
push ecx
|
|
||||||
push edx
|
|
||||||
push esi
|
|
||||||
push edi
|
|
||||||
push ds
|
|
||||||
push es
|
|
||||||
push fs
|
|
||||||
push gs
|
|
||||||
push ss
|
|
||||||
mov si,[@pointer]
|
|
||||||
mov ds,[ss:bp+4]
|
|
||||||
mov eax,ebp
|
|
||||||
mov ax,[word ptr ss:bp]
|
|
||||||
push eax
|
|
||||||
push [word ptr ss:bp+4]
|
|
||||||
xor eax,eax
|
|
||||||
mov ax,[word ptr ss:bp+2]
|
|
||||||
push eax
|
|
||||||
mov ax,bp
|
|
||||||
add ax,4
|
|
||||||
push eax
|
|
||||||
pop [(regs si).sesp]
|
|
||||||
pop [(regs si).seip]
|
|
||||||
pop [(regs si).scs]
|
|
||||||
pop [(regs si).sebp]
|
|
||||||
pop [(regs si).sss]
|
|
||||||
pop [(regs si).sgs]
|
|
||||||
pop [(regs si).sfs]
|
|
||||||
pop [(regs si).ses]
|
|
||||||
pop [(regs si).sds]
|
|
||||||
pop [(regs si).sedi]
|
|
||||||
pop [(regs si).sesi]
|
|
||||||
pop [(regs si).sedx]
|
|
||||||
pop [(regs si).secx]
|
|
||||||
pop [(regs si).sebx]
|
|
||||||
pop [(regs si).seax]
|
|
||||||
pop [(regs si).seflags]
|
|
||||||
ret
|
|
||||||
endp savecontext
|
|
||||||
|
|
||||||
PROC restorecontextg FAR
|
|
||||||
ARG @pointer:word
|
|
||||||
mov si,[@pointer]
|
|
||||||
pushd [cs:(regs si).sesi]
|
|
||||||
pushd [cs:(regs si).seflags]
|
|
||||||
mov eax,[cs:(regs si).seax]
|
|
||||||
mov ebx,[cs:(regs si).sebx]
|
|
||||||
mov ecx,[cs:(regs si).secx]
|
|
||||||
mov edx,[cs:(regs si).sedx]
|
|
||||||
mov edi,[cs:(regs si).sedi]
|
|
||||||
mov ebp,[cs:(regs si).sebp]
|
|
||||||
mov es,[cs:(regs si).ses]
|
|
||||||
mov fs,[cs:(regs si).sfs]
|
|
||||||
mov gs,[cs:(regs si).sgs]
|
|
||||||
mov ds,[cs:(regs si).sds]
|
|
||||||
popfd
|
|
||||||
pop esi
|
|
||||||
pop [cs:dummy]
|
|
||||||
db 0xCA,0x02,0x00 ;retf 2
|
|
||||||
endp restorecontextg
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
coupling:
|
|
||||||
counter = 0
|
|
||||||
REPEAT 256
|
|
||||||
push counter+256
|
|
||||||
push offset irqhandlers
|
|
||||||
ret
|
|
||||||
counter = counter + 1
|
|
||||||
ENDM
|
|
||||||
|
|
||||||
interrupt dw 0
|
|
||||||
dummy dw 0
|
|
||||||
calling_reg regs <>
|
|
||||||
function_reg regs <>
|
|
||||||
|
|
||||||
irqhandlers:
|
|
||||||
cli
|
|
||||||
pop [cs:interrupt]
|
|
||||||
call savecontext,offset calling_reg
|
|
||||||
call irqhandler,[cs:interrupt]
|
|
||||||
call restorecontextg,offset calling_reg
|
|
||||||
sti
|
|
||||||
iret
|
|
||||||
|
|
||||||
PROC irqhandler NEAR
|
|
||||||
ARG @int:word
|
|
||||||
push cs
|
|
||||||
pop ds
|
|
||||||
call mbfindsb,offset interruptionbloc,cs
|
|
||||||
jc @@end
|
|
||||||
mov es,ax
|
|
||||||
mov ax,[@int]
|
|
||||||
sub ax,256
|
|
||||||
mov cx,size ints
|
|
||||||
mul cx
|
|
||||||
mov si,ax
|
|
||||||
add [es:(ints si).calledlow],1
|
|
||||||
adc [es:(ints si).calledhigh],0
|
|
||||||
cmp [es:(ints si).activated],1
|
|
||||||
jne @@end
|
|
||||||
add [es:(ints si).launchedlow],1
|
|
||||||
adc [es:(ints si).launchedhigh],0
|
|
||||||
lea si,[es:(ints si).vector1]
|
|
||||||
mov cl,8
|
|
||||||
@@launchall:
|
|
||||||
cmp [es:(vector si).content],0
|
|
||||||
je @@end
|
|
||||||
push [word ptr cs:calling_reg.seflags]
|
|
||||||
push cs
|
|
||||||
push offset @@back
|
|
||||||
push [es:(vector si).data.seg]
|
|
||||||
push [es:(vector si).data.off]
|
|
||||||
call savecontext,offset function_reg
|
|
||||||
call restorecontextg,offset calling_reg
|
|
||||||
db 0xCB
|
|
||||||
@@back:
|
|
||||||
cli
|
|
||||||
call savecontext,offset calling_reg
|
|
||||||
call restorecontextg,offset function_reg
|
|
||||||
@@next:
|
|
||||||
add si,size vector
|
|
||||||
dec cl
|
|
||||||
jnz @@launchall
|
|
||||||
@@end:
|
|
||||||
ret
|
|
||||||
endp irqhandler
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,16 +1,14 @@
|
||||||
asm= lzasm /z/t
|
asm= lzasm
|
||||||
lnk= elink
|
lnk= elink
|
||||||
|
|
||||||
all: systeme.sys boot.bin
|
all: systeme.sys boot.bin
|
||||||
|
|
||||||
systeme.sys: video.obj disque.obj systeme.obj
|
systeme.sys: video.obj systeme.obj
|
||||||
$(lnk) systeme.obj systeme.sys
|
$(lnk) systeme.obj systeme.sys
|
||||||
|
|
||||||
systeme.obj: ..\lib\detect.lib ..\lib\video.lib video.sys disque.sys
|
systeme.obj: ../lib/detect.lib ../lib/video.lib video.sys
|
||||||
$(asm) systeme.asm
|
$(asm) systeme.asm
|
||||||
|
|
||||||
disque.sys:
|
|
||||||
$(lnk) disque.obj disque.sys
|
|
||||||
|
|
||||||
video.sys:
|
video.sys:
|
||||||
$(lnk) video.obj video.sys
|
$(lnk) video.obj video.sys
|
||||||
|
@ -18,12 +16,12 @@ video.sys:
|
||||||
boot.bin: boot.obj
|
boot.bin: boot.obj
|
||||||
$(lnk) boot.obj boot.bin /bs
|
$(lnk) boot.obj boot.bin /bs
|
||||||
|
|
||||||
|
detect.obj:
|
||||||
|
$(asm) detect.asm
|
||||||
|
|
||||||
video.obj:
|
video.obj:
|
||||||
$(asm) video.asm
|
$(asm) video.asm
|
||||||
|
|
||||||
disque.obj:
|
|
||||||
$(asm) disque.asm
|
|
||||||
|
|
||||||
boot.obj:
|
boot.obj:
|
||||||
$(asm) boot.asm
|
$(asm) boot.asm
|
||||||
|
|
||||||
|
|
|
@ -108,7 +108,7 @@ oksystem:
|
||||||
mov si,offset syst
|
mov si,offset syst
|
||||||
call showstr
|
call showstr
|
||||||
mov cx,[di+26]
|
mov cx,[di+26]
|
||||||
mov ax,8000h
|
mov ax,0900h
|
||||||
mov es,ax
|
mov es,ax
|
||||||
push es
|
push es
|
||||||
mov di,0000h
|
mov di,0000h
|
||||||
|
|
1655
noyau/disque.asm
1655
noyau/disque.asm
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,911 @@
|
||||||
|
.model tiny
|
||||||
|
.486
|
||||||
|
smart
|
||||||
|
.code
|
||||||
|
|
||||||
|
org 0h
|
||||||
|
|
||||||
|
start:
|
||||||
|
jmp tsr ;Saute à la routine résidente
|
||||||
|
names db 'FORMAT' ;Nom drivers
|
||||||
|
id dw 1234h ;Identifiant drivers
|
||||||
|
Tsr:
|
||||||
|
cli ;Désactive interruptions logiciellement
|
||||||
|
cmp ax,cs:ID ;Compare si test de chargement
|
||||||
|
jne nomore ;Si pas test alors on continu
|
||||||
|
rol ax,3*4 ;Rotation de 3 chiffre de l'ID pour montrer que le drivers est chargé
|
||||||
|
jmp itsok ;On termine l'int avec notre code d'ID preuve du bon chargement de VIDEO
|
||||||
|
nomore:
|
||||||
|
cmp ah,maxfunc
|
||||||
|
jbe noerrorint
|
||||||
|
stc
|
||||||
|
jmp itsok
|
||||||
|
noerrorint:
|
||||||
|
clc
|
||||||
|
push bx
|
||||||
|
mov bl,ah ;On calcule d'aprés le n° de fonction
|
||||||
|
xor bh,bh ;quel sera l'entrée dans la table indexée
|
||||||
|
shl bx,1 ;des adresses fonctions.
|
||||||
|
mov bx,cs:[bx+tables] ;On récupère cette adresse depuis la table
|
||||||
|
mov cs:current,bx ;On la stocke temporairement pour obtenir les registres d'origine
|
||||||
|
pop bx
|
||||||
|
clc
|
||||||
|
call cs:current ;Puis on execute la fonction
|
||||||
|
itsok:
|
||||||
|
push bp
|
||||||
|
mov bp,sp ;On prend sp dans bp pour adresser la pile
|
||||||
|
jnc noerror ;La fonction appelée a renvoyer une erreur : Flag CARRY ?
|
||||||
|
or byte ptr [bp+6],1b;Si oui on le retranscrit sur le registre FLAG qui sera dépilé lors du IRET
|
||||||
|
;xor eax,eax
|
||||||
|
;mov ax,cs ;On récupère le segment et l'offset puis en renvoie l'adresse physique
|
||||||
|
;shl eax,4 ;de l'erreur.
|
||||||
|
;add ax,cs:current
|
||||||
|
;jmp endofint ;on termine l'int
|
||||||
|
noerror:
|
||||||
|
and byte ptr [bp+6],0FEh;Si pas d'erreur on efface le Bit CARRY du FLAG qui sera dépilé lors du IRET
|
||||||
|
endofint:
|
||||||
|
pop bp
|
||||||
|
sti ;On réactive les interruptions logiciellement
|
||||||
|
iret ;Puis on retourne au programme appelant.
|
||||||
|
|
||||||
|
current dw 0 ;Mot temporaire qui contient l'adresse de la fonction appelée
|
||||||
|
tables dw setvideomode ;Table qui contient les adresses de toutes les fonctions de VIDEO (WORD)
|
||||||
|
|
||||||
|
|
||||||
|
;Librairie qui prend en charge le format de STR ASCIIZ
|
||||||
|
;# nombre 8
|
||||||
|
;@ str 7
|
||||||
|
;& nom 6
|
||||||
|
|
||||||
|
;High Low
|
||||||
|
;0 variable 4 hex
|
||||||
|
;1 byte 3 dec
|
||||||
|
;2 word 2 oct
|
||||||
|
;3 3 octets 1 bin
|
||||||
|
;4 dword 5 adresse
|
||||||
|
;5 5 octets 6 nom
|
||||||
|
;6 ... 7 str
|
||||||
|
; 8 nombre
|
||||||
|
|
||||||
|
|
||||||
|
;Renvoie carry si la syntaxe de ds:si n'est pas respect‚ par rapport a es:di
|
||||||
|
CheckSyntax0:
|
||||||
|
push ax bx dx bp si di ds es
|
||||||
|
push es di
|
||||||
|
push cs
|
||||||
|
pop es
|
||||||
|
mov di,offset temp2
|
||||||
|
call copy0
|
||||||
|
mov si,di
|
||||||
|
push cs
|
||||||
|
pop ds
|
||||||
|
pop di es
|
||||||
|
call getdelimiter0
|
||||||
|
mov bp,dx
|
||||||
|
mov dl,' '
|
||||||
|
call setdelimiter0
|
||||||
|
call compressdelimiter0
|
||||||
|
call uppercase0
|
||||||
|
call getnbitems0
|
||||||
|
;call xch
|
||||||
|
;mov ax,cx
|
||||||
|
;call getnbitem0
|
||||||
|
;call xch
|
||||||
|
;cmp ax,cx
|
||||||
|
;call xch
|
||||||
|
;jne notequalatall
|
||||||
|
mov bx,cx
|
||||||
|
xor cx,cx
|
||||||
|
itemer:
|
||||||
|
call whatisitem0
|
||||||
|
mov dx,ax
|
||||||
|
call xch
|
||||||
|
call whatisitem0
|
||||||
|
call xch
|
||||||
|
cmp ax,dx
|
||||||
|
jne prob
|
||||||
|
cmp al,6
|
||||||
|
jb equal
|
||||||
|
call cmpitems0
|
||||||
|
je equal
|
||||||
|
prob:
|
||||||
|
cmp dl,4
|
||||||
|
ja nosize
|
||||||
|
cmp al,8
|
||||||
|
je equal
|
||||||
|
cmp al,4
|
||||||
|
jne notequalatall
|
||||||
|
cmp dh,ah
|
||||||
|
ja notequalatall
|
||||||
|
jmp equal
|
||||||
|
nosize:
|
||||||
|
cmp al,7
|
||||||
|
jne noname
|
||||||
|
cmp ah,0
|
||||||
|
jne notequalatall
|
||||||
|
jmp equal
|
||||||
|
noname:
|
||||||
|
cmp al,8
|
||||||
|
je equal
|
||||||
|
jmp notequalatall
|
||||||
|
equal:
|
||||||
|
inc cx
|
||||||
|
cmp cx,bx
|
||||||
|
jne itemer
|
||||||
|
cld
|
||||||
|
ackno:
|
||||||
|
mov dx,bp
|
||||||
|
call setdelimiter0
|
||||||
|
pop es ds di si bp dx bx ax
|
||||||
|
ret
|
||||||
|
notequalatall:
|
||||||
|
stc
|
||||||
|
jmp ackno
|
||||||
|
xch:
|
||||||
|
push ds
|
||||||
|
push es
|
||||||
|
pop ds
|
||||||
|
pop es
|
||||||
|
xchg si,di
|
||||||
|
ret
|
||||||
|
|
||||||
|
temp2 db 256 dup (0)
|
||||||
|
|
||||||
|
;Compare les ‚l‚ments cx de deux chaine ds:si et es:di
|
||||||
|
Cmpitems0:
|
||||||
|
push cx dx si di
|
||||||
|
push cx di
|
||||||
|
call getpointeritem0
|
||||||
|
mov si,di
|
||||||
|
xor cx,cx
|
||||||
|
inc cx
|
||||||
|
call getpointeritem0
|
||||||
|
mov dx,di
|
||||||
|
sub dx,si
|
||||||
|
dec cx
|
||||||
|
pop di cx
|
||||||
|
push ds si
|
||||||
|
push es
|
||||||
|
pop ds
|
||||||
|
mov si,di
|
||||||
|
call getpointeritem0
|
||||||
|
pop si ds
|
||||||
|
mov cx,dx
|
||||||
|
rep cmpsb
|
||||||
|
pop di si dx cx
|
||||||
|
ret
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
;Renvoie l'‚l‚ment cx de ds:si dans edx si nb et dans es:di si str ou name
|
||||||
|
gettypeditem0:
|
||||||
|
push bx cx si
|
||||||
|
call getpointeritem0
|
||||||
|
mov si,di
|
||||||
|
xor cx,cx
|
||||||
|
inc cl
|
||||||
|
call getpointeritem0
|
||||||
|
mov bx,di
|
||||||
|
dec bx
|
||||||
|
mov cl,0
|
||||||
|
xchg cl,ds:[bx]
|
||||||
|
call gettyped0
|
||||||
|
xchg cl,ds:[bx]
|
||||||
|
pop si cx bx
|
||||||
|
ret
|
||||||
|
|
||||||
|
;Renvoie ds:si dans edx si nb et dans es:di si str ou name
|
||||||
|
gettyped0:
|
||||||
|
push ax
|
||||||
|
call whatis0
|
||||||
|
cmp al,5
|
||||||
|
jb number
|
||||||
|
cmp al,6
|
||||||
|
je pointer
|
||||||
|
push ds
|
||||||
|
pop es
|
||||||
|
call getpointeritem0
|
||||||
|
jmp endofGettypeditem0
|
||||||
|
number:
|
||||||
|
mov edx,cs:lastnumber
|
||||||
|
jmp endofgettypeditem0
|
||||||
|
pointer:
|
||||||
|
call str0toadress
|
||||||
|
endofgettypeditem0:
|
||||||
|
pop ax
|
||||||
|
ret
|
||||||
|
|
||||||
|
;Renvoie dans ax le type de la str0 point‚e par ds:si ‚l‚ment cx
|
||||||
|
whatisitem0:
|
||||||
|
push bx cx si di
|
||||||
|
call getpointeritem0
|
||||||
|
mov si,di
|
||||||
|
xor cx,cx
|
||||||
|
inc cl
|
||||||
|
call getpointeritem0
|
||||||
|
mov bx,di
|
||||||
|
dec bx
|
||||||
|
mov cl,0
|
||||||
|
xchg cl,ds:[bx]
|
||||||
|
call whatis0
|
||||||
|
xchg cl,ds:[bx]
|
||||||
|
pop di si cx bx
|
||||||
|
ret
|
||||||
|
|
||||||
|
;Renvoie dans ax le type de la str0 point‚e par ds:si
|
||||||
|
;High Low
|
||||||
|
;0 variable 4 hex
|
||||||
|
;1 byte 3 dec
|
||||||
|
;2 word 2 oct
|
||||||
|
;3 3 octets 1 bin
|
||||||
|
;4 dword 5 adresse
|
||||||
|
;5 5 octets 6 name
|
||||||
|
;6 ... 7 str
|
||||||
|
whatis0:
|
||||||
|
push bx cx edx
|
||||||
|
mov cl,2
|
||||||
|
call str0isbase
|
||||||
|
jnc finbase
|
||||||
|
mov cl,8
|
||||||
|
call str0isbase
|
||||||
|
jnc finbase
|
||||||
|
mov cl,10
|
||||||
|
call str0isbase
|
||||||
|
jnc finbase
|
||||||
|
mov cl,16
|
||||||
|
call str0isbase
|
||||||
|
jc testadress
|
||||||
|
finbase:
|
||||||
|
mov bx,cx
|
||||||
|
xor ch,ch
|
||||||
|
mov al,cs:[bx+offset basenn-2]
|
||||||
|
call str0toint
|
||||||
|
mov cs:Lastnumber,edx
|
||||||
|
cmp edx,0000FFFFh
|
||||||
|
ja bits32
|
||||||
|
cmp dx,00FFh
|
||||||
|
ja bits16
|
||||||
|
mov ah,1
|
||||||
|
jmp endofwhat
|
||||||
|
bits16:
|
||||||
|
mov ah,2
|
||||||
|
jmp endofwhat
|
||||||
|
bits32:
|
||||||
|
mov ah,3
|
||||||
|
jmp endofwhat
|
||||||
|
testadress:
|
||||||
|
call str0isadress
|
||||||
|
jc testname
|
||||||
|
mov ax,0005h
|
||||||
|
jmp endofwhat
|
||||||
|
testname:
|
||||||
|
;call str0isname
|
||||||
|
;jc testvarstr
|
||||||
|
;jnc isok
|
||||||
|
;mov al,06h
|
||||||
|
cmp byte ptr [si],'&'
|
||||||
|
jne testvarstr
|
||||||
|
mov al,06h
|
||||||
|
call getlength0
|
||||||
|
dec cl
|
||||||
|
mov ah,cl
|
||||||
|
jmp endofwhat
|
||||||
|
testvarstr:
|
||||||
|
cmp byte ptr [si],'@'
|
||||||
|
jne testnumber
|
||||||
|
mov al,07h
|
||||||
|
call getlength0
|
||||||
|
dec cl
|
||||||
|
mov ah,cl
|
||||||
|
jmp endofwhat
|
||||||
|
testnumber:
|
||||||
|
cmp byte ptr [si],'#'
|
||||||
|
jne isstr
|
||||||
|
mov al,8
|
||||||
|
call getlength0
|
||||||
|
dec cl
|
||||||
|
mov ah,cl
|
||||||
|
jmp endofwhat
|
||||||
|
isstr:
|
||||||
|
mov al,07h
|
||||||
|
call getlength0
|
||||||
|
mov ah,cl
|
||||||
|
endofwhat:
|
||||||
|
pop edx cx bx
|
||||||
|
ret
|
||||||
|
|
||||||
|
Lastnumber dd 0
|
||||||
|
|
||||||
|
;Renvoie non carry si la str ds:si point‚e peut ˆtre une adresse
|
||||||
|
str0isadress:
|
||||||
|
;push
|
||||||
|
stc
|
||||||
|
;pop
|
||||||
|
ret
|
||||||
|
|
||||||
|
;Renvoie en es:di le pointeur str0 ds:si
|
||||||
|
Str0toAdress:
|
||||||
|
;push
|
||||||
|
stc
|
||||||
|
;pop
|
||||||
|
ret
|
||||||
|
|
||||||
|
;Renvoie non carry si la str ds:si point‚e peut ˆtre un nom de fichier
|
||||||
|
str0isname:
|
||||||
|
push ax si di
|
||||||
|
isname:
|
||||||
|
mov al,[si]
|
||||||
|
inc si
|
||||||
|
cmp al,0
|
||||||
|
je itsok
|
||||||
|
mov di,offset non
|
||||||
|
verify:
|
||||||
|
mov ah,[di]
|
||||||
|
inc di
|
||||||
|
cmp ah,0FFh
|
||||||
|
je isname
|
||||||
|
cmp ah,al
|
||||||
|
jne verify
|
||||||
|
stc
|
||||||
|
jmp itsdead
|
||||||
|
itsok:
|
||||||
|
clc
|
||||||
|
itsdead:
|
||||||
|
pop di si ax
|
||||||
|
ret
|
||||||
|
|
||||||
|
non db '/<>|"?*:\',01,0FFh
|
||||||
|
|
||||||
|
;Renvoie non carry si le texte point‚ par si est de la base cl
|
||||||
|
str0isbase:
|
||||||
|
push ax cx si di es
|
||||||
|
push cs
|
||||||
|
pop es
|
||||||
|
mov ah,cl
|
||||||
|
isstrbase:
|
||||||
|
mov al,[si]
|
||||||
|
cmp al,0
|
||||||
|
je okbase
|
||||||
|
mov cl,ah
|
||||||
|
xor ch,ch
|
||||||
|
mov di,cx
|
||||||
|
cmp al,es:[di-2+offset basen]
|
||||||
|
je verifbase
|
||||||
|
xor ch,ch
|
||||||
|
inc cl
|
||||||
|
mov di,offset base
|
||||||
|
cld
|
||||||
|
repne scasb
|
||||||
|
cmp cx,0
|
||||||
|
je nobase
|
||||||
|
inc si
|
||||||
|
jmp isstrbase
|
||||||
|
okbase:
|
||||||
|
clc
|
||||||
|
endbase:
|
||||||
|
pop es di si cx ax
|
||||||
|
ret
|
||||||
|
verifbase:
|
||||||
|
cmp byte ptr [si+1],0
|
||||||
|
je okbase
|
||||||
|
nobase:
|
||||||
|
stc
|
||||||
|
jmp endbase
|
||||||
|
|
||||||
|
temp dw 0
|
||||||
|
|
||||||
|
;Converti un str de base cl en int dans edx
|
||||||
|
str0toint:
|
||||||
|
push eax bx ecx si edi ebp es
|
||||||
|
push cs
|
||||||
|
pop es
|
||||||
|
mov ah,cl
|
||||||
|
mov cs:temp,si
|
||||||
|
gotos:
|
||||||
|
cmp byte ptr [si+1], 0
|
||||||
|
je oklo
|
||||||
|
inc si
|
||||||
|
jmp gotos
|
||||||
|
oklo:
|
||||||
|
mov edi,1
|
||||||
|
xor ebp,ebp
|
||||||
|
mov bl,cl
|
||||||
|
baseto:
|
||||||
|
cmp si,cs:temp
|
||||||
|
jb endbaseto
|
||||||
|
mov al,[si]
|
||||||
|
xor ecx,ecx
|
||||||
|
mov cl,bl
|
||||||
|
inc cl
|
||||||
|
push di
|
||||||
|
mov di,offset base
|
||||||
|
cld
|
||||||
|
repne scasb
|
||||||
|
pop di
|
||||||
|
jne noop
|
||||||
|
sub cl,bl
|
||||||
|
neg cl
|
||||||
|
mov eax,edi
|
||||||
|
mul ecx
|
||||||
|
add ebp,eax
|
||||||
|
mov eax,edi
|
||||||
|
mov cl,bl
|
||||||
|
mul ecx
|
||||||
|
mov edi,eax
|
||||||
|
noop:
|
||||||
|
dec si
|
||||||
|
jmp baseto
|
||||||
|
endbaseto:
|
||||||
|
mov edx,ebp
|
||||||
|
pop es ebp edi si ecx bx eax
|
||||||
|
ret
|
||||||
|
base db '0123456789ABCDEF'
|
||||||
|
basen db 'B O D H'
|
||||||
|
basenn db 1,0,0,0,0,0,2,0,3,0,0,0,0,0,4
|
||||||
|
|
||||||
|
;Renvoie en es:di la partie de cx caractŠres a partir de la gauche de ds:si
|
||||||
|
Left0:
|
||||||
|
push ax cx si di
|
||||||
|
cld
|
||||||
|
rep movsb
|
||||||
|
mov al,0
|
||||||
|
stosb
|
||||||
|
pop di si cx ax
|
||||||
|
ret
|
||||||
|
|
||||||
|
;Renvoie en es:di la partie de cx caractŠres a partir de la droite de ds:si
|
||||||
|
Right0:
|
||||||
|
push ax cx dx si di
|
||||||
|
mov dx,cx
|
||||||
|
call getlength0
|
||||||
|
add si,cx
|
||||||
|
sub si,dx
|
||||||
|
mov cx,dx
|
||||||
|
cld
|
||||||
|
rep movsb
|
||||||
|
mov al,0
|
||||||
|
stosb
|
||||||
|
pop di si dx cx ax
|
||||||
|
ret
|
||||||
|
|
||||||
|
;Renvoie en es:di la partie de cx caractŠres a partir de la position bx de ds:si
|
||||||
|
middle0:
|
||||||
|
push ax cx si di
|
||||||
|
add si,bx
|
||||||
|
cld
|
||||||
|
rep movsb
|
||||||
|
mov al,0
|
||||||
|
stosb
|
||||||
|
pop di si cx ax
|
||||||
|
ret
|
||||||
|
|
||||||
|
;Rempli de cx caractŠres dl a partir de la position bx de ds:si
|
||||||
|
Fill0:
|
||||||
|
push ax bx cx si di es
|
||||||
|
push ds
|
||||||
|
pop es
|
||||||
|
add si,bx
|
||||||
|
mov al,dl
|
||||||
|
mov di,si
|
||||||
|
cld
|
||||||
|
rep stosb
|
||||||
|
pop es di si cx bx ax
|
||||||
|
ret
|
||||||
|
|
||||||
|
;Remplace tout les caractŠres al de ds:si par des caractŠres dl
|
||||||
|
ReplaceAllchar0:
|
||||||
|
push ax cx di es
|
||||||
|
call GetLength0
|
||||||
|
push ds
|
||||||
|
pop es
|
||||||
|
mov di,si
|
||||||
|
findandchange:
|
||||||
|
repne scasb
|
||||||
|
cmp cx,0
|
||||||
|
je endofchange
|
||||||
|
mov es:[di-1],dl
|
||||||
|
jmp findandchange
|
||||||
|
endofchange:
|
||||||
|
pop es di cx ax
|
||||||
|
ret
|
||||||
|
|
||||||
|
|
||||||
|
;Recherche un caractŠre dl dans la chaŒne ds:si
|
||||||
|
SearchChar0:
|
||||||
|
push ax cx di es
|
||||||
|
call GetLength0
|
||||||
|
push ds
|
||||||
|
pop es
|
||||||
|
mov di,si
|
||||||
|
mov al,dl
|
||||||
|
repne scasb
|
||||||
|
pop es di cx ax
|
||||||
|
ret
|
||||||
|
|
||||||
|
;Inverse la chaine point‚e en ds:si
|
||||||
|
invert0:
|
||||||
|
push ax cx si di es
|
||||||
|
call GetLength0
|
||||||
|
push ds
|
||||||
|
pop es
|
||||||
|
mov di,si
|
||||||
|
add di,cx
|
||||||
|
dec di
|
||||||
|
revert:
|
||||||
|
mov al,[si]
|
||||||
|
xchg al,es:[di]
|
||||||
|
mov [si],al
|
||||||
|
inc si
|
||||||
|
dec di
|
||||||
|
cmp si,di
|
||||||
|
je finishinvert
|
||||||
|
dec di
|
||||||
|
cmp si,di
|
||||||
|
je finishinvert
|
||||||
|
inc di
|
||||||
|
jmp revert
|
||||||
|
finishinvert:
|
||||||
|
pop es di si cx ax
|
||||||
|
ret
|
||||||
|
|
||||||
|
;Compares 2 chaines de caractŠres DS:SI et ES:DI zerof si non equal
|
||||||
|
cmpstr0:
|
||||||
|
push cx dx si di
|
||||||
|
call GetLength0
|
||||||
|
mov dx,cx
|
||||||
|
push ds si
|
||||||
|
push es
|
||||||
|
pop ds
|
||||||
|
mov si,di
|
||||||
|
call GetLength0
|
||||||
|
pop si ds
|
||||||
|
cmp cx,dx
|
||||||
|
jne NotEqual
|
||||||
|
repe cmpsb
|
||||||
|
NotEqual:
|
||||||
|
pop di si dx cx
|
||||||
|
ret
|
||||||
|
|
||||||
|
;Compares 2 chaines de caractŠres DS:SI et ES:DI zerof si non equal et renvoie le nb de caractŠre egaux dans dx
|
||||||
|
evalue0:
|
||||||
|
push cx si di
|
||||||
|
push ds si
|
||||||
|
push es
|
||||||
|
pop ds
|
||||||
|
mov si,di
|
||||||
|
call GetLength0
|
||||||
|
pop si ds
|
||||||
|
mov dx,cx
|
||||||
|
repe cmpsb
|
||||||
|
pushf
|
||||||
|
sub dx,cx
|
||||||
|
popf
|
||||||
|
pop di si cx
|
||||||
|
ret
|
||||||
|
|
||||||
|
|
||||||
|
;Insert une chaine ds:si en es:di a partir du caractŠre cx
|
||||||
|
insert0:
|
||||||
|
push cx di si
|
||||||
|
add di,cx
|
||||||
|
call getlength0
|
||||||
|
push si di ds
|
||||||
|
push es
|
||||||
|
pop ds
|
||||||
|
mov si,di
|
||||||
|
add di,cx
|
||||||
|
call copy20
|
||||||
|
pop ds di si
|
||||||
|
cld
|
||||||
|
inc di
|
||||||
|
rep movsb
|
||||||
|
pop si di cx
|
||||||
|
ret
|
||||||
|
|
||||||
|
;Detruit CX caractŠres a partir du caractŠre BX de DS:SI
|
||||||
|
delete0:
|
||||||
|
push cx dx si di es
|
||||||
|
push ds
|
||||||
|
pop es
|
||||||
|
mov dx,cx
|
||||||
|
call getlength0
|
||||||
|
sub cx,dx
|
||||||
|
sub cx,bx
|
||||||
|
inc cx
|
||||||
|
add si,bx
|
||||||
|
mov di,si
|
||||||
|
add si,dx
|
||||||
|
cld
|
||||||
|
rep movsb
|
||||||
|
pop es di si dx cx
|
||||||
|
ret
|
||||||
|
|
||||||
|
;Copie une chaine de ds:si en es:di
|
||||||
|
Copy0:
|
||||||
|
push ax cx si di
|
||||||
|
call GetLength0
|
||||||
|
cld
|
||||||
|
rep movsb
|
||||||
|
mov al,0
|
||||||
|
stosb
|
||||||
|
pop di si cx ax
|
||||||
|
ret
|
||||||
|
|
||||||
|
;Copie une chaine de ds:si en es:di
|
||||||
|
Copy20:
|
||||||
|
push ax cx si di
|
||||||
|
call GetLength0
|
||||||
|
cld
|
||||||
|
add si,cx
|
||||||
|
add di,cx
|
||||||
|
inc cx
|
||||||
|
std
|
||||||
|
rep movsb
|
||||||
|
pop di si cx ax
|
||||||
|
ret
|
||||||
|
|
||||||
|
;ConcatŠne le chaine ds:si avec es:di
|
||||||
|
Concat0:
|
||||||
|
push ax cx dx si di
|
||||||
|
call GetLength0
|
||||||
|
mov dx,cx
|
||||||
|
xchg si,di
|
||||||
|
push ds
|
||||||
|
push es
|
||||||
|
pop ds
|
||||||
|
call GetLength0
|
||||||
|
pop ds
|
||||||
|
xchg si,di
|
||||||
|
add di,cx
|
||||||
|
mov cx,dx
|
||||||
|
cld
|
||||||
|
rep movsb
|
||||||
|
mov al,0
|
||||||
|
stosb
|
||||||
|
pop di si dx cx ax
|
||||||
|
ret
|
||||||
|
|
||||||
|
;Met DL comme d‚limiteur par d‚faut
|
||||||
|
SetDelimiter0:
|
||||||
|
mov cs:delim,dl
|
||||||
|
ret
|
||||||
|
|
||||||
|
;Renvoie le d‚limiteur par d‚faut dans dl
|
||||||
|
GetDelimiter0:
|
||||||
|
mov dl,cs:delim
|
||||||
|
ret
|
||||||
|
delim db 0
|
||||||
|
|
||||||
|
;D‚truit les d‚limiteur qui sont cons‚cutifs dans ds:si
|
||||||
|
CompressDelimiter0:
|
||||||
|
push ax dx si di es
|
||||||
|
call Getlength0
|
||||||
|
push ds
|
||||||
|
pop es
|
||||||
|
mov di,si
|
||||||
|
mov al,cs:delim
|
||||||
|
xor dx,dx
|
||||||
|
Compressitems:
|
||||||
|
repne scasb
|
||||||
|
inc dx
|
||||||
|
againcomp:
|
||||||
|
cmp [di],al
|
||||||
|
jne nosup
|
||||||
|
mov si,di
|
||||||
|
mov bx,0
|
||||||
|
push cx
|
||||||
|
mov cx,1
|
||||||
|
call delete0
|
||||||
|
pop cx
|
||||||
|
jmp againcomp
|
||||||
|
nosup:
|
||||||
|
cmp cx,0
|
||||||
|
jne compressitems
|
||||||
|
mov cx,dx
|
||||||
|
pop es di si dx ax
|
||||||
|
ret
|
||||||
|
|
||||||
|
;Met le nombre d'‚l‚ments … cx
|
||||||
|
Setnbitems0:
|
||||||
|
push ax cx dx di es
|
||||||
|
mov dx,cx
|
||||||
|
call Getnbitems0
|
||||||
|
cmp cx,dx
|
||||||
|
je noadjust
|
||||||
|
ja subsome
|
||||||
|
push ds
|
||||||
|
pop es
|
||||||
|
mov di,si
|
||||||
|
sub cx,dx
|
||||||
|
neg cx
|
||||||
|
push cx
|
||||||
|
call getlength0
|
||||||
|
add di,cx
|
||||||
|
pop cx
|
||||||
|
mov al,cs:delim
|
||||||
|
mov ah,'a'
|
||||||
|
rep stosw
|
||||||
|
mov al,0
|
||||||
|
stosb
|
||||||
|
jmp noadjust
|
||||||
|
subsome:
|
||||||
|
mov cx,dx
|
||||||
|
call GetPointeritem0
|
||||||
|
dec di
|
||||||
|
mov byte ptr [di],0
|
||||||
|
noadjust:
|
||||||
|
pop es di dx cx
|
||||||
|
ret
|
||||||
|
|
||||||
|
;Renvoie la taille dx de l'‚l‚ment cx
|
||||||
|
Getitemsize:
|
||||||
|
push cx di
|
||||||
|
call getpointeritem0
|
||||||
|
mov dx,di
|
||||||
|
inc cx
|
||||||
|
call getpointeritem0
|
||||||
|
sub dx,di
|
||||||
|
neg dx
|
||||||
|
dec dx
|
||||||
|
pop di cx
|
||||||
|
ret
|
||||||
|
|
||||||
|
;Renvoie en es:di l'‚l‚ment cx de ds:si
|
||||||
|
Getitem0:
|
||||||
|
push si di cx ax
|
||||||
|
push di
|
||||||
|
call getPointeritem0
|
||||||
|
call getitemsize
|
||||||
|
mov si,di
|
||||||
|
pop di
|
||||||
|
mov cx,dx
|
||||||
|
rep movsb
|
||||||
|
mov al,0
|
||||||
|
stosb
|
||||||
|
pop ax cx di si
|
||||||
|
ret
|
||||||
|
|
||||||
|
;renvoi un pointeur di sur l'‚l‚ment cx de ds:si
|
||||||
|
GetPointeritem0:
|
||||||
|
push ax bx cx dx es
|
||||||
|
mov bx,cx
|
||||||
|
call Getlength0
|
||||||
|
push ds
|
||||||
|
pop es
|
||||||
|
mov di,si
|
||||||
|
mov al,cs:delim
|
||||||
|
xor dx,dx
|
||||||
|
Countnbitems:
|
||||||
|
cmp bx,dx
|
||||||
|
je finishpointer
|
||||||
|
repne scasb
|
||||||
|
inc dx
|
||||||
|
cmp cx,0
|
||||||
|
jne countnbitems
|
||||||
|
inc di
|
||||||
|
finishpointer:
|
||||||
|
pop es dx cx bx ax
|
||||||
|
ret
|
||||||
|
|
||||||
|
;Renvoie le nombre d'‚l‚ments cx de ds:si
|
||||||
|
GetNbitems0:
|
||||||
|
push ax dx di es
|
||||||
|
call Getlength0
|
||||||
|
push ds
|
||||||
|
pop es
|
||||||
|
mov di,si
|
||||||
|
mov al,cs:delim
|
||||||
|
xor dx,dx
|
||||||
|
Countitems:
|
||||||
|
repne scasb
|
||||||
|
inc dx
|
||||||
|
cmp cx,0
|
||||||
|
jne countitems
|
||||||
|
mov cx,dx
|
||||||
|
pop es di dx ax
|
||||||
|
ret
|
||||||
|
|
||||||
|
;renvoie la taille en octets CX de la chaine point‚e en ds:si
|
||||||
|
GetLength0:
|
||||||
|
push ax di es
|
||||||
|
push ds
|
||||||
|
pop es
|
||||||
|
mov di,si
|
||||||
|
mov al,0
|
||||||
|
mov cx,0FFFFh
|
||||||
|
cld
|
||||||
|
repne scasb
|
||||||
|
neg cx
|
||||||
|
dec cx
|
||||||
|
dec cx
|
||||||
|
pop es di ax
|
||||||
|
ret
|
||||||
|
|
||||||
|
;Met la taille en octets de la chaine point‚e ds:si a CX
|
||||||
|
SetLength0:
|
||||||
|
push bx
|
||||||
|
mov bx,cx
|
||||||
|
mov byte ptr [si+bx],0
|
||||||
|
pop bx
|
||||||
|
ret
|
||||||
|
|
||||||
|
;met en majuscule la chaine ds:si
|
||||||
|
UpperCase0:
|
||||||
|
push si ax
|
||||||
|
UpperCase:
|
||||||
|
mov al,ds:[si]
|
||||||
|
inc si
|
||||||
|
cmp al,0
|
||||||
|
je EndUpperCase
|
||||||
|
cmp al,'a'
|
||||||
|
jb UpperCase
|
||||||
|
cmp al,'z'
|
||||||
|
ja UpperCase
|
||||||
|
sub byte ptr [si-1],'a'-'A'
|
||||||
|
jmp UpperCase
|
||||||
|
EndUpperCase:
|
||||||
|
clc
|
||||||
|
pop ax si
|
||||||
|
ret
|
||||||
|
|
||||||
|
;met en majuscule la premiŠre lettre chaine ds:si
|
||||||
|
OneCase0:
|
||||||
|
push ax
|
||||||
|
OneUpperCase:
|
||||||
|
mov al,ds:[si]
|
||||||
|
cmp al,'a'
|
||||||
|
jb OneEndUpperCase
|
||||||
|
cmp al,'z'
|
||||||
|
ja OneEndUpperCase
|
||||||
|
sub byte ptr [si],'a'-'A'
|
||||||
|
OneEndUpperCase:
|
||||||
|
clc
|
||||||
|
pop ax
|
||||||
|
ret
|
||||||
|
|
||||||
|
;met en minuscule la chaine ds:si
|
||||||
|
LowerCase0:
|
||||||
|
push si ax
|
||||||
|
LowerCase:
|
||||||
|
mov al,ds:[si]
|
||||||
|
inc si
|
||||||
|
cmp al,0
|
||||||
|
je EndLowerCase
|
||||||
|
cmp al,'A'
|
||||||
|
jb LowerCase
|
||||||
|
cmp al,'Z'
|
||||||
|
ja LowerCase
|
||||||
|
add byte ptr [si-1],'a'-'A'
|
||||||
|
jmp LowerCase
|
||||||
|
EndLowerCase:
|
||||||
|
clc
|
||||||
|
pop ax si
|
||||||
|
ret
|
||||||
|
|
||||||
|
;Inverse la casse la chaine ds:si
|
||||||
|
InvertCase0:
|
||||||
|
push si ax
|
||||||
|
InvertCase:
|
||||||
|
mov al,ds:[si]
|
||||||
|
inc si
|
||||||
|
cmp al,0
|
||||||
|
je EndInvertCase
|
||||||
|
cmp al,'A'
|
||||||
|
jb InvertCase
|
||||||
|
cmp al,'Z'
|
||||||
|
jbe GoInvertCase
|
||||||
|
cmp al,'a'
|
||||||
|
jb InvertCase
|
||||||
|
cmp al,'z'
|
||||||
|
ja InvertCase
|
||||||
|
sub byte ptr [si-1],'a'-'A'
|
||||||
|
jmp InvertCase
|
||||||
|
GoInvertCase:
|
||||||
|
add byte ptr [si-1],'a'-'A'
|
||||||
|
jmp InvertCase
|
||||||
|
EndInvertCase:
|
||||||
|
clc
|
||||||
|
pop ax si
|
||||||
|
ret
|
||||||
|
|
||||||
|
end start
|
204
noyau/mcb.asm
204
noyau/mcb.asm
|
@ -1,4 +1,52 @@
|
||||||
|
|
||||||
|
db "biosprint",0
|
||||||
|
dw biosprint
|
||||||
|
db "mbinit",0
|
||||||
|
dw mbinit
|
||||||
|
db "mbcreate",0
|
||||||
|
dw mbcreate
|
||||||
|
db "mbfree",0
|
||||||
|
dw mbfree
|
||||||
|
db "mbclean",0
|
||||||
|
dw mbclean
|
||||||
|
db "mbresident",0
|
||||||
|
dw mbresident
|
||||||
|
db "mbnonresident",0
|
||||||
|
dw mbnonresident
|
||||||
|
db "mbchown",0
|
||||||
|
dw mbchown
|
||||||
|
db "mballoc",0
|
||||||
|
dw mballoc
|
||||||
|
db "mbfind",0
|
||||||
|
dw mbfind
|
||||||
|
db "mbfindsb",0
|
||||||
|
dw mbfindsb
|
||||||
|
db "mbget",0
|
||||||
|
dw mbget
|
||||||
|
db "mbloadfuncs",0
|
||||||
|
dw mbloadfuncs
|
||||||
|
db "mbsearchfunc",0
|
||||||
|
dw mbsearchfunc
|
||||||
|
db "bioswaitkey",0
|
||||||
|
dw bioswaitkey
|
||||||
|
db "mbloadsection",0
|
||||||
|
dw mbloadsection
|
||||||
|
db "enableirq",0
|
||||||
|
dw enableirq
|
||||||
|
db "disableirq",0
|
||||||
|
dw enableirq
|
||||||
|
db "readmaskirq",0
|
||||||
|
dw readmaskirq
|
||||||
|
db "readirr",0
|
||||||
|
dw readirr
|
||||||
|
db "readisr",0
|
||||||
|
dw readisr
|
||||||
|
db "seteoi",0
|
||||||
|
dw seteoi
|
||||||
|
dd 0
|
||||||
|
|
||||||
|
include "8259a.asm"
|
||||||
|
|
||||||
;Affiche le nombre hexa dans %0[dword]
|
;Affiche le nombre hexa dans %0[dword]
|
||||||
PROC biosprinth FAR
|
PROC biosprinth FAR
|
||||||
ARG @num:dword
|
ARG @num:dword
|
||||||
|
@ -49,85 +97,34 @@ PROC biosprint FAR
|
||||||
ret
|
ret
|
||||||
endp biosprint
|
endp biosprint
|
||||||
|
|
||||||
PROC enablea20 FAR
|
;PROC flatmode FAR
|
||||||
USES ax
|
; USES eax,bx,edx
|
||||||
mov al,0d1h
|
; ; first, calculate the linear address of GDT
|
||||||
out 64h,al
|
; xor edx,edx
|
||||||
call a20wait
|
; xor eax,eax
|
||||||
mov al,0dfh
|
; mov dx,cs
|
||||||
out 60h,al
|
; shl edx,4
|
||||||
call a20wait
|
; add [dword ptr cs:offset @@gdt+2],edx ; store as GDT linear base addr
|
||||||
;mov al,0ffh
|
; ; now load the GDT into the GDTR
|
||||||
;out 64h,al
|
; lgdt [fword ptr cs:offset @@gdt] ; load GDT base (286-style 24-bit load)
|
||||||
;call a20wait
|
; mov bx,1 * size descriptor ; point to first descriptor
|
||||||
ret
|
; mov eax,cr0 ; prepare to enter protected mode
|
||||||
endp enablea20
|
; or al,1 ; flip the PE bit
|
||||||
|
; cli ; turn off interrupts
|
||||||
PROC disablea20 FAR
|
; mov cr0,eax ; we're now in protected mode
|
||||||
USES ax
|
; mov fs,bx ; load the FS segment register
|
||||||
mov al,0d1h
|
; and al,0FEh ; clear the PE bit again
|
||||||
out 64h,al
|
; mov cr0,eax ; back to real mode
|
||||||
call a20wait
|
; sti ; resume handling interrupts
|
||||||
mov al,0DDh
|
; ret ;
|
||||||
out 60h,al
|
|
||||||
call a20wait
|
|
||||||
;mov al,0ffh
|
|
||||||
;out 64h,al
|
|
||||||
;call a20wait
|
|
||||||
ret
|
|
||||||
endp disablea20
|
|
||||||
|
|
||||||
a20wait:
|
|
||||||
in al,64h
|
|
||||||
jmp @@suite
|
|
||||||
@@suite:
|
|
||||||
and al,2
|
|
||||||
jnz a20wait
|
|
||||||
ret
|
|
||||||
;par le system control port A
|
|
||||||
;in al,92h
|
|
||||||
;or al,2
|
|
||||||
;out 92h,al
|
|
||||||
|
|
||||||
;par le system control port A
|
|
||||||
;in al,92h
|
|
||||||
;and al,not 2
|
|
||||||
;out 92h,al
|
|
||||||
|
|
||||||
PROC flatmode FAR
|
|
||||||
USES eax,bx,ds
|
|
||||||
push cs
|
|
||||||
pop ds
|
|
||||||
; first, calculate the linear address of GDT
|
|
||||||
xor eax,eax
|
|
||||||
mov ax,ds
|
|
||||||
shl eax,4
|
|
||||||
add [dword ptr offset @@gdt+2],eax ; store as GDT linear base addr
|
|
||||||
; now load the GDT into the GDTR
|
|
||||||
lgdt [fword ptr offset @@gdt] ; load GDT base
|
|
||||||
mov bx,1 * size descriptor ; point to first descriptor
|
|
||||||
cli ; turn off interrupts
|
|
||||||
mov eax,cr0 ; prepare to enter protected mode
|
|
||||||
or al,1 ; flip the PE bit
|
|
||||||
mov cr0,eax ; we're now in protected mode
|
|
||||||
jmp @@suite
|
|
||||||
@@suite:
|
|
||||||
mov fs,bx ; load the FS segment register
|
|
||||||
and al,0FEh ; clear the PE bit again
|
|
||||||
mov cr0,eax ; back to real mode
|
|
||||||
jmp @@suite2
|
|
||||||
@@suite2:
|
|
||||||
sti ; resume handling interrupts
|
|
||||||
ret ;
|
|
||||||
|
|
||||||
@@gdt descriptor <offset @@gdtend - offset @@gdt - 1, offset @@gdt, 0, 0, 0, 0> ; the GDT itself
|
;@@gdt descriptor <@@gdtend - @@gdt - 1, @@gdt, 0, 0, 0, 0> ; the GDT itself
|
||||||
descriptor <0ffffh, 0, 0, 091h, 0cfh, 0> ; 4G data segment
|
; descriptor <0ffffh, 0, 0, 091h, 0cfh, 0> ; 4G data segment
|
||||||
@@gdtend:
|
;@@gdtend:
|
||||||
endp flatmode
|
;endp flatmode
|
||||||
|
|
||||||
;Attend l'appuie sur une touche
|
;Attend l'appuie sur une touche
|
||||||
PROC bioswaitkey FAR
|
PROC bioswaitkey FAR
|
||||||
USES ax
|
|
||||||
xor ax,ax
|
xor ax,ax
|
||||||
int 16h
|
int 16h
|
||||||
ret
|
ret
|
||||||
|
@ -142,6 +139,8 @@ PROC mbloadsection FAR
|
||||||
USES ax,bx,cx,si,di,ds,es
|
USES ax,bx,cx,si,di,ds,es
|
||||||
LOCAL @@toresov:word:60
|
LOCAL @@toresov:word:60
|
||||||
mov ax,[@blocks]
|
mov ax,[@blocks]
|
||||||
|
inc ax
|
||||||
|
inc ax
|
||||||
mov es,ax
|
mov es,ax
|
||||||
mov ds,ax
|
mov ds,ax
|
||||||
cmp [word ptr 0],"EC"
|
cmp [word ptr 0],"EC"
|
||||||
|
@ -149,16 +148,11 @@ PROC mbloadsection FAR
|
||||||
lea si,[@@toresov]
|
lea si,[@@toresov]
|
||||||
mov [word ptr ss:si],0FFFFh
|
mov [word ptr ss:si],0FFFFh
|
||||||
mov bx,[ds:exe.sections]
|
mov bx,[ds:exe.sections]
|
||||||
cmp bx,0
|
|
||||||
je @@finishloading
|
|
||||||
@@loading:
|
@@loading:
|
||||||
cmp [dword ptr bx],0
|
cmp [dword ptr bx],0
|
||||||
je @@finishloading
|
je @@finishloading
|
||||||
mov ax,bx
|
mov ax,bx
|
||||||
add ax,4
|
add ax,4
|
||||||
pushad
|
|
||||||
call biosprint,ax
|
|
||||||
popad
|
|
||||||
call mbcreate,ax,[word ptr bx+2]
|
call mbcreate,ax,[word ptr bx+2]
|
||||||
jc @@error
|
jc @@error
|
||||||
inc si
|
inc si
|
||||||
|
@ -180,6 +174,11 @@ popad
|
||||||
inc bx
|
inc bx
|
||||||
jmp @@loading
|
jmp @@loading
|
||||||
@@finishloading:
|
@@finishloading:
|
||||||
|
pushad
|
||||||
|
xor eax,eax
|
||||||
|
mov ax,[word ptr ss:si]
|
||||||
|
call biosprinth,eax
|
||||||
|
popad
|
||||||
cmp [word ptr ss:si],0FFFFh
|
cmp [word ptr ss:si],0FFFFh
|
||||||
je @@finishdepands
|
je @@finishdepands
|
||||||
call mbloadfuncs,[word ptr ss:si]
|
call mbloadfuncs,[word ptr ss:si]
|
||||||
|
@ -230,16 +229,7 @@ PROC mbcreate FAR
|
||||||
ARG @blocks:word,@size:word
|
ARG @blocks:word,@size:word
|
||||||
USES bx,cx,dx,si,di,ds,es
|
USES bx,cx,dx,si,di,ds,es
|
||||||
push gs
|
push gs
|
||||||
mov ax,[ss:bp+4]
|
mov gs,[ss:bp+4]
|
||||||
mov dx,ax
|
|
||||||
dec dx
|
|
||||||
dec dx
|
|
||||||
mov gs,dx
|
|
||||||
cmp [word ptr gs:0x0],'NH'
|
|
||||||
je @@oktoset
|
|
||||||
mov ax,memorystart
|
|
||||||
@@oktoset:
|
|
||||||
mov gs,ax
|
|
||||||
mov cx,[@size]
|
mov cx,[@size]
|
||||||
shr cx,4
|
shr cx,4
|
||||||
inc cx
|
inc cx
|
||||||
|
@ -254,19 +244,21 @@ PROC mbcreate FAR
|
||||||
cmp [word ptr es:mb.check],"NH"
|
cmp [word ptr es:mb.check],"NH"
|
||||||
jne @@memoryerror
|
jne @@memoryerror
|
||||||
cmp [es:mb.isnotlast],true
|
cmp [es:mb.isnotlast],true
|
||||||
sete dl
|
sete dl
|
||||||
cmp [es:mb.reference],free
|
cmp [es:mb.reference],free
|
||||||
jne @@notsogood
|
jne @@notsogood
|
||||||
mov ax,[es:mb.sizes]
|
mov ax,[es:mb.sizes]
|
||||||
cmp cx,ax
|
cmp cx,ax
|
||||||
ja @@notsogood
|
ja @@notsogood
|
||||||
mov [word ptr es:mb.check],"NH"
|
;mov [word ptr es:mb.check],"NH"
|
||||||
mov [es:mb.isnotlast],true
|
mov [es:mb.isnotlast],true
|
||||||
mov [es:mb.reference],gs
|
mov [es:mb.reference],gs
|
||||||
mov [es:mb.isresident],false
|
mov [es:mb.isresident],false
|
||||||
lea di,[es:mb.names]
|
lea di,[es:mb.names]
|
||||||
push cx
|
push cx
|
||||||
mov cx,24/4
|
mov cx,24/4
|
||||||
|
push cs
|
||||||
|
pop ds
|
||||||
mov si,[@blocks]
|
mov si,[@blocks]
|
||||||
cld
|
cld
|
||||||
rep movsd
|
rep movsd
|
||||||
|
@ -284,16 +276,14 @@ PROC mbcreate FAR
|
||||||
mov si,offset afree
|
mov si,offset afree
|
||||||
xor di,di
|
xor di,di
|
||||||
mov cx,size mb
|
mov cx,size mb
|
||||||
push cs
|
|
||||||
pop ds
|
|
||||||
cld
|
cld
|
||||||
rep movsb
|
rep movsb
|
||||||
mov [es:mb.isnotlast],dl
|
mov [es:mb.isnotlast],dl
|
||||||
mov [es:mb.sizes],ax
|
mov [es:mb.sizes],ax
|
||||||
@@nofree:
|
@@nofree:
|
||||||
mov ax,bx
|
mov ax,bx
|
||||||
pop gs
|
|
||||||
clc
|
clc
|
||||||
|
pop gs
|
||||||
ret
|
ret
|
||||||
@@notsogood:
|
@@notsogood:
|
||||||
inc bx
|
inc bx
|
||||||
|
@ -301,8 +291,8 @@ PROC mbcreate FAR
|
||||||
add bx,[es:mb.sizes]
|
add bx,[es:mb.sizes]
|
||||||
jmp @@searchfree
|
jmp @@searchfree
|
||||||
@@memoryerror:
|
@@memoryerror:
|
||||||
pop gs
|
|
||||||
stc
|
stc
|
||||||
|
pop gs
|
||||||
ret
|
ret
|
||||||
@@notenougtmem:
|
@@notenougtmem:
|
||||||
pop gs
|
pop gs
|
||||||
|
@ -349,8 +339,6 @@ PROC mbfree FAR
|
||||||
jne @@nottofree
|
jne @@nottofree
|
||||||
mov [es:mb.isresident],false
|
mov [es:mb.isresident],false
|
||||||
mov [es:mb.reference],free
|
mov [es:mb.reference],free
|
||||||
mov si,offset @@isfree
|
|
||||||
lea di,[es:mb.names]
|
|
||||||
mov cx,6
|
mov cx,6
|
||||||
cld
|
cld
|
||||||
rep movsb
|
rep movsb
|
||||||
|
@ -489,7 +477,7 @@ endp mbchown
|
||||||
;Alloue un bloc /data de CX caractere pour le process appelant -> ax
|
;Alloue un bloc /data de CX caractere pour le process appelant -> ax
|
||||||
PROC mballoc FAR
|
PROC mballoc FAR
|
||||||
ARG @size:word
|
ARG @size:word
|
||||||
USES si,ds
|
USES ax,si,ds
|
||||||
push cs
|
push cs
|
||||||
pop ds
|
pop ds
|
||||||
call mbcreate,offset @@data,[@size]
|
call mbcreate,offset @@data,[@size]
|
||||||
|
@ -544,9 +532,9 @@ PROC mbfind FAR
|
||||||
dec bx
|
dec bx
|
||||||
dec bx
|
dec bx
|
||||||
mov si,[@blocks]
|
mov si,[@blocks]
|
||||||
|
lea di,[es:mb.names]
|
||||||
@@search:
|
@@search:
|
||||||
mov es,bx
|
mov es,bx
|
||||||
lea di,[es:mb.names]
|
|
||||||
cmp [word ptr es:mb.check],"NH"
|
cmp [word ptr es:mb.check],"NH"
|
||||||
jne @@memoryerror
|
jne @@memoryerror
|
||||||
inc bx
|
inc bx
|
||||||
|
@ -651,20 +639,14 @@ PROC mbloadfuncs FAR
|
||||||
call mbsearchfunc,si
|
call mbsearchfunc,si
|
||||||
jnc @@toendoftext
|
jnc @@toendoftext
|
||||||
mov bx,si
|
mov bx,si
|
||||||
;pushad
|
|
||||||
;call biosprint,si
|
|
||||||
;popad
|
|
||||||
@@findend:
|
@@findend:
|
||||||
inc bx
|
inc bx
|
||||||
cmp [byte ptr bx], ':'
|
cmp [byte ptr bx], ':'
|
||||||
jne @@findend
|
jne @@findend
|
||||||
mov [byte ptr bx],0
|
mov [byte ptr bx],0
|
||||||
call [cs:projfile],si
|
;call projectfile,bx
|
||||||
mov [byte ptr bx],':'
|
|
||||||
jc @@erroronload
|
jc @@erroronload
|
||||||
;pushad
|
mov [byte ptr bx],':'
|
||||||
;call biosprint,si
|
|
||||||
;popad
|
|
||||||
call mbsearchfunc,si
|
call mbsearchfunc,si
|
||||||
jc @@libnotexist
|
jc @@libnotexist
|
||||||
@@toendoftext:
|
@@toendoftext:
|
||||||
|
@ -694,18 +676,18 @@ PROC mbloadfuncs FAR
|
||||||
endp mbloadfuncs
|
endp mbloadfuncs
|
||||||
|
|
||||||
|
|
||||||
;Recherche une fonction pointé par DS:%0 en mémoire et renvoie son adresse en DX:AX
|
;Recherche une fonction pointé par DS:SI en mémoire et renvoie son adresse en DX:AX
|
||||||
PROC mbsearchfunc FAR
|
PROC mbsearchfunc FAR
|
||||||
ARG @func:word
|
ARG @func:word
|
||||||
USES bx,si,di,es
|
USES bx,si,di,es
|
||||||
mov bx,[@func]
|
mov bx,[@func]
|
||||||
mov si,bx
|
push bx
|
||||||
@@findend:
|
@@findend:
|
||||||
inc bx
|
inc bx
|
||||||
cmp [byte ptr bx], ':'
|
cmp [byte ptr bx], ':'
|
||||||
jne @@findend
|
jne @@findend
|
||||||
mov [byte ptr bx],0
|
mov [byte ptr bx],0
|
||||||
call mbfind,si
|
call mbfind
|
||||||
mov [byte ptr bx],':'
|
mov [byte ptr bx],':'
|
||||||
jc @@notfoundattallthesb
|
jc @@notfoundattallthesb
|
||||||
mov es,ax
|
mov es,ax
|
||||||
|
|
|
@ -9,9 +9,6 @@ include "..\include\mem.h"
|
||||||
include "..\include\divers.h"
|
include "..\include\divers.h"
|
||||||
include "..\include\cpu.h"
|
include "..\include\cpu.h"
|
||||||
include "..\include\pci.h"
|
include "..\include\pci.h"
|
||||||
include "..\include\fat.h"
|
|
||||||
|
|
||||||
memorystart equ 0052h ;premier bloc de la mémoire
|
|
||||||
|
|
||||||
org 0h
|
org 0h
|
||||||
|
|
||||||
|
@ -36,6 +33,8 @@ start:
|
||||||
call biosprint,offset msg_ok
|
call biosprint,offset msg_ok
|
||||||
call biosprint,offset msg_memory_section
|
call biosprint,offset msg_memory_section
|
||||||
mov ax,cs
|
mov ax,cs
|
||||||
|
dec ax
|
||||||
|
dec ax
|
||||||
call mbloadsection,ax
|
call mbloadsection,ax
|
||||||
jc error
|
jc error
|
||||||
call biosprint,offset msg_ok
|
call biosprint,offset msg_ok
|
||||||
|
@ -55,26 +54,23 @@ suite:
|
||||||
pop gs
|
pop gs
|
||||||
call biosprint,offset msg_ok
|
call biosprint,offset msg_ok
|
||||||
call biosprint,offset msg_video_init
|
call biosprint,offset msg_video_init
|
||||||
call [cs:setvideomode],2
|
call [setvideomode],2
|
||||||
jc error
|
jc error
|
||||||
call [cs:clearscreen]
|
call [clearscreen]
|
||||||
call [cs:print],offset msg_memory
|
call [print],offset msg_memory
|
||||||
call [cs:print],offset msg_ok2
|
call [print],offset msg_ok2
|
||||||
call [cs:print],offset msg_memory_init
|
call [print],offset msg_memory_init
|
||||||
call [cs:print],offset msg_ok2
|
call [print],offset msg_ok2
|
||||||
call [cs:print],offset msg_memory_section
|
call [print],offset msg_memory_section
|
||||||
call [cs:print],offset msg_ok2
|
call [print],offset msg_ok2
|
||||||
call [cs:print],offset msg_memory_jumps
|
call [print],offset msg_memory_jumps
|
||||||
call [cs:print],offset msg_ok2
|
call [print],offset msg_ok2
|
||||||
call [cs:print],offset msg_video_init
|
call [print],offset msg_video_init
|
||||||
call [cs:print],offset msg_ok2
|
call [print],offset msg_ok2
|
||||||
call [cs:print],offset msg_handler
|
call [print],offset msg_cpu_detect
|
||||||
;call installirqhandler
|
call [cpuinfo],offset thecpu
|
||||||
call [cs:print],offset msg_ok2
|
call [setinfo],offset thecpu,offset temp
|
||||||
call [cs:print],offset msg_cpu_detect
|
call [print],offset msg_ok2
|
||||||
call [cs:cpuinfo],offset thecpu
|
|
||||||
call [cs:setinfo],offset thecpu,offset temp
|
|
||||||
call [cs:print],offset msg_ok2
|
|
||||||
push offset temp
|
push offset temp
|
||||||
xor eax,eax
|
xor eax,eax
|
||||||
mov al,[thecpu.family]
|
mov al,[thecpu.family]
|
||||||
|
@ -85,11 +81,11 @@ suite:
|
||||||
push eax
|
push eax
|
||||||
push offset thecpu.names
|
push offset thecpu.names
|
||||||
push offset thecpu.vendor
|
push offset thecpu.vendor
|
||||||
call [cs:print],offset msg_cpu_detect_inf
|
call [print],offset msg_cpu_detect_inf
|
||||||
call [cs:print],offset msg_pci
|
call [print],offset msg_pci
|
||||||
call [cs:pciinfo],offset thepci
|
call [pciinfo],offset thepci
|
||||||
jc nopci
|
jc nopci
|
||||||
call [cs:print],offset msg_ok2
|
call [print],offset msg_ok2
|
||||||
xor eax,eax
|
xor eax,eax
|
||||||
mov al,[thepci.maxbus]
|
mov al,[thepci.maxbus]
|
||||||
push eax
|
push eax
|
||||||
|
@ -97,25 +93,25 @@ suite:
|
||||||
push eax
|
push eax
|
||||||
mov al,[thepci.version_major]
|
mov al,[thepci.version_major]
|
||||||
push eax
|
push eax
|
||||||
call [cs:print],offset msg_pci_info
|
call [print],offset msg_pci_info
|
||||||
call [cs:print],offset msg_pci_enum
|
call [print],offset msg_pci_enum
|
||||||
xor ebx,ebx
|
xor ebx,ebx
|
||||||
xor ecx,ecx
|
xor ecx,ecx
|
||||||
xor si,si
|
xor esi,esi
|
||||||
searchpci:
|
searchpci:
|
||||||
call [cs:getcardinfo],bx,cx,si,offset temp
|
call [getcardinfo],bx,cx,si,offset temp
|
||||||
jc stopthis
|
jc stopthis
|
||||||
mov al,[(pcidata offset temp).subclass]
|
mov al,[(pcidata offset temp).subclass]
|
||||||
push ax
|
push ax
|
||||||
mov al,[(pcidata offset temp).class]
|
mov al,[(pcidata offset temp).class]
|
||||||
push ax
|
push ax
|
||||||
call [cs:getpcisubclass]
|
call [getpcisubclass]
|
||||||
push dx
|
push dx
|
||||||
push ax
|
push ax
|
||||||
mov al,[(pcidata offset temp).class]
|
mov al,[(pcidata offset temp).class]
|
||||||
xor ah,ah
|
xor ah,ah
|
||||||
push ax
|
push ax
|
||||||
call [cs:getpciclass]
|
call [getpciclass]
|
||||||
push dx
|
push dx
|
||||||
push ax
|
push ax
|
||||||
push 4
|
push 4
|
||||||
|
@ -128,7 +124,7 @@ searchpci:
|
||||||
push eax
|
push eax
|
||||||
mov ax,[(pcidata offset temp).vendor]
|
mov ax,[(pcidata offset temp).vendor]
|
||||||
push eax
|
push eax
|
||||||
call [cs:print],offset msg_pci_card
|
call [print],offset msg_pci_card
|
||||||
inc si
|
inc si
|
||||||
cmp si,7
|
cmp si,7
|
||||||
jbe searchpci
|
jbe searchpci
|
||||||
|
@ -143,29 +139,16 @@ stopthis:
|
||||||
jbe searchpci
|
jbe searchpci
|
||||||
jmp next
|
jmp next
|
||||||
nopci:
|
nopci:
|
||||||
call [cs:print],offset msg_echec2
|
call [print],offset msg_echec2
|
||||||
next:
|
next:
|
||||||
;call [cs:detectvmware]
|
call [print],offset msg_fini
|
||||||
;jne novirtual
|
; call [detectvmware]
|
||||||
;call [cs:print],offset msg_vmware
|
; jne novirtual
|
||||||
novirtual:
|
; call [print],offset msg_vmware
|
||||||
;call [cs:print],offset msg_flat
|
;novirtual:
|
||||||
;call enablea20
|
|
||||||
;call flatmode
|
|
||||||
;xor ax,ax
|
|
||||||
;mov fs,ax
|
|
||||||
;mov esi,0100000h
|
|
||||||
;mov [dword ptr fs:esi],"OKIN"
|
|
||||||
call [cs:print],offset msg_ok2
|
|
||||||
call [cs:print],offset msg_disk_init
|
|
||||||
call [cs:initdrive]
|
|
||||||
jc error2
|
|
||||||
call [cs:print],offset msg_ok2
|
|
||||||
call [cs:print],offset msg_launchcommand
|
|
||||||
call [cs:execfile],offset shell
|
|
||||||
jc error2
|
|
||||||
error2:
|
error2:
|
||||||
call [cs:print],offset msg_error2
|
call [print],offset msg_error2
|
||||||
call bioswaitkey
|
call bioswaitkey
|
||||||
jmp far 0FFFFh:0000h
|
jmp far 0FFFFh:0000h
|
||||||
|
|
||||||
|
@ -174,7 +157,7 @@ error:
|
||||||
call bioswaitkey
|
call bioswaitkey
|
||||||
jmp far 0FFFFh:0000h
|
jmp far 0FFFFh:0000h
|
||||||
|
|
||||||
shell find <"COMMANDE.CE",0,0,0,1,>
|
|
||||||
thepci pciinf <>
|
thepci pciinf <>
|
||||||
thecpu cpu <>
|
thecpu cpu <>
|
||||||
temp db 256 dup (0)
|
temp db 256 dup (0)
|
||||||
|
@ -182,83 +165,56 @@ return db 0dh,0ah,0
|
||||||
msg_memory db "Initialisation de la memoire",0
|
msg_memory db "Initialisation de la memoire",0
|
||||||
msg_memory_init db " -Creation du bloc primordial",0
|
msg_memory_init db " -Creation du bloc primordial",0
|
||||||
msg_memory_section db " -Developpement des sections",0
|
msg_memory_section db " -Developpement des sections",0
|
||||||
msg_memory_jumps db "Redirection du systeme",0
|
msg_memory_jumps db " -Redirection du systeme",0
|
||||||
msg_video_init db "Initialisation du pilote VIDEO",0
|
msg_video_init db "Initialisation du pilote VIDEO",0
|
||||||
msg_handler db "Initialisation du gestionnaire d'interruption",0
|
|
||||||
msg_cpu_detect db "Dectection du processeur",0
|
msg_cpu_detect db "Dectection du processeur",0
|
||||||
msg_cpu_detect_inf db " -Fondeur : %0\l -Modele : %0\l -Revision : %u\l -Version : %u\l -Famille : %u\l -Technologies: %0\l",0
|
msg_cpu_detect_inf db " -Fondeur : %0\l -Modele : %0\l -Revision : %u\l -Version : %u\l -Famille : %u\l -Technologies: %0\l",0
|
||||||
msg_pci db "Detection des systemes PCI",0
|
msg_pci db "Detection des systemes PCI",0
|
||||||
msg_pci_info db " -Version : %yB.%yB\l -Numero bus max: %u\l",0
|
msg_pci_info db " -Version : %yB.%yB\l -Nombre de bus : %u\l",0
|
||||||
msg_pci_enum db " -Enumeration des peripheriques PCI:\l"
|
msg_pci_enum db " -Enumeration des peripheriques PCI:\l"
|
||||||
db " | Vendeur | Modele |Bus |Dev.|Func|Classe.Sous-classe\l",0
|
db " |Vendeur|Modele|Bus |Dev.|Func|Classe.Sous-classe\l",0
|
||||||
msg_pci_card db " | 0x%hW | 0x%hW |%w|%w|%w|%0P.%0P\l",0
|
msg_pci_card db " | %hW | %hW |%w|%w|%w|%0P.%0P\l",0
|
||||||
msg_vmware db "\c04 VMWare a ete detecte !!!\c07\l",0
|
;msg_vmware db "\c04 VMWare a été detecté !!!\c07",0
|
||||||
msg_flat db "Initialisation du Flat Real Mode\l",0
|
msg_fini db "\c04Demarrage terminee : c pas encore fini :(:(:( mais c pour l'inspiration !",0
|
||||||
msg_disk_init db "Initialisation du pilote DISQUE\l",0
|
|
||||||
msg_launchcommand db "Execution du SHELL\l",0
|
|
||||||
|
|
||||||
msg_error db " [Erreur]",0dh,0ah,"<Pressez une touche pour redemarrer le systeme>",0
|
msg_error db " [Erreur]",0dh,0ah,"<Pressez une touche pour redemarrer le systeme>",0
|
||||||
msg_ok db " [ Ok ]",0dh,0ah,0
|
msg_ok db " [ Ok ]",0dh,0ah,0
|
||||||
msg_error2 db "\h70 [\c04Erreur\c07]\g00,49<Pressez une touche pour redemarrer le systeme>",0
|
msg_error2 db "\h70 [\c04Erreur\c07]\g00,49<Pressez une touche pour redemarrer le systeme>",0
|
||||||
msg_ok2 db "\h70 [\c02 Ok \c07]\l",0
|
msg_ok2 db "\h70 [\c02 Ok \c07]\l",0
|
||||||
msg_echec2 db "\h70 [\c0CPasser\c07]\l",0
|
msg_echec2 db "\h70 [\c0CPasser\c07]\l",0
|
||||||
|
|
||||||
|
|
||||||
exporting
|
|
||||||
declare biosprinth
|
|
||||||
declare biosprint
|
|
||||||
declare mbinit
|
|
||||||
declare mbcreate
|
|
||||||
declare mbfree
|
|
||||||
declare mbclean
|
|
||||||
declare mbresident
|
|
||||||
declare mbnonresident
|
|
||||||
declare mbchown
|
|
||||||
declare mballoc
|
|
||||||
declare mbfind
|
|
||||||
declare mbfindsb
|
|
||||||
declare mbget
|
|
||||||
declare mbloadfuncs
|
|
||||||
declare mbsearchfunc
|
|
||||||
declare bioswaitkey
|
|
||||||
declare mbloadsection
|
|
||||||
declare enableirq
|
|
||||||
declare enableirq
|
|
||||||
declare readimr
|
|
||||||
declare readirr
|
|
||||||
declare readisr
|
|
||||||
declare seteoi
|
|
||||||
declare enablea20
|
|
||||||
declare disablea20
|
|
||||||
declare flatmode
|
|
||||||
declare installirqhandler
|
|
||||||
declare irqhandler
|
|
||||||
declare isenableirq
|
|
||||||
declare isrequestirq
|
|
||||||
declare isinserviceirq
|
|
||||||
declare savecontext
|
|
||||||
declare restorecontextg
|
|
||||||
ende
|
|
||||||
|
|
||||||
|
|
||||||
importing
|
|
||||||
use VIDEO,setvideomode
|
|
||||||
use VIDEO,clearscreen
|
|
||||||
use VIDEO.LIB,print
|
|
||||||
use DETECT.LIB,cpuinfo
|
|
||||||
use DETECT.LIB,setinfo
|
|
||||||
use DETECT.LIB,pciinfo
|
|
||||||
use DETECT.LIB,getcardinfo
|
|
||||||
use DETECT.LIB,getpcisubclass
|
|
||||||
use DETECT.LIB,getpciclass
|
|
||||||
use DETECT.LIB,detectvmware
|
|
||||||
use DISQUE,initdrive
|
|
||||||
use DISQUE,projfile
|
|
||||||
use DISQUE,execfile
|
|
||||||
endi
|
|
||||||
|
|
||||||
|
imports:
|
||||||
|
db "VIDEO::setvideomode",0
|
||||||
|
setvideomode dd 0
|
||||||
|
db "VIDEO::clearscreen",0
|
||||||
|
clearscreen dd 0
|
||||||
|
db "VIDEO.LIB::print",0
|
||||||
|
print dd 0
|
||||||
|
db "DETECT.LIB::cpuinfo",0
|
||||||
|
cpuinfo dd 0
|
||||||
|
db "DETECT.LIB::setinfo",0
|
||||||
|
setinfo dd 0
|
||||||
|
db "DETECT.LIB::pciinfo",0
|
||||||
|
pciinfo dd 0
|
||||||
|
db "DETECT.LIB::getcardinfo",0
|
||||||
|
getcardinfo dd 0
|
||||||
|
db "DETECT.LIB::getpcisubclass",0
|
||||||
|
getpcisubclass dd 0
|
||||||
|
db "DETECT.LIB::getpciclass",0
|
||||||
|
getpciclass dd 0
|
||||||
|
;db "DETECT.LIB::detectvmware",0
|
||||||
|
;detectvmware dd 0
|
||||||
|
dw 0
|
||||||
|
|
||||||
|
exports:
|
||||||
include "mcb.asm"
|
include "mcb.asm"
|
||||||
include "8259a.asm"
|
mb1:
|
||||||
|
includebin "video.sys"
|
||||||
|
mb2:
|
||||||
|
includebin "..\lib\video.lib"
|
||||||
|
mb3:
|
||||||
|
includebin "..\lib\detect.lib"
|
||||||
|
mb4:
|
||||||
|
|
||||||
section:
|
section:
|
||||||
dw offset mb0
|
dw offset mb0
|
||||||
|
@ -274,25 +230,9 @@ dw offset mb3-offset mb2
|
||||||
db "VIDEO.LIB",0
|
db "VIDEO.LIB",0
|
||||||
|
|
||||||
dw offset mb3
|
dw offset mb3
|
||||||
dw offset mb4-offset mb3
|
dw offset mb4-offset mb
|
||||||
db "DETECT.LIB",0
|
db "DETECT.LIB",0
|
||||||
|
|
||||||
dw offset mb4
|
|
||||||
dw offset mb5-offset mb4
|
|
||||||
db "DISQUE",0
|
|
||||||
|
|
||||||
dd 0
|
dd 0
|
||||||
|
|
||||||
mb1:
|
|
||||||
includebin "video.sys"
|
|
||||||
mb2:
|
|
||||||
includebin "..\lib\video.lib"
|
|
||||||
mb3:
|
|
||||||
includebin "..\lib\detect.lib"
|
|
||||||
mb4:
|
|
||||||
includebin "disque.sys"
|
|
||||||
mb5:
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
804
noyau/video.asm
804
noyau/video.asm
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Before Width: | Height: | Size: 766 B |
Binary file not shown.
Before Width: | Height: | Size: 8.5 KiB |
|
@ -1,139 +0,0 @@
|
||||||
<?xml version='1.0' encoding='utf-8' ?>
|
|
||||||
<!-- C++Builder XML Project -->
|
|
||||||
<PROJECT>
|
|
||||||
<MACROS>
|
|
||||||
<VERSION value="BCB.06.00"/>
|
|
||||||
<PROJECT value="Project1.exe"/>
|
|
||||||
<OBJFILES value="Project1.obj Unit1.obj"/>
|
|
||||||
<RESFILES value="Project1.res"/>
|
|
||||||
<IDLFILES value=""/>
|
|
||||||
<IDLGENFILES value=""/>
|
|
||||||
<DEFFILE value=""/>
|
|
||||||
<RESDEPEN value="$(RESFILES) Unit1.dfm"/>
|
|
||||||
<LIBFILES value=""/>
|
|
||||||
<LIBRARIES value="rtl.lib vcl.lib"/>
|
|
||||||
<SPARELIBS value="vcl.lib rtl.lib"/>
|
|
||||||
<PACKAGES value="vcl.bpi rtl.bpi dbrtl.bpi adortl.bpi vcldb.bpi vclx.bpi bdertl.bpi
|
|
||||||
ibxpress.bpi dsnap.bpi cds.bpi bdecds.bpi qrpt.bpi teeui.bpi teedb.bpi
|
|
||||||
tee.bpi vcldbx.bpi dss.bpi teeqr.bpi visualclx.bpi visualdbclx.bpi
|
|
||||||
dsnapcrba.bpi dsnapcon.bpi bcbsmp.bpi vclie.bpi xmlrtl.bpi inet.bpi
|
|
||||||
inetdbbde.bpi inetdbxpress.bpi inetdb.bpi nmfast.bpi webdsnap.bpi
|
|
||||||
bcbie.bpi websnap.bpi soaprtl.bpi dclocx.bpi dbexpress.bpi dbxcds.bpi
|
|
||||||
indy.bpi bcb2kaxserver.bpi OpenGLPanel_DP.bpi IcsBcb60.bpi ZComponent.bpi
|
|
||||||
ZPlain.bpi ZCore.bpi ZDbc.bpi ZParseSql.bpi"/>
|
|
||||||
<PATHCPP value=".;"/>
|
|
||||||
<PATHPAS value=".;"/>
|
|
||||||
<PATHRC value=".;"/>
|
|
||||||
<PATHASM value=".;"/>
|
|
||||||
<DEBUGLIBPATH value="$(BCB)\lib\debug"/>
|
|
||||||
<RELEASELIBPATH value="$(BCB)\lib\release"/>
|
|
||||||
<LINKER value="ilink32"/>
|
|
||||||
<USERDEFINES value=""/>
|
|
||||||
<SYSDEFINES value="_RTLDLL;NO_STRICT"/>
|
|
||||||
<MAINSOURCE value="Project1.cpp"/>
|
|
||||||
<INCLUDEPATH value="D:\CBuilder6\Bin;"C:\Documents and Settings\admin\Bureau\perso\cos\CE explorer";$(BCB)\include;$(BCB)\include\vcl"/>
|
|
||||||
<LIBPATH value="D:\CBuilder6\Bin;"C:\Documents and Settings\admin\Bureau\perso\cos\CE explorer";$(BCB)\Projects\Lib;$(BCB)\lib\obj;$(BCB)\lib"/>
|
|
||||||
<WARNINGS value="-w-par"/>
|
|
||||||
<OTHERFILES value=""/>
|
|
||||||
</MACROS>
|
|
||||||
<OPTIONS>
|
|
||||||
<IDLCFLAGS value="-ID:\CBuilder6\Bin
|
|
||||||
-I"C:\Documents and Settings\admin\Bureau\perso\cos\CE explorer"
|
|
||||||
-I$(BCB)\include -I$(BCB)\include\vcl -src_suffix cpp -boa"/>
|
|
||||||
<CFLAG1 value="-O2 -H=$(BCB)\lib\vcl60.csm -Hc -Vx -Ve -X- -a8 -b- -k- -vi -c -tW -tWM"/>
|
|
||||||
<PFLAGS value="-$Y- -$L- -$D- -$A8 -v -JPHNE -M"/>
|
|
||||||
<RFLAGS value=""/>
|
|
||||||
<AFLAGS value="/mx /w2 /zn"/>
|
|
||||||
<LFLAGS value="-D"" -aa -Tpe -x -Gn"/>
|
|
||||||
<OTHERFILES value=""/>
|
|
||||||
</OPTIONS>
|
|
||||||
<LINKER>
|
|
||||||
<ALLOBJ value="c0w32.obj Memmgr.Lib sysinit.obj $(OBJFILES)"/>
|
|
||||||
<ALLRES value="$(RESFILES)"/>
|
|
||||||
<ALLLIB value="$(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib"/>
|
|
||||||
<OTHERFILES value=""/>
|
|
||||||
</LINKER>
|
|
||||||
<FILELIST>
|
|
||||||
<FILE FILENAME="Project1.res" FORMNAME="" UNITNAME="Project1.res" CONTAINERID="ResTool" DESIGNCLASS="" LOCALCOMMAND=""/>
|
|
||||||
<FILE FILENAME="Project1.cpp" FORMNAME="" UNITNAME="Project1" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>
|
|
||||||
<FILE FILENAME="Unit1.cpp" FORMNAME="Form1" UNITNAME="Unit1" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>
|
|
||||||
</FILELIST>
|
|
||||||
<BUILDTOOLS>
|
|
||||||
</BUILDTOOLS>
|
|
||||||
|
|
||||||
<IDEOPTIONS>
|
|
||||||
[Version Info]
|
|
||||||
IncludeVerInfo=1
|
|
||||||
AutoIncBuild=1
|
|
||||||
MajorVer=1
|
|
||||||
MinorVer=0
|
|
||||||
Release=0
|
|
||||||
Build=0
|
|
||||||
Debug=0
|
|
||||||
PreRelease=0
|
|
||||||
Special=0
|
|
||||||
Private=0
|
|
||||||
DLL=0
|
|
||||||
Locale=1036
|
|
||||||
CodePage=1252
|
|
||||||
|
|
||||||
[Version Info Keys]
|
|
||||||
CompanyName=COS2000
|
|
||||||
FileDescription=Cos2000 lib explorer
|
|
||||||
FileVersion=1.0.0.0
|
|
||||||
InternalName=
|
|
||||||
LegalCopyright=
|
|
||||||
LegalTrademarks=
|
|
||||||
OriginalFilename=
|
|
||||||
ProductName=Cos2000 lib explorer
|
|
||||||
ProductVersion=1.0.0.0
|
|
||||||
Comments=FOR CE ONLY
|
|
||||||
|
|
||||||
[Excluded Packages]
|
|
||||||
..\lib\DragDrop_B5.bpl=(untitled)
|
|
||||||
..\lib\Moje_B5.bpl=(untitled)
|
|
||||||
..\lib\DriveDir_B5.bpl=(untitled)
|
|
||||||
..\lib\tb2k_cb6.bpl=(untitled)
|
|
||||||
..\lib\tb2kdsgn_cb6.bpl=(untitled)
|
|
||||||
..\lib\tbx_cb6.bpl=(untitled)
|
|
||||||
..\lib\tbxdsgn_cb6.bpl=(untitled)
|
|
||||||
d:\cbuilder6\Bin\dclite60.bpl=Borland Integrated Translation Environment
|
|
||||||
|
|
||||||
[HistoryLists\hlIncludePath]
|
|
||||||
Count=1
|
|
||||||
Item0=D:\CBuilder6\Bin;C:\Documents and Settings\admin\Bureau\perso\cos\CE explorer;$(BCB)\include;$(BCB)\include\vcl
|
|
||||||
|
|
||||||
[HistoryLists\hlLibraryPath]
|
|
||||||
Count=1
|
|
||||||
Item0=D:\CBuilder6\Bin;C:\Documents and Settings\admin\Bureau\perso\cos\CE explorer;$(BCB)\Projects\Lib;$(BCB)\lib\obj;$(BCB)\lib
|
|
||||||
|
|
||||||
[HistoryLists\hlDebugSourcePath]
|
|
||||||
Count=1
|
|
||||||
Item0=$(BCB)\source\vcl
|
|
||||||
|
|
||||||
[Debugging]
|
|
||||||
DebugSourceDirs=$(BCB)\source\vcl
|
|
||||||
|
|
||||||
[Parameters]
|
|
||||||
RunParams=
|
|
||||||
Launcher=
|
|
||||||
UseLauncher=0
|
|
||||||
DebugCWD=
|
|
||||||
HostApplication=
|
|
||||||
RemoteHost=
|
|
||||||
RemotePath=
|
|
||||||
RemoteLauncher=
|
|
||||||
RemoteCWD=
|
|
||||||
RemoteDebug=0
|
|
||||||
|
|
||||||
[Compiler]
|
|
||||||
ShowInfoMsgs=0
|
|
||||||
LinkDebugVcl=0
|
|
||||||
LinkCGLIB=0
|
|
||||||
|
|
||||||
[CORBA]
|
|
||||||
AddServerUnit=1
|
|
||||||
AddClientUnit=1
|
|
||||||
PrecompiledHeaders=1
|
|
||||||
</IDEOPTIONS>
|
|
||||||
</PROJECT>
|
|
|
@ -1,34 +0,0 @@
|
||||||
//---------------------------------------------------------------------------
|
|
||||||
|
|
||||||
#include <vcl.h>
|
|
||||||
#pragma hdrstop
|
|
||||||
//---------------------------------------------------------------------------
|
|
||||||
USEFORM("Unit1.cpp", Form1);
|
|
||||||
//---------------------------------------------------------------------------
|
|
||||||
WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
Application->Initialize();
|
|
||||||
Application->Title = "CE explorer";
|
|
||||||
Application->CreateForm(__classid(TForm1), &Form1);
|
|
||||||
Application->Run();
|
|
||||||
}
|
|
||||||
catch (Exception &exception)
|
|
||||||
{
|
|
||||||
Application->ShowException(&exception);
|
|
||||||
}
|
|
||||||
catch (...)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
throw Exception("");
|
|
||||||
}
|
|
||||||
catch (Exception &exception)
|
|
||||||
{
|
|
||||||
Application->ShowException(&exception);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
//---------------------------------------------------------------------------
|
|
Binary file not shown.
Binary file not shown.
|
@ -1,273 +0,0 @@
|
||||||
//---------------------------------------------------------------------------
|
|
||||||
|
|
||||||
#include <vcl.h>
|
|
||||||
#include <math.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
#pragma hdrstop
|
|
||||||
|
|
||||||
#include "Unit1.h"
|
|
||||||
//---------------------------------------------------------------------------
|
|
||||||
#pragma package(smart_init)
|
|
||||||
#pragma resource "*.dfm"
|
|
||||||
TForm1 *Form1;
|
|
||||||
//---------------------------------------------------------------------------
|
|
||||||
__fastcall TForm1::TForm1(TComponent* Owner)
|
|
||||||
: TForm(Owner)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
//---------------------------------------------------------------------------
|
|
||||||
tree(AnsiString file,int offset,TTreeNode* rootnode)
|
|
||||||
{
|
|
||||||
FILE* in;
|
|
||||||
#pragma option -a1
|
|
||||||
struct CE {
|
|
||||||
char checks[2];
|
|
||||||
unsigned char major;
|
|
||||||
unsigned int checksum;
|
|
||||||
unsigned char compressed;
|
|
||||||
unsigned short exports;
|
|
||||||
unsigned short imports;
|
|
||||||
unsigned short sections;
|
|
||||||
unsigned short starting;
|
|
||||||
} myce;
|
|
||||||
#pragma option -a
|
|
||||||
|
|
||||||
long pointeur=0;
|
|
||||||
|
|
||||||
if ((in = fopen(file.c_str(), "rb"))!= NULL)
|
|
||||||
{
|
|
||||||
fseek(in, pointeur+offset, SEEK_SET);
|
|
||||||
fread(&myce, sizeof(myce), 1, in);
|
|
||||||
TTreeNode* currentnode;
|
|
||||||
TTreeNode* subcurrentnode;
|
|
||||||
TTreeNode* subsubcurrentnode;
|
|
||||||
if (offset==0)
|
|
||||||
{
|
|
||||||
fseek(in, 0L, SEEK_END);
|
|
||||||
Form1->TreeView->Items->AddChild(rootnode,"Adresse réelle: 0x0000")->ImageIndex=31;
|
|
||||||
Form1->TreeView->Items->AddChild(rootnode,"Adresse : 0x0000")->ImageIndex=31;
|
|
||||||
}
|
|
||||||
currentnode=Form1->TreeView->Items->AddChild(rootnode,"Entête");
|
|
||||||
currentnode->ImageIndex=10;
|
|
||||||
Form1->TreeView->Items->AddChild(currentnode,"Adresse réelle: 0x"+IntToHex((int)pointeur+offset,4))->ImageIndex=31;
|
|
||||||
Form1->TreeView->Items->AddChild(currentnode,"Adresse : 0x"+IntToHex((int)pointeur,4))->ImageIndex=31;
|
|
||||||
if (AnsiString(myce.checks,2)!="CE")
|
|
||||||
{
|
|
||||||
rootnode->ImageIndex=4;
|
|
||||||
Form1->TreeView->Items->AddChild(currentnode,"Type : ceci n'est pas un fichier CE")->ImageIndex=1;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
rootnode->ImageIndex=2;
|
|
||||||
subcurrentnode=Form1->TreeView->Items->AddChild(currentnode,"Type : "+AnsiString(myce.checks,2));
|
|
||||||
Form1->TreeView->Items->AddChild(subcurrentnode,"Adresse réelle: 0x"+IntToHex((int)0+offset,4))->ImageIndex=31;
|
|
||||||
Form1->TreeView->Items->AddChild(subcurrentnode,"Adresse : 0x"+IntToHex((int)0,4))->ImageIndex=31;
|
|
||||||
Form1->TreeView->Items->AddChild(subcurrentnode,"Taille: 0x0002")->ImageIndex=31;
|
|
||||||
subcurrentnode=Form1->TreeView->Items->AddChild(currentnode,"Version : "+IntToStr(myce.major));
|
|
||||||
Form1->TreeView->Items->AddChild(subcurrentnode,"Adresse réelle: 0x"+IntToHex((int)2+offset,4))->ImageIndex=31;
|
|
||||||
Form1->TreeView->Items->AddChild(subcurrentnode,"Adresse : 0x"+IntToHex((int)2,4))->ImageIndex=31;
|
|
||||||
Form1->TreeView->Items->AddChild(subcurrentnode,"Taille: 0x0001")->ImageIndex=31;
|
|
||||||
subcurrentnode=Form1->TreeView->Items->AddChild(currentnode,"Checksum : 0x"+IntToHex((int)myce.checksum,8));
|
|
||||||
Form1->TreeView->Items->AddChild(subcurrentnode,"Adresse réelle: 0x"+IntToHex((int)3+offset,4))->ImageIndex=31;
|
|
||||||
Form1->TreeView->Items->AddChild(subcurrentnode,"Adresse : 0x"+IntToHex((int)3,4))->ImageIndex=31;
|
|
||||||
Form1->TreeView->Items->AddChild(subcurrentnode,"Taille: 0x0004")->ImageIndex=31;
|
|
||||||
if (myce.compressed>=1)
|
|
||||||
subcurrentnode=Form1->TreeView->Items->AddChild(currentnode,"Fichier compressé avec RIP");
|
|
||||||
else
|
|
||||||
subcurrentnode=Form1->TreeView->Items->AddChild(currentnode,"Fichier sans compression");
|
|
||||||
Form1->TreeView->Items->AddChild(subcurrentnode,"Adresse réelle: 0x"+IntToHex((int)7+offset,4))->ImageIndex=31;
|
|
||||||
Form1->TreeView->Items->AddChild(subcurrentnode,"Adresse : 0x"+IntToHex((int)7,4))->ImageIndex=31;
|
|
||||||
Form1->TreeView->Items->AddChild(subcurrentnode,"Taille: 0x0001")->ImageIndex=31;
|
|
||||||
subcurrentnode=Form1->TreeView->Items->AddChild(currentnode,"Pointeur exportation : 0x"+IntToHex(myce.exports,4));
|
|
||||||
Form1->TreeView->Items->AddChild(subcurrentnode,"Adresse réelle: 0x"+IntToHex((int)8+offset,4))->ImageIndex=31;
|
|
||||||
Form1->TreeView->Items->AddChild(subcurrentnode,"Adresse : 0x"+IntToHex((int)8,4))->ImageIndex=31;
|
|
||||||
Form1->TreeView->Items->AddChild(subcurrentnode,"Taille: 0x0002")->ImageIndex=31;
|
|
||||||
subcurrentnode=Form1->TreeView->Items->AddChild(currentnode,"Pointeur Importation : 0x"+IntToHex(myce.imports,4));
|
|
||||||
Form1->TreeView->Items->AddChild(subcurrentnode,"Adresse réelle: 0x"+IntToHex((int)10+offset,4))->ImageIndex=31;
|
|
||||||
Form1->TreeView->Items->AddChild(subcurrentnode,"Adresse : 0x"+IntToHex((int)10,4))->ImageIndex=31;
|
|
||||||
Form1->TreeView->Items->AddChild(subcurrentnode,"Taille: 0x0002")->ImageIndex=31;
|
|
||||||
subcurrentnode=Form1->TreeView->Items->AddChild(currentnode,"Pointeur sections : 0x"+IntToHex(myce.sections,4));
|
|
||||||
Form1->TreeView->Items->AddChild(subcurrentnode,"Adresse réelle: 0x"+IntToHex((int)12+offset,4))->ImageIndex=31;
|
|
||||||
Form1->TreeView->Items->AddChild(subcurrentnode,"Adresse : 0x"+IntToHex((int)12,4))->ImageIndex=31;
|
|
||||||
Form1->TreeView->Items->AddChild(subcurrentnode,"Taille: 0x0002")->ImageIndex=31;
|
|
||||||
subcurrentnode=Form1->TreeView->Items->AddChild(currentnode,"Point d'entrée : 0x"+IntToHex(myce.starting,4));
|
|
||||||
Form1->TreeView->Items->AddChild(subcurrentnode,"Adresse réelle: 0x"+IntToHex((int)14+offset,4))->ImageIndex=31;
|
|
||||||
Form1->TreeView->Items->AddChild(subcurrentnode,"Adresse : 0x"+IntToHex((int)14,4))->ImageIndex=31;
|
|
||||||
Form1->TreeView->Items->AddChild(subcurrentnode,"Taille: 0x0002")->ImageIndex=31;
|
|
||||||
Form1->TreeView->Items->AddChild(currentnode,"Taille : 0x0010")->ImageIndex=31;
|
|
||||||
|
|
||||||
char imported[30];
|
|
||||||
AnsiString imports[30]={""};
|
|
||||||
AnsiString exports[30]={""};
|
|
||||||
AnsiString sections[30]={""};
|
|
||||||
unsigned short iaddrs[30]={0};
|
|
||||||
unsigned short eaddrs[30]={0};
|
|
||||||
unsigned short saddrs[30]={0};
|
|
||||||
unsigned short ssize[30]={0};
|
|
||||||
AnsiString libraries[30]={""};
|
|
||||||
AnsiString alib;
|
|
||||||
int i=0;
|
|
||||||
pointeur=myce.imports;
|
|
||||||
int nblib=0;
|
|
||||||
int nbimp=0;
|
|
||||||
|
|
||||||
if (myce.imports!=0)
|
|
||||||
{
|
|
||||||
currentnode=Form1->TreeView->Items->AddChild(rootnode,"Importations");
|
|
||||||
currentnode->ImageIndex=14;
|
|
||||||
Form1->TreeView->Items->AddChild(currentnode,"Adresse réelle: 0x"+IntToHex((int)pointeur+offset,4))->ImageIndex=31;
|
|
||||||
Form1->TreeView->Items->AddChild(currentnode,"Adresse : 0x"+IntToHex((int)pointeur,4))->ImageIndex=31;
|
|
||||||
do
|
|
||||||
{
|
|
||||||
fseek(in, pointeur+offset, SEEK_SET);
|
|
||||||
fread(&imported, sizeof(imported), 1, in);
|
|
||||||
imports[i]=AnsiString((char*)&imported);
|
|
||||||
iaddrs[i]=pointeur;
|
|
||||||
pointeur+=imports[i].Length()+5;
|
|
||||||
alib=imports[i].SubString(0,imports[i].Pos(":")-1);
|
|
||||||
int j;
|
|
||||||
for(j=0;(j<nblib)&&(alib!=libraries[j])&&(libraries[j]!="");j++);
|
|
||||||
if ((libraries[j]=="")&&(alib!="")) {
|
|
||||||
libraries[j]=alib;
|
|
||||||
nblib++;
|
|
||||||
}
|
|
||||||
i++;
|
|
||||||
} while(imports[i-1]!="");
|
|
||||||
nbimp=i-1;
|
|
||||||
for(int i=0;i<nblib;i++)
|
|
||||||
{
|
|
||||||
subcurrentnode=Form1->TreeView->Items->AddChild(currentnode,libraries[i]);
|
|
||||||
subcurrentnode->ImageIndex=13;
|
|
||||||
for(int j=0;j<nbimp;j++)
|
|
||||||
{
|
|
||||||
if (imports[j].SubString(0,imports[j].Pos(":")-1)==libraries[i])
|
|
||||||
{
|
|
||||||
subsubcurrentnode=Form1->TreeView->Items->AddChild(subcurrentnode,imports[j].SubString(imports[j].Pos(":")+2,255));
|
|
||||||
subsubcurrentnode->ImageIndex=3;
|
|
||||||
Form1->TreeView->Items->AddChild(subsubcurrentnode,"Adresse réelle: 0x"+IntToHex((int)iaddrs[j]+offset,4))->ImageIndex=31;
|
|
||||||
Form1->TreeView->Items->AddChild(subsubcurrentnode,"Adresse : 0x"+IntToHex((int)iaddrs[j],4))->ImageIndex=31;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
currentnode->Text="importations ("+IntToStr(nbimp)+"/"+IntToStr(nblib)+")";
|
|
||||||
Form1->TreeView->Items->AddChild(currentnode,"Taille : 0x"+IntToHex((int)pointeur-myce.imports,4))->ImageIndex=31;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
nbimp=0;
|
|
||||||
}
|
|
||||||
|
|
||||||
i=0;
|
|
||||||
pointeur=myce.exports;
|
|
||||||
int nbexp=0;
|
|
||||||
|
|
||||||
if (myce.exports!=0)
|
|
||||||
{
|
|
||||||
currentnode=Form1->TreeView->Items->AddChild(rootnode,"Exportations");
|
|
||||||
currentnode->ImageIndex=14;
|
|
||||||
Form1->TreeView->Items->AddChild(currentnode,"Adresse réelle: 0x"+IntToHex((int)pointeur+offset,4))->ImageIndex=31;
|
|
||||||
Form1->TreeView->Items->AddChild(currentnode,"Adresse : 0x"+IntToHex((int)pointeur,4))->ImageIndex=31;
|
|
||||||
do
|
|
||||||
{
|
|
||||||
fseek(in, pointeur+offset, SEEK_SET);
|
|
||||||
fread(&imported, sizeof(imported), 1, in);
|
|
||||||
exports[i]=AnsiString((char*)&imported);
|
|
||||||
pointeur+=exports[i].Length()+1;
|
|
||||||
fseek(in, pointeur+offset, SEEK_SET);
|
|
||||||
fread(&eaddrs[i],sizeof(eaddrs[i]),1,in);
|
|
||||||
pointeur+=2;
|
|
||||||
i++;
|
|
||||||
} while(exports[i-1]!="");
|
|
||||||
|
|
||||||
nbexp=i-1;
|
|
||||||
|
|
||||||
for(int i=0;i<nbexp;i++)
|
|
||||||
{
|
|
||||||
subcurrentnode=Form1->TreeView->Items->AddChild(currentnode,exports[i]);
|
|
||||||
subcurrentnode->ImageIndex=3;
|
|
||||||
Form1->TreeView->Items->AddChild(subcurrentnode,"Adresse réelle: 0x"+IntToHex(eaddrs[i]+offset,4))->ImageIndex=31;
|
|
||||||
Form1->TreeView->Items->AddChild(subcurrentnode,"Adresse : 0x"+IntToHex(eaddrs[i],4))->ImageIndex=31;
|
|
||||||
}
|
|
||||||
currentnode->Text="exportations ("+IntToStr(nbexp)+")";
|
|
||||||
Form1->TreeView->Items->AddChild(currentnode,"Taille : 0x"+IntToHex((int)pointeur-myce.exports,4))->ImageIndex=31;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
nbexp=0;
|
|
||||||
}
|
|
||||||
|
|
||||||
pointeur=myce.sections;
|
|
||||||
i=0;
|
|
||||||
int nbsec=0;
|
|
||||||
|
|
||||||
if (myce.sections!=0)
|
|
||||||
{
|
|
||||||
currentnode=Form1->TreeView->Items->AddChild(rootnode,"Sections");
|
|
||||||
currentnode->ImageIndex=12;
|
|
||||||
Form1->TreeView->Items->AddChild(currentnode,"Adresse réelle: 0x"+IntToHex((int)pointeur+offset,4))->ImageIndex=31;
|
|
||||||
Form1->TreeView->Items->AddChild(currentnode,"Adresse : 0x"+IntToHex((int)pointeur,4))->ImageIndex=31;
|
|
||||||
do
|
|
||||||
{
|
|
||||||
fseek(in, pointeur+offset, SEEK_SET);
|
|
||||||
fread(&saddrs[i],sizeof(saddrs[i]),1,in);
|
|
||||||
pointeur+=2;
|
|
||||||
fseek(in, pointeur+offset, SEEK_SET);
|
|
||||||
fread(&ssize[i],sizeof(ssize[i]),1,in);
|
|
||||||
pointeur+=2;
|
|
||||||
fseek(in, pointeur+offset, SEEK_SET);
|
|
||||||
fread(&imported, sizeof(imported), 1, in);
|
|
||||||
sections[i]=AnsiString((char*)&imported);
|
|
||||||
pointeur+=sections[i].Length()+1;
|
|
||||||
i++;
|
|
||||||
} while(ssize[i-1]!=0);
|
|
||||||
nbsec=i-1;
|
|
||||||
for(int i=0;i<nbsec;i++)
|
|
||||||
{
|
|
||||||
subcurrentnode=Form1->TreeView->Items->AddChild(currentnode,sections[i]);
|
|
||||||
Form1->TreeView->Items->AddChild(subcurrentnode,"Adresse réelle: 0x"+IntToHex(saddrs[i]+offset,4))->ImageIndex=31;
|
|
||||||
Form1->TreeView->Items->AddChild(subcurrentnode,"Adresse : 0x"+IntToHex(saddrs[i],4))->ImageIndex=31;
|
|
||||||
if (saddrs[i]!=0) tree(file,saddrs[i],subcurrentnode);
|
|
||||||
subcurrentnode->ImageIndex=2;
|
|
||||||
Form1->TreeView->Items->AddChild(subcurrentnode,"Taille : 0x"+IntToHex(ssize[i],4))->ImageIndex=31;
|
|
||||||
}
|
|
||||||
Form1->TreeView->Items->AddChild(currentnode,"Taille : 0x"+IntToHex((int)pointeur-myce.sections,4))->ImageIndex=31;
|
|
||||||
currentnode->Text="Sections ("+IntToStr(nbsec)+")";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
nbsec=0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (offset==0)
|
|
||||||
{
|
|
||||||
fseek(in, 0L, SEEK_END);
|
|
||||||
int size = ftell(in);
|
|
||||||
Form1->TreeView->Items->AddChild(rootnode,"Taille : 0x"+IntToHex(size,4))->ImageIndex=31;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
fclose(in);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//---------------------------------------------------------------------------
|
|
||||||
|
|
||||||
void __fastcall TForm1::Ouvrir1Click(TObject *Sender)
|
|
||||||
{
|
|
||||||
if (OpenDialog->Execute())
|
|
||||||
tree(OpenDialog->FileName,0,Form1->TreeView->Items->Add(Form1->TreeView->Items->GetFirstNode(),ExtractFileName(OpenDialog->FileName)));
|
|
||||||
TTreeNode* node=Form1->TreeView->Items->GetFirstNode();
|
|
||||||
while(node!=NULL)
|
|
||||||
{
|
|
||||||
node->SelectedIndex=node->ImageIndex;
|
|
||||||
node=node->GetNext();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
|
||||||
|
|
||||||
void __fastcall TForm1::Quitter1Click(TObject *Sender)
|
|
||||||
{
|
|
||||||
Close();
|
|
||||||
}
|
|
||||||
//---------------------------------------------------------------------------
|
|
||||||
|
|
||||||
|
|
Binary file not shown.
File diff suppressed because it is too large
Load Diff
|
@ -1,37 +0,0 @@
|
||||||
//---------------------------------------------------------------------------
|
|
||||||
|
|
||||||
#ifndef Unit1H
|
|
||||||
#define Unit1H
|
|
||||||
//---------------------------------------------------------------------------
|
|
||||||
#include <Classes.hpp>
|
|
||||||
#include <Controls.hpp>
|
|
||||||
#include <StdCtrls.hpp>
|
|
||||||
#include <Forms.hpp>
|
|
||||||
#include <Menus.hpp>
|
|
||||||
#include <Dialogs.hpp>
|
|
||||||
#include <ComCtrls.hpp>
|
|
||||||
#include <ImgList.hpp>
|
|
||||||
//---------------------------------------------------------------------------
|
|
||||||
class TForm1 : public TForm
|
|
||||||
{
|
|
||||||
__published: // IDE-managed Components
|
|
||||||
TMainMenu *MainMenu1;
|
|
||||||
TMenuItem *Fichier1;
|
|
||||||
TMenuItem *Ouvrir1;
|
|
||||||
TOpenDialog *OpenDialog;
|
|
||||||
TTreeView *TreeView;
|
|
||||||
TImageList *ImageList;
|
|
||||||
TMenuItem *N1;
|
|
||||||
TMenuItem *Quitter1;
|
|
||||||
TRichEdit *RichEdit1;
|
|
||||||
void __fastcall Ouvrir1Click(TObject *Sender);
|
|
||||||
void __fastcall Quitter1Click(TObject *Sender);
|
|
||||||
private: // User declarations
|
|
||||||
public: // User declarations
|
|
||||||
__fastcall TForm1(TComponent* Owner);
|
|
||||||
};
|
|
||||||
//---------------------------------------------------------------------------
|
|
||||||
extern PACKAGE TForm1 *Form1;
|
|
||||||
//---------------------------------------------------------------------------
|
|
||||||
#endif
|
|
||||||
|
|
|
@ -1,108 +0,0 @@
|
||||||
net segment
|
|
||||||
|
|
||||||
org 0100h
|
|
||||||
assume cs:net,ds:net
|
|
||||||
|
|
||||||
start:
|
|
||||||
jmp deb
|
|
||||||
taille dw 0
|
|
||||||
signe db 'rip'
|
|
||||||
signe2 db 64 dup (0)
|
|
||||||
p1 db '@'
|
|
||||||
p2 db '@'
|
|
||||||
min db 4
|
|
||||||
deb:
|
|
||||||
mov BL,DS:[0080h]
|
|
||||||
xor BH,BH
|
|
||||||
or BX,BX
|
|
||||||
mov byte ptr [0081h+BX],00h
|
|
||||||
mov AX,3D02h
|
|
||||||
mov DX,0082H
|
|
||||||
int 21h
|
|
||||||
mov bx,ax
|
|
||||||
mov ah,3fh
|
|
||||||
mov cx,0ffffh
|
|
||||||
mov dx,offset data
|
|
||||||
int 21h
|
|
||||||
mov taille,ax
|
|
||||||
mov ah,3eh
|
|
||||||
int 21h
|
|
||||||
mov si,82h
|
|
||||||
mov di,offset signe2
|
|
||||||
mov cx,64
|
|
||||||
rep movsb
|
|
||||||
mov di,offset signe2
|
|
||||||
mov cx,64
|
|
||||||
mov al,2eh
|
|
||||||
repne scasb
|
|
||||||
push di
|
|
||||||
mov si,di
|
|
||||||
mov di,offset data
|
|
||||||
add di,taille
|
|
||||||
mov cx,3
|
|
||||||
rep movsb
|
|
||||||
mov ax,di
|
|
||||||
pop di
|
|
||||||
mov cx,3
|
|
||||||
mov si,offset signe
|
|
||||||
rep movsb
|
|
||||||
mov di,ax
|
|
||||||
mov cx,taille
|
|
||||||
mov si,offset data
|
|
||||||
mov dx,1
|
|
||||||
boucle:
|
|
||||||
lodsb
|
|
||||||
cmp al,[si]
|
|
||||||
jne pas
|
|
||||||
inc dl
|
|
||||||
loop boucle
|
|
||||||
jmp fin
|
|
||||||
pas:
|
|
||||||
cmp dl,min
|
|
||||||
jb suite
|
|
||||||
cmp dl,1
|
|
||||||
jne go
|
|
||||||
suite:
|
|
||||||
mov bx,cx
|
|
||||||
mov cx,dx
|
|
||||||
rep stosb
|
|
||||||
mov cx,bx
|
|
||||||
mov dl,1
|
|
||||||
loop boucle
|
|
||||||
jmp fin
|
|
||||||
go:
|
|
||||||
mov ah,al
|
|
||||||
mov al,p1
|
|
||||||
stosb
|
|
||||||
mov al,dl
|
|
||||||
stosb
|
|
||||||
mov al,ah
|
|
||||||
stosb
|
|
||||||
mov al,p2
|
|
||||||
stosb
|
|
||||||
mov dl,1
|
|
||||||
loop boucle
|
|
||||||
fin:
|
|
||||||
mov ah,3ch
|
|
||||||
mov cx,0
|
|
||||||
mov dx,offset signe2
|
|
||||||
int 21h
|
|
||||||
mov bx,ax
|
|
||||||
mov ah,40h
|
|
||||||
mov cx,di
|
|
||||||
sub cx,offset data
|
|
||||||
sub cx,taille
|
|
||||||
mov dx,offset data
|
|
||||||
add dx,taille
|
|
||||||
int 21h
|
|
||||||
mov ah,3eh
|
|
||||||
int 21h
|
|
||||||
mov ah,41h
|
|
||||||
mov dx,82h
|
|
||||||
int 21h
|
|
||||||
ret
|
|
||||||
data db 0
|
|
||||||
net ends
|
|
||||||
end start
|
|
||||||
|
|
||||||
net
|
|
|
@ -1,88 +0,0 @@
|
||||||
net segment
|
|
||||||
|
|
||||||
org 0100h
|
|
||||||
assume cs:net,ds:net
|
|
||||||
|
|
||||||
start:
|
|
||||||
jmp deb
|
|
||||||
taille dw 0
|
|
||||||
signe2 db 64 dup (0)
|
|
||||||
p1 db '@'
|
|
||||||
p2 db '@'
|
|
||||||
deb:
|
|
||||||
mov BL,DS:[0080h]
|
|
||||||
xor BH,BH
|
|
||||||
or BX,BX
|
|
||||||
mov byte ptr [0081h+BX],00h
|
|
||||||
mov AX,3D02h
|
|
||||||
mov DX,0082H
|
|
||||||
int 21h
|
|
||||||
mov bx,ax
|
|
||||||
mov ah,3fh
|
|
||||||
mov cx,0ffffh
|
|
||||||
mov dx,offset data
|
|
||||||
int 21h
|
|
||||||
mov taille,ax
|
|
||||||
mov ah,3eh
|
|
||||||
int 21h
|
|
||||||
mov si,82h
|
|
||||||
mov di,offset signe2
|
|
||||||
mov cx,64
|
|
||||||
rep movsb
|
|
||||||
mov di,offset signe2
|
|
||||||
mov cx,64
|
|
||||||
mov al,2eh
|
|
||||||
repne scasb
|
|
||||||
mov si,offset data
|
|
||||||
mov cx,3
|
|
||||||
rep movsb
|
|
||||||
mov cx,taille
|
|
||||||
mov di,offset data
|
|
||||||
add di,taille
|
|
||||||
mov dx,1
|
|
||||||
boucle:
|
|
||||||
lodsb
|
|
||||||
cmp al,p1
|
|
||||||
je pas
|
|
||||||
suite:
|
|
||||||
stosb
|
|
||||||
loop boucle
|
|
||||||
jmp fin
|
|
||||||
pas:
|
|
||||||
mov al,p2
|
|
||||||
cmp [si+2],al
|
|
||||||
jne suite
|
|
||||||
lodsb
|
|
||||||
mov bx,cx
|
|
||||||
mov cl,al
|
|
||||||
xor ch,ch
|
|
||||||
lodsb
|
|
||||||
rep stosb
|
|
||||||
mov cx,bx
|
|
||||||
sub cx,3
|
|
||||||
inc si
|
|
||||||
loop boucle
|
|
||||||
fin:
|
|
||||||
mov ah,3ch
|
|
||||||
mov cx,0
|
|
||||||
mov dx,offset signe2
|
|
||||||
int 21h
|
|
||||||
mov bx,ax
|
|
||||||
mov ah,40h
|
|
||||||
mov cx,di
|
|
||||||
sub cx,offset data
|
|
||||||
sub cx,taille
|
|
||||||
mov dx,offset data
|
|
||||||
add dx,taille
|
|
||||||
int 21h
|
|
||||||
mov ah,3eh
|
|
||||||
int 21h
|
|
||||||
mov ah,41h
|
|
||||||
mov dx,82h
|
|
||||||
int 21h
|
|
||||||
ret
|
|
||||||
data db 0
|
|
||||||
net ends
|
|
||||||
end start
|
|
||||||
|
|
||||||
net
|
|
|
@ -1,23 +1,53 @@
|
||||||
asm= lzasm /z/t
|
lnk_boot = tlink /x
|
||||||
lnk= elink
|
asm= tasm /t/m5/zi
|
||||||
|
lnk= tlink /x/t
|
||||||
|
|
||||||
all: exem-lib.lib exem-ce.ce pmode.ce isa.ce editeur.ce volume.ce test.ce verifier.ce gestion.ce logo.ce souris.ce test3d.ce test2d.ce
|
all: detect.com editeur.com gestion.com logo.com pmode.com souris.com test.com verifier.com volume.com memoire.com
|
||||||
|
|
||||||
.asm.obj:
|
memoire.com: memoire.asm
|
||||||
$(asm) $<
|
$(asm) memoire
|
||||||
|
$(lnk) memoire
|
||||||
|
|
||||||
.obj.ce:
|
detect.com: detect.asm
|
||||||
$(lnk) $< $*.ce
|
$(asm) detect
|
||||||
|
$(lnk) detect
|
||||||
|
|
||||||
|
editeur.com: editeur.asm
|
||||||
|
$(asm) editeur
|
||||||
|
$(lnk) editeur
|
||||||
|
|
||||||
|
gestion.com: gestion.asm
|
||||||
|
$(asm) gestion
|
||||||
|
$(lnk) gestion
|
||||||
|
|
||||||
|
logo.com: logo.asm
|
||||||
|
$(asm) logo
|
||||||
|
$(lnk) logo
|
||||||
|
|
||||||
|
pmode.com: pmode.asm
|
||||||
|
$(asm) pmode
|
||||||
|
$(lnk) pmode
|
||||||
|
|
||||||
|
souris.com: souris.asm
|
||||||
|
$(asm) souris
|
||||||
|
$(lnk) souris
|
||||||
|
|
||||||
|
test.com: test.asm
|
||||||
|
$(asm) test
|
||||||
|
$(lnk) test
|
||||||
|
|
||||||
|
verifier.com: verifier.asm
|
||||||
|
$(asm) verifier
|
||||||
|
$(lnk) verifier
|
||||||
|
|
||||||
|
volume.com: volume.asm
|
||||||
|
$(asm) volume
|
||||||
|
$(lnk) volume
|
||||||
|
|
||||||
.obj.lib:
|
|
||||||
$(lnk) $< $*.lib
|
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
del *.obj
|
del *.obj
|
||||||
del *.ce
|
|
||||||
del *.bak
|
|
||||||
del *.lib
|
|
||||||
del *.com
|
del *.com
|
||||||
del *.bin
|
del *.com
|
||||||
del *.sys
|
del *.sys
|
||||||
del *.err
|
del *.err
|
||||||
|
|
|
@ -0,0 +1,551 @@
|
||||||
|
.model tiny
|
||||||
|
.486
|
||||||
|
smart
|
||||||
|
.code
|
||||||
|
|
||||||
|
org 0h
|
||||||
|
|
||||||
|
include ..\include\pci.h
|
||||||
|
include ..\include\mem.h
|
||||||
|
|
||||||
|
start:
|
||||||
|
header exe <,1,0,,,offset imports,,>
|
||||||
|
|
||||||
|
realstart:
|
||||||
|
call getpciinfos
|
||||||
|
mov [pciversion],bx
|
||||||
|
mov [nbbus],cl
|
||||||
|
mov [pcitype],al
|
||||||
|
|
||||||
|
xor edx,edx
|
||||||
|
mov dl,[nbbus]
|
||||||
|
inc dl
|
||||||
|
push edx
|
||||||
|
mov dx,[pciversion]
|
||||||
|
push edx
|
||||||
|
mov dx,[pciversion]
|
||||||
|
shr dx,8
|
||||||
|
push edx
|
||||||
|
push offset msg
|
||||||
|
call [print]
|
||||||
|
|
||||||
|
mov di,offset types
|
||||||
|
mov bx,7
|
||||||
|
mov al,pcitype
|
||||||
|
vote:
|
||||||
|
bt ax,bx
|
||||||
|
jnc nowas
|
||||||
|
shl bx,1
|
||||||
|
push word ptr [di+bx]
|
||||||
|
call [print]
|
||||||
|
shr bx,1
|
||||||
|
nowas:
|
||||||
|
dec bx
|
||||||
|
jns vote
|
||||||
|
push offset return
|
||||||
|
call [print]
|
||||||
|
|
||||||
|
xor ax,ax
|
||||||
|
xor cx,cx
|
||||||
|
mov si,offset infos
|
||||||
|
search:
|
||||||
|
mov di,si
|
||||||
|
call Getallfunctionsinfos
|
||||||
|
jc stopthis
|
||||||
|
mov dh,[si+pci.subclass]
|
||||||
|
mov dl,[si+pci.class]
|
||||||
|
;sousclasse
|
||||||
|
mov di,offset subclasse
|
||||||
|
call getpcisubclass
|
||||||
|
push di
|
||||||
|
;classe
|
||||||
|
mov di,offset classe
|
||||||
|
call getpciclass
|
||||||
|
push di
|
||||||
|
;fonction
|
||||||
|
mov dl,ch
|
||||||
|
push edx
|
||||||
|
;device
|
||||||
|
mov dl,cl
|
||||||
|
push edx
|
||||||
|
;bus
|
||||||
|
mov dl,al
|
||||||
|
push edx
|
||||||
|
;device
|
||||||
|
mov dx,[si+pci.device]
|
||||||
|
push edx
|
||||||
|
;vendeur
|
||||||
|
mov dx,[si+pci.vendor]
|
||||||
|
push edx
|
||||||
|
|
||||||
|
push offset msg2
|
||||||
|
call [print]
|
||||||
|
|
||||||
|
inc ch
|
||||||
|
cmp ch,7
|
||||||
|
jbe search
|
||||||
|
stopthis:
|
||||||
|
xor ch,ch
|
||||||
|
inc cl
|
||||||
|
cmp cl,31
|
||||||
|
jbe search
|
||||||
|
xor cl,cl
|
||||||
|
inc al
|
||||||
|
cmp al,16
|
||||||
|
jbe search
|
||||||
|
retf
|
||||||
|
|
||||||
|
msg db "COS2000 hardware detecteur V1.6\lBIOS PCI version %hB.%hB a ete detecte !\lNombre de bus : %u\lCaracterisques PCI: ",0
|
||||||
|
msg2 db "Peripherique :%hW Constructeur :%hW Id :%hB.%hB.%hB Classe :%0.%0\l",0
|
||||||
|
return db "\l",0
|
||||||
|
classe db 128 dup (0)
|
||||||
|
subclasse db 128 dup (0)
|
||||||
|
|
||||||
|
types dw config1
|
||||||
|
dw config2
|
||||||
|
dw null
|
||||||
|
dw null
|
||||||
|
dw config3
|
||||||
|
dw config4
|
||||||
|
dw null
|
||||||
|
dw null
|
||||||
|
|
||||||
|
null db 'indefini',0
|
||||||
|
config1 db 'Config Mechanism 1',0
|
||||||
|
config2 db 'Config Mechanism 2',0
|
||||||
|
config3 db 'Special Cycle Mechanism 1',0
|
||||||
|
config4 db 'Special Cycle Mechanism 2',0
|
||||||
|
|
||||||
|
PciVersion dw 0
|
||||||
|
Nbbus db 0
|
||||||
|
PciType db 0
|
||||||
|
infos db 256 dup (0)
|
||||||
|
|
||||||
|
;fonction 0-7 bus 0-255 device 0-31
|
||||||
|
|
||||||
|
;renvoie en es:di de classe dl
|
||||||
|
getpciclass:
|
||||||
|
push ax cx dx si di ds es
|
||||||
|
push es
|
||||||
|
push di
|
||||||
|
mov di,dx
|
||||||
|
and di,0FFh
|
||||||
|
shl di,1
|
||||||
|
mov di,[offset classes+di]
|
||||||
|
mov cx,0FFh
|
||||||
|
mov al,0
|
||||||
|
push cs
|
||||||
|
pop es
|
||||||
|
repne scasb
|
||||||
|
sub cx,0FFh
|
||||||
|
neg cx
|
||||||
|
sub di,cx
|
||||||
|
mov si,di
|
||||||
|
push cs
|
||||||
|
pop ds
|
||||||
|
pop di
|
||||||
|
pop es
|
||||||
|
rep movsb
|
||||||
|
pop es ds di si dx cx ax
|
||||||
|
ret
|
||||||
|
|
||||||
|
;renvoie en es:di la sous-classe de dh et de classe dl
|
||||||
|
getpcisubclass:
|
||||||
|
push ax cx dx si di ds es
|
||||||
|
push es
|
||||||
|
push di
|
||||||
|
mov di,dx
|
||||||
|
and di,0FFh
|
||||||
|
shl di,1
|
||||||
|
mov di,[offset classesd+di]
|
||||||
|
xchg dh,dl
|
||||||
|
xor dh,dh
|
||||||
|
cmp dx,80h
|
||||||
|
jne suiteac
|
||||||
|
mov di,offset divers
|
||||||
|
jmp found
|
||||||
|
suiteac:
|
||||||
|
shl dx,1
|
||||||
|
add di,dx
|
||||||
|
mov di,[di]
|
||||||
|
found:
|
||||||
|
mov cx,0FFh
|
||||||
|
mov al,0
|
||||||
|
push cs
|
||||||
|
pop es
|
||||||
|
repne scasb
|
||||||
|
sub cx,0FFh
|
||||||
|
neg cx
|
||||||
|
sub di,cx
|
||||||
|
mov si,di
|
||||||
|
push cs
|
||||||
|
pop ds
|
||||||
|
pop di
|
||||||
|
pop es
|
||||||
|
rep movsb
|
||||||
|
pop es ds di si dx cx ax
|
||||||
|
ret
|
||||||
|
divers db 'divers',0
|
||||||
|
|
||||||
|
classes:
|
||||||
|
dw offset class0
|
||||||
|
dw offset class1
|
||||||
|
dw offset class2
|
||||||
|
dw offset class3
|
||||||
|
dw offset class4
|
||||||
|
dw offset class5
|
||||||
|
dw offset class6
|
||||||
|
dw offset class7
|
||||||
|
dw offset class8
|
||||||
|
dw offset class9
|
||||||
|
dw offset class10
|
||||||
|
dw offset class11
|
||||||
|
dw offset class12
|
||||||
|
dw offset class13
|
||||||
|
dw offset class14
|
||||||
|
dw offset class15
|
||||||
|
dw offset class16
|
||||||
|
dw offset class17
|
||||||
|
class0 db 'ancien',0
|
||||||
|
class1 db 'stockage',0
|
||||||
|
class2 db 'reseau',0
|
||||||
|
class3 db 'affichage',0
|
||||||
|
class4 db 'multimedia',0
|
||||||
|
class5 db 'memoire',0
|
||||||
|
class6 db 'pont',0
|
||||||
|
class7 db 'communication',0
|
||||||
|
class8 db 'systeme',0
|
||||||
|
class9 db 'acquisition',0
|
||||||
|
class10 db 'dock',0
|
||||||
|
class11 db 'processeur',0
|
||||||
|
class12 db 'bus serie',0
|
||||||
|
class13 db 'sans fil',0
|
||||||
|
class14 db 'intelligent',0
|
||||||
|
class15 db 'satellite',0
|
||||||
|
class16 db 'cryptage',0
|
||||||
|
class17 db 'traitement signal',0
|
||||||
|
|
||||||
|
|
||||||
|
;Classes et sous classes
|
||||||
|
classesd:
|
||||||
|
dw offset class0d
|
||||||
|
dw offset class1d
|
||||||
|
dw offset class2d
|
||||||
|
dw offset class3d
|
||||||
|
dw offset class4d
|
||||||
|
dw offset class5d
|
||||||
|
dw offset class6d
|
||||||
|
dw offset class7d
|
||||||
|
dw offset class8d
|
||||||
|
dw offset class9d
|
||||||
|
dw offset class10d
|
||||||
|
dw offset class11d
|
||||||
|
dw offset class12d
|
||||||
|
dw offset class13d
|
||||||
|
dw offset class14d
|
||||||
|
dw offset class15d
|
||||||
|
dw offset class16d
|
||||||
|
dw offset class17d
|
||||||
|
|
||||||
|
class0d:
|
||||||
|
dw offset subclass00
|
||||||
|
dw offset subclass01
|
||||||
|
subclass00 db 'divers',0
|
||||||
|
subclass01 db 'vga',0
|
||||||
|
|
||||||
|
class1d:
|
||||||
|
dw offset subclass10
|
||||||
|
dw offset subclass11
|
||||||
|
dw offset subclass12
|
||||||
|
dw offset subclass13
|
||||||
|
dw offset subclass14
|
||||||
|
subclass10 db 'scsi',0
|
||||||
|
subclass11 db 'ide',0
|
||||||
|
subclass12 db 'disquette',0
|
||||||
|
subclass13 db 'ipi',0
|
||||||
|
subclass14 db 'raid',0
|
||||||
|
|
||||||
|
class2d:
|
||||||
|
dw offset subclass20
|
||||||
|
dw offset subclass21
|
||||||
|
dw offset subclass22
|
||||||
|
dw offset subclass23
|
||||||
|
dw offset subclass24
|
||||||
|
subclass20 db 'ethernet',0
|
||||||
|
subclass21 db 'token ring',0
|
||||||
|
subclass22 db 'fddi',0
|
||||||
|
subclass23 db 'atm',0
|
||||||
|
subclass24 db 'isdn',0
|
||||||
|
|
||||||
|
class3d:
|
||||||
|
dw offset subclass30
|
||||||
|
dw offset subclass31
|
||||||
|
dw offset subclass32
|
||||||
|
subclass30 db 'vga',0
|
||||||
|
subclass31 db 'xga',0
|
||||||
|
subclass32 db '3D',0
|
||||||
|
|
||||||
|
class4d:
|
||||||
|
dw offset subclass40
|
||||||
|
dw offset subclass41
|
||||||
|
dw offset subclass42
|
||||||
|
subclass40 db 'video',0
|
||||||
|
subclass41 db 'audio',0
|
||||||
|
subclass42 db 'telephonie',0
|
||||||
|
|
||||||
|
class5d:
|
||||||
|
dw offset subclass50
|
||||||
|
dw offset subclass51
|
||||||
|
subclass50 db 'ram',0
|
||||||
|
subclass51 db 'flash',0
|
||||||
|
|
||||||
|
class6d:
|
||||||
|
dw offset subclass60
|
||||||
|
dw offset subclass61
|
||||||
|
dw offset subclass62
|
||||||
|
dw offset subclass63
|
||||||
|
dw offset subclass64
|
||||||
|
dw offset subclass65
|
||||||
|
dw offset subclass66
|
||||||
|
dw offset subclass67
|
||||||
|
dw offset subclass68
|
||||||
|
subclass60 db 'hote',0
|
||||||
|
subclass61 db 'isa',0
|
||||||
|
subclass62 db 'eisa',0
|
||||||
|
subclass63 db 'mca',0
|
||||||
|
subclass64 db 'pci',0
|
||||||
|
subclass65 db 'pcmcia',0
|
||||||
|
subclass66 db 'nubus',0
|
||||||
|
subclass67 db 'cardbus',0
|
||||||
|
subclass68 db 'RACEway',0
|
||||||
|
|
||||||
|
class7d:
|
||||||
|
dw offset subclass70
|
||||||
|
dw offset subclass71
|
||||||
|
dw offset subclass72
|
||||||
|
dw offset subclass73
|
||||||
|
subclass70 db 'serie',0
|
||||||
|
subclass71 db 'parallele',0
|
||||||
|
subclass72 db 'serie multiport',0
|
||||||
|
subclass73 db 'modem',0
|
||||||
|
|
||||||
|
class8d:
|
||||||
|
dw offset subclass80
|
||||||
|
dw offset subclass81
|
||||||
|
dw offset subclass82
|
||||||
|
dw offset subclass83
|
||||||
|
dw offset subclass84
|
||||||
|
subclass80 db 'pic',0
|
||||||
|
subclass81 db 'dma',0
|
||||||
|
subclass82 db 'timer',0
|
||||||
|
subclass83 db 'rtc',0
|
||||||
|
subclass84 db 'hotplug',0
|
||||||
|
|
||||||
|
class9d:
|
||||||
|
dw offset subclass90
|
||||||
|
dw offset subclass91
|
||||||
|
dw offset subclass92
|
||||||
|
dw offset subclass93
|
||||||
|
dw offset subclass94
|
||||||
|
subclass90 db 'clavier',0
|
||||||
|
subclass91 db 'stylo',0
|
||||||
|
subclass92 db 'souris',0
|
||||||
|
subclass93 db 'scanner',0
|
||||||
|
subclass94 db 'joystick',0
|
||||||
|
|
||||||
|
class10d:
|
||||||
|
dw offset subclass100
|
||||||
|
subclass100 db 'station',0
|
||||||
|
|
||||||
|
class11d:
|
||||||
|
dw offset subclass110
|
||||||
|
dw offset subclass111
|
||||||
|
dw offset subclass112
|
||||||
|
dw offset subclass113
|
||||||
|
dw offset subclass114
|
||||||
|
subclass110 db '386',0
|
||||||
|
subclass111 db '486',0
|
||||||
|
subclass112 db 'pentium',0
|
||||||
|
subclass113 db 'alpha',0
|
||||||
|
subclass114 db 'coprocesseur',0
|
||||||
|
|
||||||
|
class12d:
|
||||||
|
dw offset subclass120
|
||||||
|
dw offset subclass121
|
||||||
|
dw offset subclass122
|
||||||
|
dw offset subclass123
|
||||||
|
dw offset subclass124
|
||||||
|
dw offset subclass125
|
||||||
|
subclass120 db 'firewire',0
|
||||||
|
subclass121 db 'access',0
|
||||||
|
subclass122 db 'ssa',0
|
||||||
|
subclass123 db 'usb',0
|
||||||
|
subclass124 db 'fibre',0
|
||||||
|
subclass125 db 'smbus',0
|
||||||
|
|
||||||
|
class13d:
|
||||||
|
dw offset subclass130
|
||||||
|
dw offset subclass131
|
||||||
|
dw offset subclass132
|
||||||
|
subclass130 db 'irda',0
|
||||||
|
subclass131 db 'ir',0
|
||||||
|
subclass132 db 'rf',0
|
||||||
|
|
||||||
|
class14d:
|
||||||
|
dw offset subclass140
|
||||||
|
subclass140 db 'IO arch',0
|
||||||
|
|
||||||
|
class15d:
|
||||||
|
dw offset subclass150
|
||||||
|
dw offset subclass151
|
||||||
|
dw offset subclass152
|
||||||
|
dw offset subclass153
|
||||||
|
subclass150 db 'tv',0
|
||||||
|
subclass151 db 'audio',0
|
||||||
|
subclass152 db 'voix',0
|
||||||
|
subclass153 db 'donnees',0
|
||||||
|
|
||||||
|
class16d:
|
||||||
|
dw offset subclass160
|
||||||
|
dw offset subclass161
|
||||||
|
subclass160 db 'reseau',0
|
||||||
|
subclass161 db 'jeux',0
|
||||||
|
|
||||||
|
class17d:
|
||||||
|
dw offset subclass170
|
||||||
|
subclass170 db 'dpio',0
|
||||||
|
|
||||||
|
|
||||||
|
;bx pci version, cl nbbus, al pci type
|
||||||
|
getPciInfos:
|
||||||
|
push dx
|
||||||
|
mov ax,0B101h
|
||||||
|
xor edi,edi
|
||||||
|
mov edx," PCI"
|
||||||
|
int 1Ah
|
||||||
|
jc ErrorPci
|
||||||
|
cmp dx,04350h
|
||||||
|
jne ErrorPci
|
||||||
|
clc
|
||||||
|
pop dx
|
||||||
|
ret
|
||||||
|
errorpci:
|
||||||
|
stc
|
||||||
|
pop dx
|
||||||
|
ret
|
||||||
|
|
||||||
|
;al=bus cl=deviceid ch=func es:di
|
||||||
|
Getallfunctionsinfos:
|
||||||
|
push ax bx dx di
|
||||||
|
cmp ch,0
|
||||||
|
je amultiorfirst
|
||||||
|
mov bl,0Eh
|
||||||
|
push cx
|
||||||
|
xor ch,ch
|
||||||
|
call getfunctioninfo
|
||||||
|
pop cx
|
||||||
|
and dl,80h
|
||||||
|
cmp dl,0
|
||||||
|
jne amultiorfirst
|
||||||
|
mov word ptr [di],0000h
|
||||||
|
jmp notexist
|
||||||
|
amultiorfirst:
|
||||||
|
xor bl,bl
|
||||||
|
goinfos:
|
||||||
|
call getfunctioninfo
|
||||||
|
inc bl
|
||||||
|
cmp bl,2
|
||||||
|
ja notzarb
|
||||||
|
cmp dl,0FFh
|
||||||
|
je notexist
|
||||||
|
notzarb:
|
||||||
|
mov es:[di],dl
|
||||||
|
inc di
|
||||||
|
cmp bl,255
|
||||||
|
jb goinfos
|
||||||
|
pop di
|
||||||
|
push di
|
||||||
|
cmp word ptr [di],0000h
|
||||||
|
je notexist
|
||||||
|
clc
|
||||||
|
pop di dx bx ax
|
||||||
|
ret
|
||||||
|
notexist:
|
||||||
|
stc
|
||||||
|
pop di dx bx ax
|
||||||
|
ret
|
||||||
|
|
||||||
|
; PCI TYPE 1
|
||||||
|
;*******************************************************************
|
||||||
|
config1_addr equ 0CF8h
|
||||||
|
config1_data equ 0CFCh
|
||||||
|
|
||||||
|
pci_type1_detect:
|
||||||
|
mov dx, config1_addr+3
|
||||||
|
mov al, 01h
|
||||||
|
out dx,al
|
||||||
|
mov dx,config1_addr
|
||||||
|
in eax,dx
|
||||||
|
mov ecx,eax
|
||||||
|
mov eax,80000000h
|
||||||
|
out dx,eax
|
||||||
|
in eax,dx
|
||||||
|
cmp eax,80000000h
|
||||||
|
jne endofdetectiontype1
|
||||||
|
mov eax,ecx
|
||||||
|
out dx,eax
|
||||||
|
endofdetectiontype1:
|
||||||
|
ret
|
||||||
|
|
||||||
|
;al=bus bl=index cl=deviceid ch=func->dl
|
||||||
|
getfunctioninfo:
|
||||||
|
push eax bx cx
|
||||||
|
mov ah,80h
|
||||||
|
shl eax,16
|
||||||
|
mov ah,cl
|
||||||
|
shl ah,3
|
||||||
|
or ah,ch
|
||||||
|
mov al,bl
|
||||||
|
and al,0fch
|
||||||
|
mov dx,0cf8h
|
||||||
|
out dx,eax
|
||||||
|
mov dx,0CFCh
|
||||||
|
and bl,3
|
||||||
|
or dl,bl
|
||||||
|
in al,dx
|
||||||
|
mov dl,al
|
||||||
|
pop cx bx eax
|
||||||
|
ret
|
||||||
|
|
||||||
|
|
||||||
|
; PCI TYPE 2
|
||||||
|
;*******************************************************************
|
||||||
|
config2_reg0 equ 0CFBh
|
||||||
|
config2_reg1 equ 0CF8h
|
||||||
|
config2_reg2 equ 0CFAh
|
||||||
|
|
||||||
|
pci_type2_detect:
|
||||||
|
xor ax,ax
|
||||||
|
mov dx,config2_reg0
|
||||||
|
out dx,ax
|
||||||
|
mov dx,config2_reg1
|
||||||
|
out dx,ax
|
||||||
|
mov dx,config2_reg2
|
||||||
|
out dx,ax
|
||||||
|
mov ax,config2_reg1
|
||||||
|
in al,dx
|
||||||
|
cmp al,0
|
||||||
|
jne endofdetectiontype2
|
||||||
|
mov ax,config2_reg0
|
||||||
|
in al,dx
|
||||||
|
cmp al,0
|
||||||
|
jne endofdetectiontype2
|
||||||
|
endofdetectiontype2:
|
||||||
|
ret
|
||||||
|
|
||||||
|
imports:
|
||||||
|
db "VIDEO.LIB::print",0
|
||||||
|
print dd 0
|
||||||
|
dw 0
|
||||||
|
|
||||||
|
end start
|
|
@ -1,350 +1,373 @@
|
||||||
model tiny,stdcall
|
.model tiny
|
||||||
p586N
|
.486
|
||||||
locals
|
smart
|
||||||
jumps
|
.code
|
||||||
codeseg
|
|
||||||
option procalign:byte
|
|
||||||
|
|
||||||
include "..\include\mem.h"
|
|
||||||
include "..\include\divers.h"
|
|
||||||
include "..\include\graphic.h"
|
|
||||||
|
|
||||||
org 0h
|
org 0h
|
||||||
|
|
||||||
|
include ..\include\mem.h
|
||||||
|
|
||||||
start:
|
start:
|
||||||
header exe <"CE",1,0,0,,offset imports,,offset realstart>
|
header exe <,1,0,,,offset imports,,>
|
||||||
|
|
||||||
realstart:
|
realstart:
|
||||||
mov ax,0305h
|
mov ax,0305h
|
||||||
mov bx,0008h
|
mov bx,0008h
|
||||||
int 16h
|
int 16h
|
||||||
call [savestate]
|
mov ah,28h
|
||||||
call [setvideomode],2
|
int 47h
|
||||||
xor ebp,ebp
|
mov ax,0002
|
||||||
xor ax,ax
|
int 47H
|
||||||
mov fs,ax
|
mov ah,2
|
||||||
call [disablescroll]
|
int 47h
|
||||||
adres:
|
xor ebp,ebp
|
||||||
call [saveparamto],offset infos
|
xor ax,ax
|
||||||
mov al,[infos.lines]
|
mov fs,ax
|
||||||
dec al
|
mov ah,43
|
||||||
mov [lastline],al
|
int 47h
|
||||||
mov al,[infos.columns]
|
Adres:
|
||||||
sub al,16
|
mov di,offset infos
|
||||||
mov bl,al
|
mov ah,34
|
||||||
shr al,2
|
int 47h
|
||||||
mov [sizex],al
|
dec byte ptr [di]
|
||||||
and bl,11b
|
mov al,[di+1]
|
||||||
mov [sizex2],bl
|
sub al,16
|
||||||
mov al,[infos.mode]
|
mov bl,al
|
||||||
cmp al,[oldmode]
|
shr al,2
|
||||||
je noinit
|
mov [di+1],al
|
||||||
call [clearscreen]
|
and bl,11b
|
||||||
mov [oldmode],al
|
mov [di+2],bl
|
||||||
noinit:
|
mov al,[di+7]
|
||||||
call [setxy],0,0
|
cmp al,oldmode
|
||||||
mov edi,ebp
|
je noinit
|
||||||
mov bh,[lastline]
|
mov ah,2
|
||||||
|
int 47h
|
||||||
|
mov oldmode,al
|
||||||
|
noinit:
|
||||||
|
mov bx,0
|
||||||
|
mov ah,25
|
||||||
|
int 47h
|
||||||
|
mov bh,infos
|
||||||
|
mov edi,ebp
|
||||||
lines:
|
lines:
|
||||||
xor edx,edx
|
xor edx,edx
|
||||||
mov dx,di
|
mov dx,di
|
||||||
push edx
|
push edx
|
||||||
mov edx,edi
|
mov edx,edi
|
||||||
shr edx,4*4
|
shr edx,4*4
|
||||||
shl edx,4*3
|
shl edx,4*3
|
||||||
push edx
|
push edx
|
||||||
push offset spaces
|
push offset spaces
|
||||||
call [print]
|
call [print]
|
||||||
mov dx,di
|
mov dx,di
|
||||||
mov al,[sizex]
|
mov al,infos+1
|
||||||
mov esi,edi
|
mov esi,edi
|
||||||
doaline:
|
doaline:
|
||||||
mov edx,edi
|
mov edx,edi
|
||||||
shr edx,4*4
|
shr edx,4*4
|
||||||
shl edx,4*3
|
shl edx,4*3
|
||||||
mov fs,dx
|
mov fs,dx
|
||||||
push [dword ptr fs:di]
|
push dword ptr fs:[di]
|
||||||
push 8
|
push 8
|
||||||
call [showhex]
|
call [showhex]
|
||||||
call [showchar],' '
|
push ' '
|
||||||
inc edi
|
call [showchar]
|
||||||
dec al
|
inc edi
|
||||||
jnz doaline
|
dec al
|
||||||
mov edi,esi
|
jnz doaline
|
||||||
push offset spaces2
|
mov edi,esi
|
||||||
call [print]
|
push offset spaces2
|
||||||
mov al,[sizex]
|
call [print]
|
||||||
|
mov al,infos+1
|
||||||
doaline2:
|
doaline2:
|
||||||
mov edx,edi
|
mov edx,edi
|
||||||
shr edx,4*4
|
shr edx,4*4
|
||||||
shl edx,4*3
|
shl edx,4*3
|
||||||
mov fs,dx
|
mov fs,dx
|
||||||
push [word ptr fs:di]
|
push word ptr fs:[di]
|
||||||
call [showchar]
|
call [showchar]
|
||||||
inc edi
|
inc edi
|
||||||
dec al
|
dec al
|
||||||
jnz doaline2
|
jnz doaline2
|
||||||
dec bh
|
dec bh
|
||||||
je outes
|
je outes
|
||||||
cmp [sizex2],0
|
cmp byte ptr infos+2,0
|
||||||
je lines
|
je lines
|
||||||
call [addline]
|
mov ah,6
|
||||||
jmp lines
|
int 47h
|
||||||
outes:
|
jmp lines
|
||||||
call [setxy],0,[word ptr lastline]
|
outes:
|
||||||
call [print],offset menu
|
mov bh,0
|
||||||
waitkey:
|
mov bl,infos
|
||||||
mov ax,0
|
mov ah,25
|
||||||
int 16h
|
int 47h
|
||||||
cmp ax,3B00h
|
push offset menu
|
||||||
jne suit
|
call [print]
|
||||||
inc ebp
|
waitkey:
|
||||||
jmp adres
|
mov ax,0
|
||||||
suit:
|
int 16h
|
||||||
cmp ax,3C00h
|
cmp ax,3B00h
|
||||||
jne suit2
|
jne suit
|
||||||
dec ebp
|
inc ebp
|
||||||
jmp adres
|
jmp adres
|
||||||
suit2:
|
suit:
|
||||||
cmp ax,3D00h
|
cmp ax,3C00h
|
||||||
jne suit3
|
jne suit2
|
||||||
add ebp,24*16
|
dec ebp
|
||||||
jmp adres
|
jmp adres
|
||||||
suit3:
|
suit2:
|
||||||
cmp ax,3E00h
|
cmp ax,3D00h
|
||||||
jne suit4
|
jne suit3
|
||||||
sub ebp,24*16
|
add ebp,24*16
|
||||||
jmp adres
|
jmp adres
|
||||||
suit4:
|
suit3:
|
||||||
cmp ax,3F00h
|
cmp ax,3E00h
|
||||||
jne suit5
|
jne suit4
|
||||||
add ebp,010000h
|
sub ebp,24*16
|
||||||
jmp adres
|
jmp adres
|
||||||
suit5:
|
suit4:
|
||||||
cmp ax,4000h
|
cmp ax,3F00h
|
||||||
jne suit6
|
jne suit5
|
||||||
sub ebp,010000h
|
add ebp,010000h
|
||||||
jmp adres
|
jmp adres
|
||||||
suit6:
|
suit5:
|
||||||
cmp ax,4100h
|
cmp ax,4000h
|
||||||
jne suit7
|
jne suit6
|
||||||
mov [dword ptr pope],'TIDE'
|
sub ebp,010000h
|
||||||
call [setxy],0,[word ptr lastline]
|
jmp adres
|
||||||
call [print],offset menu
|
suit6:
|
||||||
mov ax,0B800h
|
cmp ax,4100h
|
||||||
mov es,ax
|
jne suit7
|
||||||
mov [xxyy2],3
|
mov dword ptr [pope],'TIDE'
|
||||||
mov [xxyy],3
|
mov bh,0
|
||||||
call calc1
|
mov bl,infos
|
||||||
call calc2
|
mov ah,25
|
||||||
|
int 47h
|
||||||
|
push offset menu
|
||||||
|
call [print]
|
||||||
|
mov ax,0B800h
|
||||||
|
mov es,ax
|
||||||
|
mov xxyy2,3
|
||||||
|
mov xxyy,3
|
||||||
|
call calc1
|
||||||
|
call calc2
|
||||||
waitst:
|
waitst:
|
||||||
mov ax,0
|
mov ax,0
|
||||||
int 16h
|
int 16h
|
||||||
cmp ah,41h
|
cmp ah,41h
|
||||||
jne tre
|
jne tre
|
||||||
mov [dword ptr pope],' EUV'
|
mov dword ptr [pope],' EUV'
|
||||||
push cs
|
push cs
|
||||||
pop es
|
pop es
|
||||||
jmp adres
|
jmp adres
|
||||||
tre:
|
tre:
|
||||||
cmp al,0
|
cmp al,0
|
||||||
jne write
|
jne write
|
||||||
cmp ah,48h
|
cmp ah,48h
|
||||||
jne tre1
|
jne tre1
|
||||||
cmp [yy],0
|
cmp yy,0
|
||||||
je waitst
|
je waitst
|
||||||
dec [yy]
|
dec yy
|
||||||
jmp cursor
|
jmp cursor
|
||||||
tre1:
|
tre1:
|
||||||
cmp ah,50h
|
cmp ah,50h
|
||||||
jne tre2
|
jne tre2
|
||||||
mov al,[lastline]
|
mov al,infos
|
||||||
dec al
|
dec al
|
||||||
xor ah,ah
|
xor ah,ah
|
||||||
cmp [yy],ax
|
cmp yy,ax
|
||||||
je waitst
|
je waitst
|
||||||
inc [yy]
|
inc yy
|
||||||
jmp cursor
|
jmp cursor
|
||||||
tre2:
|
tre2:
|
||||||
cmp ah,4Dh
|
cmp ah,4Dh
|
||||||
jne tre4
|
jne tre4
|
||||||
cmp [xx],15
|
cmp xx,15
|
||||||
je waitst
|
je waitst
|
||||||
inc [xx]
|
inc xx
|
||||||
jmp cursor
|
jmp cursor
|
||||||
tre4:
|
tre4:
|
||||||
cmp ah,4Bh
|
cmp ah,4Bh
|
||||||
jne waitst
|
jne waitst
|
||||||
cmp [xx],0
|
cmp xx,0
|
||||||
je waitst
|
je waitst
|
||||||
dec [xx]
|
dec xx
|
||||||
jmp cursor
|
jmp cursor
|
||||||
write:
|
write:
|
||||||
call asciihex2dec
|
call AsciiHex2dec
|
||||||
cmp cl,15
|
cmp cl,15
|
||||||
ja waitst
|
ja waitst
|
||||||
call calc1
|
call calc1
|
||||||
call calc2
|
call calc2
|
||||||
mov edi,[es:bx-1]
|
mov edi,es:[bx-1]
|
||||||
mov dx,[es:si-1]
|
mov dx,es:[si-1]
|
||||||
mov [byte ptr es:bx],0112
|
mov byte ptr es:[bx],0112
|
||||||
mov [es:bx-1],al
|
mov es:[bx-1],al
|
||||||
writs:
|
writs:
|
||||||
mov ax,0
|
mov ax,0
|
||||||
int 16H
|
int 16H
|
||||||
mov ch,cl
|
mov ch,cl
|
||||||
call asciihex2dec
|
call AsciiHex2dec
|
||||||
cmp cl,15
|
cmp cl,15
|
||||||
ja writs
|
ja writs
|
||||||
shl ch,4
|
shl ch,4
|
||||||
add ch,cl
|
add ch,cl
|
||||||
mov [es:bx+1],al
|
mov es:[bx+1],al
|
||||||
mov [es:si-1],ch
|
mov es:[si-1],ch
|
||||||
mov ax,bx
|
mov ax,bx
|
||||||
call calc3
|
call calc3
|
||||||
mov [gs:bx],ch
|
mov gs:[bx],ch
|
||||||
pusha
|
pusha
|
||||||
popa
|
popa
|
||||||
mov cl,[gs:bx]
|
mov cl,gs:[bx]
|
||||||
cmp ch,cl
|
cmp ch,cl
|
||||||
je no
|
je no
|
||||||
push si ax
|
push si ax
|
||||||
call [setxy],0,[word ptr lastline]
|
mov bh,0
|
||||||
call [print],offset msg
|
mov bl,infos
|
||||||
mov ax,0
|
mov ah,25
|
||||||
int 16h
|
int 47h
|
||||||
call [setxy],0,[word ptr lastline]
|
push offset msg
|
||||||
call [print],offset menu
|
call [print]
|
||||||
pop bx si
|
mov ax,0
|
||||||
mov [es:bx-1],edi
|
int 16h
|
||||||
mov [es:si-1],dx
|
mov bh,0
|
||||||
no:
|
mov bl,infos
|
||||||
inc [xx]
|
mov ah,25
|
||||||
cmp [xx],16
|
int 47h
|
||||||
jne pasde
|
push offset menu
|
||||||
inc [yy]
|
call [print]
|
||||||
mov [xx],0h
|
pop bx si
|
||||||
pasde:
|
mov es:[bx-1],edi
|
||||||
call calc1
|
mov es:[si-1],dx
|
||||||
call calc2
|
no:
|
||||||
jmp waitst
|
|
||||||
cursor:
|
|
||||||
call calc1
|
|
||||||
call calc2
|
|
||||||
jmp waitst
|
|
||||||
suit7:
|
|
||||||
cmp ax,4200h
|
|
||||||
jne adres
|
|
||||||
call [restorestate]
|
|
||||||
retf
|
|
||||||
calc1:
|
|
||||||
push ax dx si
|
|
||||||
mov ax,[xx]
|
|
||||||
mov dx,[xx]
|
|
||||||
shl ax,2
|
|
||||||
shl dx,1
|
|
||||||
add ax,dx
|
|
||||||
add ax,27
|
|
||||||
mov bx,[yy]
|
|
||||||
mov dx,[yy]
|
|
||||||
shl bx,5
|
|
||||||
shl dx,7
|
|
||||||
add bx,dx
|
|
||||||
add bx,ax
|
|
||||||
mov [byte ptr es:bx],112
|
|
||||||
mov [byte ptr es:bx+2],112
|
|
||||||
mov si,[xxyy]
|
|
||||||
mov [byte ptr es:si],07
|
|
||||||
mov [byte ptr es:si+2],07
|
|
||||||
mov [xxyy],bx
|
|
||||||
pop si dx ax
|
|
||||||
ret
|
|
||||||
calc2:
|
|
||||||
push ax bx dx
|
|
||||||
mov si,[yy]
|
|
||||||
mov dx,[yy]
|
|
||||||
shl si,5
|
|
||||||
shl dx,7
|
|
||||||
add si,dx
|
|
||||||
mov dx,[xx]
|
|
||||||
shl dx,1
|
|
||||||
add si,dx
|
|
||||||
add si,129
|
|
||||||
mov [byte ptr es:si],112
|
|
||||||
mov bx,[xxyy2]
|
|
||||||
mov [byte ptr es:bx],07
|
|
||||||
mov [xxyy2],si
|
|
||||||
pop dx bx ax
|
|
||||||
ret
|
|
||||||
calc3:
|
|
||||||
push dx
|
|
||||||
xor ebx,ebx
|
|
||||||
mov bx,[xx]
|
|
||||||
mov dx,[yy]
|
|
||||||
shl dx,4
|
|
||||||
add bx,dx
|
|
||||||
add ebx,ebp
|
|
||||||
mov edx,ebx
|
|
||||||
shr edx,4*4
|
|
||||||
shl edx,4*3
|
|
||||||
mov gs,dx
|
|
||||||
pop dx
|
|
||||||
ret
|
|
||||||
asciihex2dec:
|
|
||||||
cmp al,'a'
|
|
||||||
jb nomin
|
|
||||||
cmp al,'f'
|
|
||||||
ja nomin
|
|
||||||
sub al,'a'-'A'
|
|
||||||
jmp ismaj
|
|
||||||
nomin:
|
|
||||||
cmp al,'A'
|
|
||||||
jb nomaj
|
|
||||||
cmp al,'F'
|
|
||||||
ja nomaj
|
|
||||||
ismaj:
|
|
||||||
mov cl,al
|
|
||||||
sub cl,'A'-10
|
|
||||||
jmp endt
|
|
||||||
nomaj:
|
|
||||||
mov cl,al
|
|
||||||
sub cl,'0'
|
|
||||||
endt:
|
|
||||||
ret
|
|
||||||
|
|
||||||
|
inc xx
|
||||||
|
cmp xx,16
|
||||||
|
jne pasde
|
||||||
|
inc yy
|
||||||
|
mov xx,0h
|
||||||
|
pasde:
|
||||||
|
call calc1
|
||||||
|
call calc2
|
||||||
|
jmp waitst
|
||||||
|
|
||||||
|
cursor:
|
||||||
|
call calc1
|
||||||
|
call calc2
|
||||||
|
jmp waitst
|
||||||
|
suit7:
|
||||||
|
cmp ax,4200h
|
||||||
|
jne adres
|
||||||
|
mov ah,29h
|
||||||
|
int 47h
|
||||||
|
retf
|
||||||
|
|
||||||
|
calc1:
|
||||||
|
push ax dx si
|
||||||
|
mov ax,xx
|
||||||
|
mov dx,xx
|
||||||
|
shl ax,2
|
||||||
|
shl dx,1
|
||||||
|
add ax,dx
|
||||||
|
add ax,27
|
||||||
|
mov bx,YY
|
||||||
|
mov dx,yy
|
||||||
|
shl bx,5
|
||||||
|
shl dx,7
|
||||||
|
add bx,dx
|
||||||
|
add bx,ax
|
||||||
|
mov byte ptr es:[bx],112
|
||||||
|
mov byte ptr es:[bx+2],112
|
||||||
|
mov si,xxyy
|
||||||
|
mov byte ptr es:[si],07
|
||||||
|
mov byte ptr es:[si+2],07
|
||||||
|
mov xxyy,bx
|
||||||
|
pop si dx ax
|
||||||
|
ret
|
||||||
|
|
||||||
|
calc2:
|
||||||
|
push ax bx dx
|
||||||
|
mov si,YY
|
||||||
|
mov dx,yy
|
||||||
|
shl si,5
|
||||||
|
shl dx,7
|
||||||
|
add si,dx
|
||||||
|
mov dx,xx
|
||||||
|
shl dx,1
|
||||||
|
add si,dx
|
||||||
|
add si,129
|
||||||
|
mov byte ptr es:[si],112
|
||||||
|
mov bx,xxyy2
|
||||||
|
mov byte ptr es:[bx],07
|
||||||
|
mov xxyy2,si
|
||||||
|
pop dx bx ax
|
||||||
|
ret
|
||||||
|
|
||||||
|
calc3:
|
||||||
|
push dx
|
||||||
|
xor ebx,ebx
|
||||||
|
mov bx,xx
|
||||||
|
mov dx,yy
|
||||||
|
shl dx,4
|
||||||
|
add bx,dx
|
||||||
|
add ebx,ebp
|
||||||
|
mov edx,ebx
|
||||||
|
shr edx,4*4
|
||||||
|
shl edx,4*3
|
||||||
|
mov gs,dx
|
||||||
|
pop dx
|
||||||
|
ret
|
||||||
|
|
||||||
|
asciihex2dec:
|
||||||
|
cmp al,'a'
|
||||||
|
jb nomin
|
||||||
|
cmp al,'f'
|
||||||
|
ja nomin
|
||||||
|
sub al,'a'-'A'
|
||||||
|
jmp ismaj
|
||||||
|
nomin:
|
||||||
|
cmp al,'A'
|
||||||
|
jb nomaj
|
||||||
|
cmp al,'F'
|
||||||
|
ja nomaj
|
||||||
|
ismaj:
|
||||||
|
mov cl,al
|
||||||
|
sub cl,'A'-10
|
||||||
|
jmp endt
|
||||||
|
nomaj:
|
||||||
|
mov cl,al
|
||||||
|
sub cl,'0'
|
||||||
|
endt:
|
||||||
|
ret
|
||||||
|
|
||||||
|
dep db ':',0
|
||||||
|
sect dw 0
|
||||||
xx dw 0
|
xx dw 0
|
||||||
yy dw 0
|
yy dw 0
|
||||||
xxyy dw 3
|
xxyy dw 3
|
||||||
xxyy2 dw 3
|
xxyy2 dw 3
|
||||||
|
|
||||||
lastline db 0
|
|
||||||
sizex db 0
|
|
||||||
sizex2 db 0
|
|
||||||
|
|
||||||
dep db ':',0
|
|
||||||
msg db '\c74Erreur : zone non modifiable (ROM) pressez une touche pour continuer ',0
|
msg db '\c74Erreur : zone non modifiable (ROM) pressez une touche pour continuer ',0
|
||||||
menu db '\c70haut/bas [F1/2] Offset [F3/4] Segment [F5/6] Mode F7, Quitter F8 MODE '
|
menu db '\c70haut/bas [F1/2] Offset [F3/4] Segment [F5/6] Mode F7, Quitter F8 MODE '
|
||||||
pope db 'VUE ',0
|
pope db 'VUE ',0
|
||||||
spaces db '\c02%hW:%hW \c04| \c07',0
|
spaces db '\c02%hW:%hW \c04| \c07',0
|
||||||
spaces2 db '\c04 | \c07',0
|
spaces2 db '\c04 | \c07',0
|
||||||
|
|
||||||
showbuffer db 35 dup (0FFh)
|
showbuffer db 35 dup (0FFh)
|
||||||
oldmode db 0
|
oldmode db 0
|
||||||
infos vgainf <>
|
infos db 40 dup (0)
|
||||||
|
|
||||||
importing
|
imports:
|
||||||
use VIDEO,setvideomode
|
db "VIDEO.LIB::print",0
|
||||||
use VIDEO,savestate
|
print dd 0
|
||||||
use VIDEO,restorestate
|
db "VIDEO.LIB::showhex",0
|
||||||
use VIDEO,setxy
|
showhex dd 0
|
||||||
use VIDEO,addline
|
db "VIDEO.LIB::showchar",0
|
||||||
use VIDEO,saveparamto
|
showchar dd 0
|
||||||
use VIDEO,disablescroll
|
dw 0
|
||||||
use VIDEO,clearscreen
|
|
||||||
use VIDEO.LIB,print
|
end start
|
||||||
use VIDEO.LIB,showhex
|
|
||||||
use VIDEO.LIB,showchar
|
|
||||||
endi
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,26 +1,29 @@
|
||||||
model tiny,stdcall
|
.model small
|
||||||
p586N
|
.486
|
||||||
locals
|
smart
|
||||||
jumps
|
.code
|
||||||
codeseg
|
|
||||||
option procalign:byte
|
|
||||||
|
|
||||||
include "..\include\mem.h"
|
|
||||||
include "..\include\divers.h"
|
|
||||||
|
|
||||||
org 0h
|
org 0h
|
||||||
|
|
||||||
|
include ..\include\mem.h
|
||||||
|
|
||||||
start:
|
start:
|
||||||
header exe <"CE",1,0,0,,offset imports,,offset realstart>
|
header exe <,1,0,,,offset imports,offset exports,>
|
||||||
|
|
||||||
realstart:
|
realstart:
|
||||||
call [print],offset message
|
push offset message
|
||||||
call [waitkey]
|
call [affiche]
|
||||||
retf
|
call [waitkey]
|
||||||
|
retf
|
||||||
|
|
||||||
message db 'Appel de la librairie \c02video\c07 et de la librairie \c02EXEM-LIB.LIB\c07 !',0
|
message db 'Appel de la librairie video !',0
|
||||||
|
|
||||||
importing
|
|
||||||
use VIDEO.LIB,print
|
imports:
|
||||||
use EXEM-LIB.LIB,waitkey
|
db "VIDEO.LIB::print",0
|
||||||
endi
|
affiche dd 0
|
||||||
|
db "EXEM-LIB.LIB::waitkey",0
|
||||||
|
waitkey dd 0
|
||||||
|
dw 0
|
||||||
|
exports:
|
||||||
|
|
||||||
|
end start
|
||||||
|
|
|
@ -1,24 +1,25 @@
|
||||||
model tiny,stdcall
|
.model tiny
|
||||||
p586N
|
.486
|
||||||
locals
|
smart
|
||||||
jumps
|
.code
|
||||||
codeseg
|
|
||||||
option procalign:byte
|
|
||||||
|
|
||||||
include "..\include\mem.h"
|
|
||||||
include "..\include\divers.h"
|
|
||||||
|
|
||||||
org 0h
|
org 0h
|
||||||
|
|
||||||
|
include ..\include\mem.h
|
||||||
|
|
||||||
start:
|
start:
|
||||||
header exe <"CE",1,0,0,offset exports,,,>
|
header exe <,1,0,,,offset imports,offset exports,>
|
||||||
|
|
||||||
waitkey:
|
|
||||||
mov ax,0
|
|
||||||
int 16h
|
|
||||||
retf
|
|
||||||
|
|
||||||
exporting
|
getvar2:
|
||||||
|
mov ax,0
|
||||||
|
int 16h
|
||||||
|
retf
|
||||||
|
|
||||||
declare waitkey
|
|
||||||
ende
|
imports:
|
||||||
|
|
||||||
|
exports:
|
||||||
|
db "waitkey",0
|
||||||
|
dw getvar2
|
||||||
|
dw 0
|
||||||
|
end start
|
||||||
|
|
|
@ -1,100 +1,94 @@
|
||||||
model tiny,stdcall
|
.model tiny
|
||||||
p586N
|
.486
|
||||||
locals
|
smart
|
||||||
jumps
|
.code
|
||||||
codeseg
|
|
||||||
option procalign:byte
|
|
||||||
|
|
||||||
include "..\include\mem.h"
|
|
||||||
include "..\include\fat.h"
|
|
||||||
include "..\include\divers.h"
|
|
||||||
include "..\include\graphic.h"
|
|
||||||
|
|
||||||
org 0h
|
org 0h
|
||||||
|
|
||||||
|
include ..\include\mem.h
|
||||||
|
include ..\include\fat.h
|
||||||
|
|
||||||
start:
|
start:
|
||||||
header exe <"CE",1,0,0,,offset imports,,offset realstart>
|
header exe <,1,0,,,offset imports,,>
|
||||||
|
|
||||||
realstart:
|
realstart:
|
||||||
call [saveparamto],offset infos
|
push offset msg1
|
||||||
call [print],offset msg1
|
call [print]
|
||||||
call [initdrive]
|
|
||||||
xor bp,bp
|
mov ah,3
|
||||||
call [findfirstfile],offset bufferentry
|
int 48h
|
||||||
jc nofiles
|
xor bp,bp
|
||||||
|
mov di,offset bufferentry
|
||||||
|
mov ah,7
|
||||||
|
int 48h
|
||||||
|
jc nofiles
|
||||||
go:
|
go:
|
||||||
push [word bufferentry.result.fileattr]
|
push word ptr [di+Entries.FileAttr]
|
||||||
push [bufferentry.result.filesize]
|
push dword ptr [di+Entries.FileSize]
|
||||||
push [bufferentry.result.filetime]
|
push word ptr [di+Entries.FileTime]
|
||||||
push [bufferentry.result.filedate]
|
push word ptr [di+Entries.FileDate]
|
||||||
push [bufferentry.result.filetimecrea]
|
push word ptr [di+Entries.FileTimeCrea]
|
||||||
push [bufferentry.result.filedatecrea]
|
push word ptr [di+Entries.FileDateCrea]
|
||||||
mov bx,offset bufferentry.result.filename
|
push di
|
||||||
push bx
|
push offset line
|
||||||
push offset line
|
call [print]
|
||||||
call [print]
|
inc bp
|
||||||
|
mov ah,8
|
||||||
call [findnextfile],offset bufferentry
|
int 48h
|
||||||
jc nofiles
|
jnc go
|
||||||
inc bp
|
|
||||||
jmp go
|
|
||||||
nofiles:
|
nofiles:
|
||||||
call [print],offset menu
|
push offset menu
|
||||||
mov [xx],1
|
call [print]
|
||||||
call changelineattr,[xx],112
|
mov xx,1
|
||||||
|
mov xxold,2
|
||||||
|
call Select
|
||||||
endof:
|
endof:
|
||||||
mov ax,0
|
mov ax,0
|
||||||
int 16h
|
int 16h
|
||||||
cmp ah,50h
|
cmp ah,50h
|
||||||
jne tre1
|
jne tre1
|
||||||
cmp [xx],bp
|
cmp xx,bp
|
||||||
ja endof
|
ja endof
|
||||||
call changelineattr,[xx],7
|
inc xx
|
||||||
inc [xx]
|
call select
|
||||||
call changelineattr,[xx],112
|
jmp endof
|
||||||
jmp endof
|
|
||||||
tre1:
|
tre1:
|
||||||
cmp ah,48h
|
cmp ah,48h
|
||||||
jne tre2
|
jne tre2
|
||||||
cmp [xx],1
|
cmp xx,1
|
||||||
je endof
|
je endof
|
||||||
call changelineattr,[xx],7
|
dec xx
|
||||||
dec [xx]
|
call select
|
||||||
call changelineattr,[xx],112
|
jmp endof
|
||||||
jmp endof
|
|
||||||
tre2:
|
tre2:
|
||||||
cmp al,0Dh
|
cmp al,0Dh
|
||||||
jne tre3
|
jne tre3
|
||||||
tre3:
|
tre3:
|
||||||
cmp ah,59
|
cmp ah,59
|
||||||
jne tre4
|
jne tre4
|
||||||
jmp realstart
|
jmp realstart
|
||||||
tre4:
|
tre4:
|
||||||
cmp ah,67
|
cmp ah,67
|
||||||
jne endof
|
jne endof
|
||||||
retf
|
retf
|
||||||
|
|
||||||
;couleur al pour ligne %0 en %1
|
;selectionne la ligne xx
|
||||||
PROC changelineattr near
|
Select:
|
||||||
USES ax,bx,di,es
|
push ax di
|
||||||
ARG @line:word,@attr:word
|
mov di,xxold
|
||||||
mov ax,0B800h
|
mov al,7
|
||||||
mov es,ax
|
add di,3
|
||||||
mov ax,[@line]
|
mov ah,32
|
||||||
add ax,3
|
int 47h
|
||||||
mul [cs:infos.columns]
|
mov ax,xx
|
||||||
mov di,ax
|
mov xxold,ax
|
||||||
shl di,1
|
mov di,xx
|
||||||
mov al,[cs:infos.columns]
|
mov ah,32
|
||||||
inc di
|
mov al,112
|
||||||
mov bx,[@attr]
|
add di,3
|
||||||
@@popep:
|
int 47h
|
||||||
mov [es:di],bl
|
pop di ax
|
||||||
add di,2
|
ret
|
||||||
dec al
|
|
||||||
jnz @@popep
|
|
||||||
ret
|
|
||||||
endp changelineattr
|
|
||||||
|
|
||||||
xx dw 1
|
xx dw 1
|
||||||
xxold dw 0
|
xxold dw 0
|
||||||
|
@ -102,16 +96,14 @@ menu db '\c70 [F1] Lire disque [F9] Quitter
|
||||||
msg1 db '\e\g00,00\c70 Gestionnaire de fichier Version 1.5 '
|
msg1 db '\e\g00,00\c70 Gestionnaire de fichier Version 1.5 '
|
||||||
db '\g00,01\c07--------------------------------------------------------------------------------'
|
db '\g00,01\c07--------------------------------------------------------------------------------'
|
||||||
db '\g00,02Nom Ext. Date creation Date modification Taille Attributs'
|
db '\g00,02Nom Ext. Date creation Date modification Taille Attributs'
|
||||||
db '\g00,03-------------------------------------------------------------------------------\l',0
|
db '\g00,03--------------------------------------------------------------------------------\l',0
|
||||||
line db '\c07%n %d %t %d %t %z %a\l',0
|
line db '\c07%n %d %t %d %t %z %a\l',0
|
||||||
bufferentry find <>
|
bufferentry db 512 dup (0)
|
||||||
infos vgainf <>
|
|
||||||
|
|
||||||
importing
|
|
||||||
use VIDEO.LIB,print
|
|
||||||
use VIDEO,saveparamto
|
|
||||||
use DISQUE,initdrive
|
|
||||||
use DISQUE,findfirstfile
|
|
||||||
use DISQUE,findnextfile
|
|
||||||
endi
|
|
||||||
|
|
||||||
|
imports:
|
||||||
|
db "VIDEO.LIB::print",0
|
||||||
|
print dd 0
|
||||||
|
dw 0
|
||||||
|
|
||||||
|
end start
|
||||||
|
|
|
@ -1,20 +1,11 @@
|
||||||
model tiny,stdcall
|
.model tiny
|
||||||
p586N
|
.486
|
||||||
locals
|
smart
|
||||||
jumps
|
.code
|
||||||
codeseg
|
|
||||||
option procalign:byte
|
|
||||||
|
|
||||||
include "..\include\mem.h"
|
org 0100h
|
||||||
include "..\include\divers.h"
|
|
||||||
|
|
||||||
org 0h
|
|
||||||
|
|
||||||
start:
|
start:
|
||||||
header exe <"CE",1,0,0,,,,offset realstart>
|
|
||||||
|
|
||||||
realstart:
|
|
||||||
retf
|
|
||||||
|
|
||||||
PNP_ADR_PORT equ 0x279
|
PNP_ADR_PORT equ 0x279
|
||||||
PNP_WRITE_PORT equ 0xA79
|
PNP_WRITE_PORT equ 0xA79
|
||||||
|
@ -32,15 +23,17 @@ IDENT_LEN equ 9
|
||||||
;renvoie le timer en ax
|
;renvoie le timer en ax
|
||||||
ctc:
|
ctc:
|
||||||
cli
|
cli
|
||||||
mov dx,043h
|
mov dx,043h
|
||||||
mov al,0
|
mov al,0
|
||||||
out dx,al
|
out dx,al
|
||||||
mov dx,40h
|
mov dx,40h
|
||||||
in al,dx
|
in al,dx
|
||||||
mov ah,al
|
mov ah,al
|
||||||
in al,dx
|
in al,dx
|
||||||
sti
|
sti
|
||||||
ret
|
ret
|
||||||
|
|
||||||
;attend pendant ax microsecondes
|
;attend pendant ax microsecondes
|
||||||
usleep:
|
usleep:
|
||||||
|
|
||||||
|
end start
|
||||||
|
|
|
@ -1,73 +1,100 @@
|
||||||
model tiny,stdcall
|
.model tiny
|
||||||
p586N
|
.486
|
||||||
locals
|
smart
|
||||||
jumps
|
.code
|
||||||
codeseg
|
|
||||||
option procalign:byte
|
|
||||||
|
|
||||||
include "..\include\mem.h"
|
|
||||||
include "..\include\divers.h"
|
|
||||||
|
|
||||||
org 0h
|
org 0h
|
||||||
|
|
||||||
start:
|
include ..\include\mem.h
|
||||||
header exe <"CE",1,0,0,,offset imports,,offset realstart>
|
|
||||||
|
|
||||||
realstart:
|
start:
|
||||||
call [cs:mballoc],65535
|
header exe <,1,0,,,offset imports,,>
|
||||||
jc problem3
|
|
||||||
push ax
|
realstart:
|
||||||
pop es
|
mov ah,7
|
||||||
call [cs:projfile],offset logo
|
mov cx,65535
|
||||||
jc problem
|
int 49h
|
||||||
mov ecx,eax
|
jc problem3
|
||||||
call [cs:mbfind],offset logo
|
push gs
|
||||||
jc problem
|
pop es
|
||||||
call [cs:decompressrle],ax,0,es,0,cx
|
mov ah,7
|
||||||
jc problem2
|
mov cx,65535
|
||||||
push es
|
int 49h
|
||||||
pop ds
|
jc problem3
|
||||||
call [cs:savestate]
|
mov si,offset logo
|
||||||
call [cs:setvideomode],word 8
|
mov ah,4
|
||||||
call [cs:clearscreen]
|
xor di,di
|
||||||
call [cs:loadbmppalet],word 0
|
int 48h
|
||||||
call [cs:showbmp],word 0,word 20,word 150
|
jc problem
|
||||||
jc problem4
|
|
||||||
push cs
|
|
||||||
pop ds
|
push es
|
||||||
call [cs:print],offset poper
|
pop ds
|
||||||
|
push gs
|
||||||
|
pop es
|
||||||
|
xor si,si
|
||||||
|
xor di,di
|
||||||
|
mov ah,6
|
||||||
|
int 48h
|
||||||
|
jc problem2
|
||||||
|
|
||||||
|
push es
|
||||||
|
pop ds
|
||||||
|
|
||||||
|
mov ah,28h
|
||||||
|
int 47h
|
||||||
|
mov ax,0008h
|
||||||
|
int 47h
|
||||||
|
mov ah,2
|
||||||
|
int 47h
|
||||||
|
push 0
|
||||||
|
call cs:[loadbmppalet]
|
||||||
|
push 150
|
||||||
|
push 20
|
||||||
|
push 0
|
||||||
|
call cs:[showbmp]
|
||||||
|
jc problem4
|
||||||
|
push cs
|
||||||
|
pop ds
|
||||||
|
push offset poper
|
||||||
|
call [print]
|
||||||
endofit:
|
endofit:
|
||||||
xor ax,ax
|
xor ax,ax
|
||||||
int 16h
|
int 16h
|
||||||
call [cs:restorestate]
|
mov ah,29h
|
||||||
retf
|
int 47h
|
||||||
|
retf
|
||||||
|
|
||||||
problem:
|
problem:
|
||||||
push cs
|
push cs
|
||||||
pop ds
|
pop ds
|
||||||
call [cs:print],offset error
|
push offset error
|
||||||
jmp endofit
|
call [print]
|
||||||
|
jmp endofit
|
||||||
|
|
||||||
problem2:
|
problem2:
|
||||||
push cs
|
push cs
|
||||||
pop ds
|
pop ds
|
||||||
call [cs:print],offset error2
|
push offset error2
|
||||||
jmp endofit
|
call [print]
|
||||||
|
jmp endofit
|
||||||
|
|
||||||
problem3:
|
problem3:
|
||||||
push cs
|
push cs
|
||||||
pop ds
|
pop ds
|
||||||
call [cs:print],offset error3
|
push offset error3
|
||||||
jmp endofit
|
call [print]
|
||||||
|
jmp endofit
|
||||||
|
|
||||||
problem4:
|
problem4:
|
||||||
push cs
|
push cs
|
||||||
pop ds
|
pop ds
|
||||||
call [cs:print],offset error4
|
push offset error4
|
||||||
jmp endofit
|
call [print]
|
||||||
|
jmp endofit
|
||||||
|
|
||||||
poper db '\c0BC\c0CO\c0DS\c0E2\c0E0\c0E0\c0F0 en mode graphique',0
|
poper db '\c0BC\c0CO\c0DS\c0E2\c0E0\c0E0\c0F0 en mode graphique',0
|
||||||
logo db 'COS.RIP',0
|
logo db 'cos.rip',0
|
||||||
ok1 db 'Chargement de l''image OK',0
|
ok1 db 'Chargement de l''image OK',0
|
||||||
ok2 db 'Decompression de l''image OK',0
|
ok2 db 'Decompression de l''image OK',0
|
||||||
error3 db '\c04Une erreur est apparue lors de l''allocation de mémoire',0
|
error3 db '\c04Une erreur est apparue lors de l''allocation de mémoire',0
|
||||||
|
@ -76,16 +103,12 @@ error2 db '\c04Une erreur est apparue lors de la decompression de l''image',0
|
||||||
error4 db '\c0FUne erreur est apparue lors de l''affichage de l''image',0
|
error4 db '\c0FUne erreur est apparue lors de l''affichage de l''image',0
|
||||||
|
|
||||||
|
|
||||||
importing
|
imports:
|
||||||
use VIDEO,restorestate
|
db "VIDEO.LIB::print",0
|
||||||
use VIDEO,savestate
|
print dd 0
|
||||||
use VIDEO,setvideomode
|
db "BMP.LIB::showbmp",0
|
||||||
use VIDEO,clearscreen
|
showbmp dd 0
|
||||||
use DISQUE,decompressrle
|
db "BMP.LIB::loadbmppalet",0
|
||||||
use DISQUE,projfile
|
loadbmppalet dd 0
|
||||||
use SYSTEME,mbfind
|
dw 0
|
||||||
use SYSTEME,mballoc
|
end start
|
||||||
use VIDEO.LIB,print
|
|
||||||
use BMP.LIB,showbmp
|
|
||||||
use BMP.LIB,loadbmppalet
|
|
||||||
endi
|
|
||||||
|
|
|
@ -0,0 +1,82 @@
|
||||||
|
.model tiny
|
||||||
|
.486
|
||||||
|
smart
|
||||||
|
.code
|
||||||
|
|
||||||
|
org 0h
|
||||||
|
|
||||||
|
include ..\include\mem.h
|
||||||
|
include ..\include\divers.h
|
||||||
|
|
||||||
|
start:
|
||||||
|
header exe <,1,0,,,offset imports,,>
|
||||||
|
|
||||||
|
realstart:
|
||||||
|
push offset msg
|
||||||
|
call [print]
|
||||||
|
|
||||||
|
xor cx,cx
|
||||||
|
listmcb:
|
||||||
|
mov ah,4
|
||||||
|
int 49h
|
||||||
|
jc fino
|
||||||
|
inc cx
|
||||||
|
|
||||||
|
;placement mémoire
|
||||||
|
mov dx,gs
|
||||||
|
inc dx
|
||||||
|
inc dx
|
||||||
|
push edx
|
||||||
|
|
||||||
|
;parent
|
||||||
|
cmp gs:[MB.Reference],0
|
||||||
|
je next
|
||||||
|
mov dx,gs:[MB.Reference]
|
||||||
|
dec dx
|
||||||
|
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 line
|
||||||
|
call [print]
|
||||||
|
|
||||||
|
jmp listmcb
|
||||||
|
fino:
|
||||||
|
db 0CBh
|
||||||
|
resident db "oui",0
|
||||||
|
nonresident db "non",0
|
||||||
|
line db "%0P\h15%w\h24%0\h30%0P\h46%hW\l",0
|
||||||
|
msg db "Memory manager V1.5\lNom Taille Res Parent Mem\l",0
|
||||||
|
none db ".",0
|
||||||
|
|
||||||
|
imports:
|
||||||
|
db "VIDEO.LIB::print",0
|
||||||
|
print dd 0
|
||||||
|
dw 0
|
||||||
|
|
||||||
|
end start
|
|
@ -1,22 +1,15 @@
|
||||||
model tiny,stdcall
|
.model tiny
|
||||||
p586N
|
.486p
|
||||||
locals
|
smart
|
||||||
jumps
|
.code
|
||||||
codeseg
|
|
||||||
option procalign:byte
|
|
||||||
|
|
||||||
include "..\include\mem.h"
|
|
||||||
include "..\include\divers.h"
|
|
||||||
|
|
||||||
org 0h
|
org 0h
|
||||||
|
|
||||||
start:
|
start:
|
||||||
header exe <"CE",1,0,0,,,,offset realstart>
|
mov eax,cr0
|
||||||
|
or al,1
|
||||||
realstart:
|
mov cr0,eax
|
||||||
mov eax,cr0
|
|
||||||
or al,1
|
|
||||||
mov cr0,eax
|
|
||||||
retf
|
|
||||||
|
|
||||||
|
db 0CBh
|
||||||
|
|
||||||
|
end start
|
||||||
|
|
|
@ -1,32 +1,27 @@
|
||||||
model tiny,stdcall
|
.model tiny
|
||||||
p586N
|
.486
|
||||||
locals
|
smart
|
||||||
jumps
|
.code
|
||||||
codeseg
|
|
||||||
option procalign:byte
|
|
||||||
|
|
||||||
include "..\include\mem.h"
|
|
||||||
include "..\include\divers.h"
|
|
||||||
|
|
||||||
org 0h
|
org 0h
|
||||||
|
|
||||||
|
include ..\include\mem.h
|
||||||
|
|
||||||
start:
|
start:
|
||||||
header exe <"CE",1,0,0,,offset imports,,offset realstart>
|
header exe <,1,0,,,offset imports,,>
|
||||||
|
|
||||||
realstart:
|
realstart:
|
||||||
call [mouseon]
|
mov ah,2
|
||||||
jc errormouse
|
int 74h
|
||||||
call [print],offset message
|
push offset message
|
||||||
retf
|
call [print]
|
||||||
|
retf
|
||||||
|
|
||||||
errormouse:
|
message db 'Activation de la souris',0
|
||||||
call [print],offset errormessage
|
|
||||||
retf
|
|
||||||
|
|
||||||
message db 'Activation de la souris\l',0
|
imports:
|
||||||
errormessage db 'impossible d''activer la souris\l',0
|
db "VIDEO.LIB::print",0
|
||||||
|
print dd 0
|
||||||
|
dw 0
|
||||||
|
|
||||||
importing
|
end start
|
||||||
use VIDEO.LIB,print
|
|
||||||
use MOUSE.SYS,mouseon
|
|
||||||
endi
|
|
||||||
|
|
Binary file not shown.
|
@ -1,108 +1,164 @@
|
||||||
model tiny,stdcall
|
.model tiny
|
||||||
p586N
|
.486
|
||||||
locals
|
smart
|
||||||
jumps
|
.code
|
||||||
codeseg
|
|
||||||
option procalign:byte
|
|
||||||
|
|
||||||
include "..\include\mem.h"
|
|
||||||
include "..\include\divers.h"
|
|
||||||
|
|
||||||
org 0h
|
org 0h
|
||||||
|
|
||||||
|
include ..\include\mem.h
|
||||||
|
|
||||||
start:
|
start:
|
||||||
header exe <"CE",1,0,0,,offset imports,,offset realstart>
|
header exe <,1,0,,,offset imports,,>
|
||||||
|
|
||||||
realstart:
|
realstart:
|
||||||
call [cs:randomize]
|
mov ah,28h
|
||||||
push 0FFFFh
|
int 47h
|
||||||
pushd 652201
|
|
||||||
pushd 1545454545
|
|
||||||
push 1523
|
|
||||||
push 2041
|
|
||||||
push offset zero
|
|
||||||
push offset fixe
|
|
||||||
push 5
|
|
||||||
push 'i'
|
|
||||||
push 'a'
|
|
||||||
pushd 5041
|
|
||||||
pushd 125645
|
|
||||||
pushd 5041
|
|
||||||
pushd 125645
|
|
||||||
pushd 5041
|
|
||||||
pushd 125645
|
|
||||||
push offset message
|
|
||||||
call [print]
|
|
||||||
xor ax,ax
|
|
||||||
int 16h
|
|
||||||
call [clearscreen]
|
|
||||||
call [xchgpages]
|
|
||||||
call [clearscreen]
|
|
||||||
mov cx,200
|
|
||||||
go1:
|
|
||||||
call [xchgpages]
|
|
||||||
call [waitretrace]
|
|
||||||
call [print],offset textdemo1
|
|
||||||
call put
|
|
||||||
call [xchgpages]
|
|
||||||
call [waitretrace]
|
|
||||||
dec cx
|
|
||||||
jnz go1
|
|
||||||
mov cx,200
|
|
||||||
go2:
|
|
||||||
call [xchgpages]
|
|
||||||
call [waitretrace]
|
|
||||||
call [print],offset textdemo2
|
|
||||||
call put
|
|
||||||
call [xchgpages]
|
|
||||||
call [waitretrace]
|
|
||||||
dec cx
|
|
||||||
jnz go2
|
|
||||||
mov cx,200
|
|
||||||
go3:
|
|
||||||
call [xchgpages]
|
|
||||||
call [waitretrace]
|
|
||||||
call [print],offset textdemo3
|
|
||||||
call put
|
|
||||||
call [xchgpages]
|
|
||||||
call [waitretrace]
|
|
||||||
dec cx
|
|
||||||
jnz go3
|
|
||||||
call [clearscreen]
|
|
||||||
call [xchgpages]
|
|
||||||
call [clearscreen]
|
|
||||||
call [print],offset texte2
|
|
||||||
mov bp,255
|
|
||||||
xor edx,edx
|
|
||||||
go4:
|
|
||||||
call [xchgpages]
|
|
||||||
call [waitretrace]
|
|
||||||
inc edx
|
|
||||||
push edx
|
|
||||||
push offset texte3
|
|
||||||
call [print]
|
|
||||||
call [xchgpages]
|
|
||||||
call [waitretrace]
|
|
||||||
dec bp
|
|
||||||
jnz go4
|
|
||||||
push offset texte4
|
|
||||||
call [print]
|
|
||||||
mov ax,0
|
|
||||||
int 16h
|
|
||||||
call [restorestate]
|
|
||||||
retf
|
|
||||||
put:
|
|
||||||
call [cs:random]
|
|
||||||
mov di,ax
|
|
||||||
and di,4096-2
|
|
||||||
mov si,offset fond
|
|
||||||
call showstring2
|
|
||||||
ret
|
|
||||||
|
|
||||||
|
push word ptr 0FFFFh
|
||||||
|
push dword ptr 652201
|
||||||
|
push dword ptr 1545454545
|
||||||
|
push word ptr 1523
|
||||||
|
push word ptr 2041
|
||||||
|
push offset zero
|
||||||
|
push offset fixe
|
||||||
|
push word ptr 5
|
||||||
|
push word ptr 'i'
|
||||||
|
push word ptr 'a'
|
||||||
|
push dword ptr 5041
|
||||||
|
push dword ptr 125645
|
||||||
|
push dword ptr 5041
|
||||||
|
push dword ptr 125645
|
||||||
|
push dword ptr 5041
|
||||||
|
push dword ptr 125645
|
||||||
|
push offset message
|
||||||
|
call [print]
|
||||||
|
mov ax,0
|
||||||
|
int 16h
|
||||||
|
|
||||||
|
mov ah,2
|
||||||
|
int 47h
|
||||||
|
mov ah,30
|
||||||
|
int 47h
|
||||||
|
mov ah,2
|
||||||
|
int 47h
|
||||||
|
|
||||||
|
mov cx,200
|
||||||
|
go1:
|
||||||
|
mov ah,30
|
||||||
|
int 47h
|
||||||
|
mov ah,33
|
||||||
|
int 47
|
||||||
|
push offset textdemo1
|
||||||
|
call [print]
|
||||||
|
call put
|
||||||
|
mov ah,30
|
||||||
|
int 47h
|
||||||
|
mov ah,33
|
||||||
|
int 47h
|
||||||
|
dec cx
|
||||||
|
jnz go1
|
||||||
|
|
||||||
|
mov cx,200
|
||||||
|
go2:
|
||||||
|
mov ah,30
|
||||||
|
int 47h
|
||||||
|
mov ah,33
|
||||||
|
int 47h
|
||||||
|
push offset textdemo2
|
||||||
|
call [print]
|
||||||
|
call put
|
||||||
|
mov ah,30
|
||||||
|
int 47h
|
||||||
|
mov ah,33
|
||||||
|
int 47h
|
||||||
|
dec cx
|
||||||
|
jnz go2
|
||||||
|
|
||||||
|
mov cx,200
|
||||||
|
go3:
|
||||||
|
mov ah,30
|
||||||
|
int 47h
|
||||||
|
mov ah,33
|
||||||
|
int 47h
|
||||||
|
push offset textdemo3
|
||||||
|
call [print]
|
||||||
|
call put
|
||||||
|
mov ah,30
|
||||||
|
int 47h
|
||||||
|
mov ah,33
|
||||||
|
int 47h
|
||||||
|
dec cx
|
||||||
|
jnz go3
|
||||||
|
|
||||||
|
mov ah,30
|
||||||
|
int 47h
|
||||||
|
mov ah,2
|
||||||
|
int 47h
|
||||||
|
push offset texte2
|
||||||
|
call [print]
|
||||||
|
mov ah,30
|
||||||
|
int 47h
|
||||||
|
mov ah,2
|
||||||
|
int 47h
|
||||||
|
mov ah,30
|
||||||
|
int 47h
|
||||||
|
|
||||||
|
mov bp,255
|
||||||
|
xor edx,edx
|
||||||
|
go4:
|
||||||
|
mov ah,30
|
||||||
|
int 47h
|
||||||
|
mov ah,33
|
||||||
|
int 47h
|
||||||
|
inc edx
|
||||||
|
push edx
|
||||||
|
push offset texte3
|
||||||
|
call [print]
|
||||||
|
mov ah,30
|
||||||
|
int 47h
|
||||||
|
mov ah,33
|
||||||
|
int 47h
|
||||||
|
dec bp
|
||||||
|
jnz go4
|
||||||
|
push offset texte4
|
||||||
|
call [print]
|
||||||
|
mov ax,0
|
||||||
|
int 16h
|
||||||
|
mov ah,29h
|
||||||
|
int 47h
|
||||||
|
retf
|
||||||
|
|
||||||
|
put:
|
||||||
|
call random
|
||||||
|
mov di,dx
|
||||||
|
and di,4096-2
|
||||||
|
mov si,offset fond
|
||||||
|
call showstring2
|
||||||
|
ret
|
||||||
|
|
||||||
|
Random:
|
||||||
|
push ax
|
||||||
|
MOV AX,cs:[RandSeed]
|
||||||
|
MOV DX,8405h
|
||||||
|
MUL DX
|
||||||
|
INC AX
|
||||||
|
MOV cs:[RandSeed],AX
|
||||||
|
pop ax
|
||||||
|
ret
|
||||||
|
|
||||||
|
randseed dw 1234h
|
||||||
|
|
||||||
|
Randomize:
|
||||||
|
push ax cx dx
|
||||||
|
mov ah,0
|
||||||
|
int 1ah
|
||||||
|
mov cs:randseed,dx
|
||||||
|
pop dx cx ax
|
||||||
|
ret
|
||||||
|
|
||||||
zero db 'Chaine a z‚ro terminal',0
|
zero db 'Chaine a z‚ro terminal',0
|
||||||
fixe db 20,'Chaine a taille fixe'
|
fixe db 20,'Chaine a taille fixe'
|
||||||
message db "\s\m01\e\c07\h01D‚monstration de la librairie VIDEO.LIB\l\l"
|
message db "\m01\e\c07\h01D‚monstration de la librairie VIDEO.LIB\l\l"
|
||||||
db "\c01Nombres entiers ou sign‚s (%%u/%%i):\l%u\l%iD\l"
|
db "\c01Nombres entiers ou sign‚s (%%u/%%i):\l%u\l%iD\l"
|
||||||
db "\c02Nombre hexad‚cimaux (%%h):\l%hD\l%hW\l"
|
db "\c02Nombre hexad‚cimaux (%%h):\l%hD\l%hW\l"
|
||||||
db "\c03Nombres Binaires (%%b):\l%bD\l%bB\l"
|
db "\c03Nombres Binaires (%%b):\l%bD\l%bB\l"
|
||||||
|
@ -120,34 +176,28 @@ texte1 db 'Echange rapide de pages Vid
|
||||||
texte2 db '\g04,13Routine d''affichage Ultra Rapide Agissant sur le Mat‚riel'
|
texte2 db '\g04,13Routine d''affichage Ultra Rapide Agissant sur le Mat‚riel'
|
||||||
db '\g04,14Possibilit‚ de r‚aliser des effets de superposition',0
|
db '\g04,14Possibilit‚ de r‚aliser des effets de superposition',0
|
||||||
texte3 db '\c04%bD\l',0
|
texte3 db '\c04%bD\l',0
|
||||||
texte4 db '\g01,00Sauvegarde et restauration de l''ecran (\\s/\\r)',0
|
texte4 db '\g01,00Sauvegarde et restauration de l''ecran (%%s/%%r)',0
|
||||||
|
|
||||||
showstring2:
|
showstring2:
|
||||||
push es bx cx si di
|
push es bx cx si di
|
||||||
add di,4000
|
add di,4000
|
||||||
mov bx,0B800h
|
mov bx,0B800h
|
||||||
mov es,bx
|
mov es,bx
|
||||||
mov bl,[si]
|
mov bl,[si]
|
||||||
mov ch,3
|
mov ch,3
|
||||||
strinaize4:
|
strinaize4:
|
||||||
inc si
|
inc si
|
||||||
mov cl,[si]
|
mov cl,[si]
|
||||||
mov [es:di],cx
|
mov es:[di],cx
|
||||||
add di,2
|
add di,2
|
||||||
dec bl
|
dec bl
|
||||||
jnz strinaize4
|
jnz strinaize4
|
||||||
pop di si cx bx es
|
pop di si cx bx es
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
imports:
|
||||||
|
db "VIDEO.LIB::print",0
|
||||||
|
print dd 0
|
||||||
|
dw 0
|
||||||
|
|
||||||
importing
|
end start
|
||||||
use MATH.LIB,randomize
|
|
||||||
use MATH.LIB,random
|
|
||||||
use VIDEO.LIB,print
|
|
||||||
use VIDEO,xchgpages
|
|
||||||
use VIDEO,setvideomode
|
|
||||||
use VIDEO,clearscreen
|
|
||||||
use VIDEO,savestate
|
|
||||||
use VIDEO,restorestate
|
|
||||||
use VIDEO,waitretrace
|
|
||||||
endi
|
|
||||||
|
|
|
@ -1,55 +0,0 @@
|
||||||
model tiny,stdcall
|
|
||||||
p586N
|
|
||||||
locals
|
|
||||||
jumps
|
|
||||||
codeseg
|
|
||||||
option procalign:byte
|
|
||||||
|
|
||||||
include "..\include\mem.h"
|
|
||||||
include "..\include\fat.h"
|
|
||||||
include "..\include\divers.h"
|
|
||||||
include "..\include\3d.h"
|
|
||||||
|
|
||||||
org 0h
|
|
||||||
|
|
||||||
start:
|
|
||||||
header exe <"CE",1,0,0,,offset imports,,offset realstart>
|
|
||||||
|
|
||||||
realstart:
|
|
||||||
call [cs:randomize]
|
|
||||||
call [cs:savestate]
|
|
||||||
call [cs:setvideomode],10
|
|
||||||
call [cs:clearscreen]
|
|
||||||
mov cx,65535
|
|
||||||
show:
|
|
||||||
call [cs:random]
|
|
||||||
and ax,1111b
|
|
||||||
push ax
|
|
||||||
call [cs:random]
|
|
||||||
push ax
|
|
||||||
call [cs:random]
|
|
||||||
push ax
|
|
||||||
call [cs:random]
|
|
||||||
push ax
|
|
||||||
call [cs:random]
|
|
||||||
push ax
|
|
||||||
call [cs:line]
|
|
||||||
dec cx
|
|
||||||
jnz show
|
|
||||||
call [cs:bioswaitkey]
|
|
||||||
call [cs:restorestate]
|
|
||||||
retf
|
|
||||||
|
|
||||||
importing
|
|
||||||
use VIDEO.LIB,print
|
|
||||||
use VIDEO,savestate
|
|
||||||
use VIDEO,clearscreen
|
|
||||||
use VIDEO,setvideomode
|
|
||||||
use VIDEO,restorestate
|
|
||||||
use VIDEO,waitretrace
|
|
||||||
use GRAPHIC,line ;@x1:word,@y1:word,@x2:word,@y2:word,@color:word
|
|
||||||
use GRAPHIC,polyfill ;@pointer:word,@nbfaces:word,@color:word;
|
|
||||||
use SYSTEME,bioswaitkey
|
|
||||||
use MATH.LIB,randomize
|
|
||||||
use MATH.LIB,random
|
|
||||||
endi
|
|
|
@ -1,245 +0,0 @@
|
||||||
model tiny,stdcall
|
|
||||||
p586N
|
|
||||||
locals
|
|
||||||
jumps
|
|
||||||
codeseg
|
|
||||||
option procalign:byte
|
|
||||||
|
|
||||||
include "..\include\mem.h"
|
|
||||||
include "..\include\fat.h"
|
|
||||||
include "..\include\divers.h"
|
|
||||||
include "..\include\3d.h"
|
|
||||||
|
|
||||||
org 0h
|
|
||||||
|
|
||||||
start:
|
|
||||||
header exe <"CE",1,0,0,,offset imports,,offset realstart>
|
|
||||||
|
|
||||||
data:
|
|
||||||
|
|
||||||
camera vertex3d <320.0,240.0,70.0>
|
|
||||||
|
|
||||||
zoom dd 5.0
|
|
||||||
rot1 dd 0.1
|
|
||||||
rot2 dd -0.1
|
|
||||||
|
|
||||||
vertexnbp dw 15
|
|
||||||
dd 0.0,0.0,0.0
|
|
||||||
dd 20.0,0.0,0.0
|
|
||||||
dd 24.0,0.0,0.0
|
|
||||||
dd 20.0,-2.0,0.0
|
|
||||||
dd 20.0,2.0,0.0
|
|
||||||
dd 0.0,0.0,0.0
|
|
||||||
dd 0.0,20.0,0.0
|
|
||||||
dd 0.0,24.0,0.0
|
|
||||||
dd -2.0,20.0,0.0
|
|
||||||
dd 2.0,20.0,0.0
|
|
||||||
dd 0.0,0.0,0.0
|
|
||||||
dd 0.0,0.0,20.0
|
|
||||||
dd 0.0,0.0,24.0
|
|
||||||
dd -2.0,-2.0,20.0
|
|
||||||
dd 2.0,2.0,20.0
|
|
||||||
|
|
||||||
facenbp dw 6
|
|
||||||
dw 0,1,1
|
|
||||||
dw 2,4,3
|
|
||||||
dw 5,6,6
|
|
||||||
dw 7,9,8
|
|
||||||
dw 10,11,11
|
|
||||||
dw 12,14,13
|
|
||||||
|
|
||||||
vertexnbp2 dw 15
|
|
||||||
dd 0.0,0.0,0.0
|
|
||||||
dd 20.0,0.0,0.0
|
|
||||||
dd 24.0,0.0,0.0
|
|
||||||
dd 20.0,-2.0,0.0
|
|
||||||
dd 20.0,2.0,0.0
|
|
||||||
dd 0.0,0.0,0.0
|
|
||||||
dd 0.0,20.0,0.0
|
|
||||||
dd 0.0,24.0,0.0
|
|
||||||
dd -2.0,20.0,0.0
|
|
||||||
dd 2.0,20.0,0.0
|
|
||||||
dd 0.0,0.0,0.0
|
|
||||||
dd 0.0,0.0,20.0
|
|
||||||
dd 0.0,0.0,24.0
|
|
||||||
dd -2.0,-2.0,20.0
|
|
||||||
dd 2.0,2.0,20.0
|
|
||||||
|
|
||||||
|
|
||||||
mat1 mat <?>
|
|
||||||
mat2 mat <?>
|
|
||||||
mat3 mat <?>
|
|
||||||
matrixp mat <?>
|
|
||||||
|
|
||||||
mode db 0
|
|
||||||
|
|
||||||
objectp:
|
|
||||||
vertexp equ objectp+15
|
|
||||||
facep equ vertexp+20000
|
|
||||||
screen equ facep+20000
|
|
||||||
|
|
||||||
;typep db ?
|
|
||||||
;objectp db 15 dup (?)
|
|
||||||
;vertexp db 1000*4*3+2 dup (?)
|
|
||||||
;facep db 2000*3+2 dup (?)
|
|
||||||
;screen db 1000*2*2 dup (?)
|
|
||||||
|
|
||||||
|
|
||||||
realstart:
|
|
||||||
call [cs:savestate]
|
|
||||||
call [cs:setvideomode],10
|
|
||||||
call [cs:clearscreen]
|
|
||||||
call [cs:mballoc],65535
|
|
||||||
mov es,ax
|
|
||||||
mov si,offset data
|
|
||||||
mov di,si
|
|
||||||
mov ecx,(offset realstart-offset data)
|
|
||||||
shr ecx,2
|
|
||||||
inc ecx
|
|
||||||
cld
|
|
||||||
rep movsd
|
|
||||||
call [cs:projfile],offset filename
|
|
||||||
jc errorloading
|
|
||||||
call [cs:mbfind],offset filename
|
|
||||||
jc errorloading
|
|
||||||
push es
|
|
||||||
pop ds
|
|
||||||
mov es,ax
|
|
||||||
call [cs:load3ds],es,0,offset objectp,offset vertexp,offset matrixp,offset facep
|
|
||||||
call [cs:transform],offset vertexnbp,offset matrixp
|
|
||||||
call [cs:identity],offset mat1
|
|
||||||
jmp show
|
|
||||||
rool:
|
|
||||||
mov ah,1
|
|
||||||
int 16h
|
|
||||||
jz rool
|
|
||||||
xor ax,ax
|
|
||||||
int 16h
|
|
||||||
cmp ax,011Bh
|
|
||||||
je endee
|
|
||||||
cmp ax,3B00h
|
|
||||||
jne notmode
|
|
||||||
inc [mode]
|
|
||||||
cmp [mode],3
|
|
||||||
jb notmodify
|
|
||||||
mov [mode],0
|
|
||||||
jmp notmodify
|
|
||||||
notmode:
|
|
||||||
cmp ax,4800h
|
|
||||||
jne notup
|
|
||||||
call [cs:rotationx],offset mat1,[rot2]
|
|
||||||
jmp show
|
|
||||||
notup:
|
|
||||||
cmp ax,5000h
|
|
||||||
jne notdown
|
|
||||||
call [cs:rotationx],offset mat1,[rot1]
|
|
||||||
jmp show
|
|
||||||
notdown:
|
|
||||||
cmp ax,4B00h
|
|
||||||
jne notleft
|
|
||||||
call [cs:rotationy],offset mat1,[rot1]
|
|
||||||
jmp show
|
|
||||||
notleft:
|
|
||||||
cmp ax,4D00h
|
|
||||||
jne notright
|
|
||||||
call [cs:rotationy],offset mat1,[rot2]
|
|
||||||
jmp show
|
|
||||||
notright:
|
|
||||||
cmp ax,4900h
|
|
||||||
jne notupup
|
|
||||||
call [cs:rotationz],offset mat1,[rot1]
|
|
||||||
jmp show
|
|
||||||
notupup:
|
|
||||||
cmp ax,5100h
|
|
||||||
jne notdowndown
|
|
||||||
call [cs:rotationz],offset mat1,[rot2]
|
|
||||||
jmp show
|
|
||||||
notdowndown:
|
|
||||||
cmp ax,4A2Dh
|
|
||||||
jne notminus
|
|
||||||
fld [camera.tz]
|
|
||||||
fsub [zoom]
|
|
||||||
fstp [camera.tz]
|
|
||||||
jmp show
|
|
||||||
notminus:
|
|
||||||
cmp ax,4E2Bh
|
|
||||||
jne notmaxus
|
|
||||||
fld [camera.tz]
|
|
||||||
fadd [zoom]
|
|
||||||
fstp [camera.tz]
|
|
||||||
jmp show
|
|
||||||
notmaxus:
|
|
||||||
call [cs:identity],offset mat1
|
|
||||||
jmp rool
|
|
||||||
show:
|
|
||||||
call [cs:transform],offset vertexp,offset mat1
|
|
||||||
call [cs:transform],offset vertexnbp,offset mat1
|
|
||||||
notmodify:
|
|
||||||
call [cs:clearscreen]
|
|
||||||
call [cs:print],offset objectp
|
|
||||||
call [cs:draw3d_line],3,offset facenbp,offset vertexnbp,offset screen,offset camera,3
|
|
||||||
call [cs:draw3d_line],3,offset facenbp,offset vertexnbp2,offset screen,offset camera,3
|
|
||||||
cmp [mode],0
|
|
||||||
jne line
|
|
||||||
call [cs:draw3d_point],offset vertexp,offset screen,offset camera,4
|
|
||||||
jmp retrace
|
|
||||||
line:
|
|
||||||
cmp [mode],1
|
|
||||||
jne hidden
|
|
||||||
call [cs:draw3d_line],3,offset facep,offset vertexp,offset screen,offset camera,4
|
|
||||||
jmp retrace
|
|
||||||
hidden:
|
|
||||||
call [cs:draw3d_hidden],3,offset facep,offset vertexp,offset screen,offset camera,4
|
|
||||||
retrace:
|
|
||||||
call [cs:waitretrace]
|
|
||||||
call [cs:waitretrace]
|
|
||||||
jmp rool
|
|
||||||
endee:
|
|
||||||
call [cs:restorestate]
|
|
||||||
retf
|
|
||||||
|
|
||||||
errorloading:
|
|
||||||
push cs
|
|
||||||
pop ds
|
|
||||||
call [cs:print],offset errorload
|
|
||||||
call [cs:bioswaitkey]
|
|
||||||
jmp endee
|
|
||||||
|
|
||||||
errorload db '\c02Erreur au chargement du fichier 3D\l<Appuyez sur une touche>\c07',0
|
|
||||||
|
|
||||||
filename find <"SPHERE.3DS",0,0,0,1,>
|
|
||||||
|
|
||||||
|
|
||||||
importing
|
|
||||||
use 3D.LIB,draw3d_point
|
|
||||||
use 3D.LIB,draw3d_line
|
|
||||||
use 3D.LIB,draw3d_hidden
|
|
||||||
use 3D.LIB,draw3d_hidden_fill
|
|
||||||
use 3D.LIB,load3ds
|
|
||||||
use 3D.LIB,translate
|
|
||||||
use 3D.LIB,translatex
|
|
||||||
use 3D.LIB,translatey
|
|
||||||
use 3D.LIB,translatez
|
|
||||||
use 3D.LIB,scale
|
|
||||||
use 3D.LIB,rescale
|
|
||||||
use 3D.LIB,copy
|
|
||||||
use 3D.LIB,fill
|
|
||||||
use 3D.LIB,identity
|
|
||||||
use 3D.LIB,rotationx
|
|
||||||
use 3D.LIB,rotationy
|
|
||||||
use 3D.LIB,rotationz
|
|
||||||
use 3D.LIB,rotation
|
|
||||||
use 3D.LIB,project
|
|
||||||
use 3D.LIB,transform
|
|
||||||
use 3D.LIB,multiply
|
|
||||||
use VIDEO,savestate
|
|
||||||
use VIDEO,clearscreen
|
|
||||||
use VIDEO,setvideomode
|
|
||||||
use VIDEO,restorestate
|
|
||||||
use VIDEO,waitretrace
|
|
||||||
use SYSTEME,bioswaitkey
|
|
||||||
use SYSTEME,mbfind
|
|
||||||
use SYSTEME,mballoc
|
|
||||||
use VIDEO.LIB,print
|
|
||||||
use DISQUE,projfile
|
|
||||||
endi
|
|
|
@ -1,73 +1,80 @@
|
||||||
model tiny,stdcall
|
.model tiny
|
||||||
p586N
|
.386c
|
||||||
locals
|
.code
|
||||||
jumps
|
|
||||||
codeseg
|
|
||||||
option procalign:byte
|
|
||||||
|
|
||||||
include "..\include\mem.h"
|
|
||||||
include "..\include\divers.h"
|
|
||||||
|
|
||||||
org 0h
|
org 0h
|
||||||
|
|
||||||
|
|
||||||
|
include ..\include\mem.h
|
||||||
|
|
||||||
start:
|
start:
|
||||||
header exe <"CE",1,0,0,,offset imports,,offset realstart>
|
header exe <,1,0,,,offset imports,,>
|
||||||
|
|
||||||
realstart:
|
realstart:
|
||||||
call [savestate]
|
mov ah,28h
|
||||||
call [print],offset msg
|
int 47h
|
||||||
mov bp,1000h
|
push offset msg
|
||||||
xor di,di
|
call [print]
|
||||||
xor cx,cx
|
mov bp,1000h
|
||||||
xor edx,edx
|
xor di,di
|
||||||
verifall:
|
xor cx,cx
|
||||||
mov ah,1
|
xor edx,edx
|
||||||
int 16h
|
VerifAll:
|
||||||
jz nokey
|
mov ah,1
|
||||||
cmp al,' '
|
int 16h
|
||||||
je enend
|
jz nokey
|
||||||
|
cmp al,' '
|
||||||
|
je enend
|
||||||
nokey:
|
nokey:
|
||||||
mov dx,di
|
mov dx,di
|
||||||
push edx
|
push edx
|
||||||
mov dx,cx
|
mov dx,cx
|
||||||
inc dx
|
inc dx
|
||||||
push edx
|
push edx
|
||||||
mov ax,cx
|
mov ax,cx
|
||||||
inc ax
|
inc ax
|
||||||
mov si,100
|
mov si,100
|
||||||
mul si
|
mul si
|
||||||
mov si,2880
|
mov si,2880
|
||||||
div si
|
div si
|
||||||
mov dx,ax
|
mov dx,ax
|
||||||
push edx
|
push edx
|
||||||
call [print],offset msg2
|
push offset msg2
|
||||||
call gauge
|
call [print]
|
||||||
call [verifysector],cx
|
call gauge
|
||||||
jc errors
|
mov ah,2
|
||||||
je noprob
|
int 48h
|
||||||
inc di
|
jc errors
|
||||||
|
je noprob
|
||||||
|
inc di
|
||||||
noprob:
|
noprob:
|
||||||
inc cx
|
inc cx
|
||||||
cmp cx,2880
|
cmp cx,2880
|
||||||
jnz verifall
|
jnz verifall
|
||||||
enend:
|
enend:
|
||||||
cmp di,0
|
cmp di,0
|
||||||
je noatall
|
je noatall
|
||||||
call [print],offset error2
|
push offset error2
|
||||||
jmp someof
|
call [print]
|
||||||
|
jmp someof
|
||||||
noatall:
|
noatall:
|
||||||
call [print],offset noerror
|
push offset noerror
|
||||||
|
call [print]
|
||||||
someof:
|
someof:
|
||||||
mov ah,0
|
mov ah,0
|
||||||
int 16h
|
int 16h
|
||||||
call [restorestate]
|
mov ah,29h
|
||||||
retf
|
int 47H
|
||||||
|
retf
|
||||||
errors:
|
errors:
|
||||||
call [print],offset error
|
push offset error
|
||||||
mov ah,0
|
call [print]
|
||||||
int 16h
|
mov ah,0
|
||||||
call [restorestate]
|
int 16h
|
||||||
retf
|
mov ah,29h
|
||||||
|
int 47H
|
||||||
|
retf
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
error db '\g10,10Erreur avec le lecteur de disquette !',0
|
error db '\g10,10Erreur avec le lecteur de disquette !',0
|
||||||
error2 db '\g10,10Le disque est defectueux, appuyez sur une touche pour quitter',0
|
error2 db '\g10,10Le disque est defectueux, appuyez sur une touche pour quitter',0
|
||||||
|
@ -76,31 +83,31 @@ msg db '\m02\e\c07\g29,00- Test de surface du disque -\g02,49<Pressez espace pou
|
||||||
msg2 db '\g10,20%u %%\g10,16%u cluster testes. \h34%u cluster defectueux. ',0
|
msg2 db '\g10,20%u %%\g10,16%u cluster testes. \h34%u cluster defectueux. ',0
|
||||||
|
|
||||||
gauge:
|
gauge:
|
||||||
push ax dx
|
push ax dx
|
||||||
mov ax,cx
|
mov ax,cx
|
||||||
mul [sizeof]
|
mul sizeof
|
||||||
div [max]
|
div max
|
||||||
xor edx,edx
|
xor edx,edx
|
||||||
mov dx,[sizeof]
|
mov dx,sizeof
|
||||||
sub dx,ax
|
sub dx,ax
|
||||||
push dx
|
push dx
|
||||||
push 'Û'
|
push 'Û'
|
||||||
mov dx,ax
|
mov dx,ax
|
||||||
push dx
|
push dx
|
||||||
push 'Û'
|
push 'Û'
|
||||||
push offset gauges
|
push offset gauges
|
||||||
call [print]
|
call [print]
|
||||||
pop dx ax
|
pop dx ax
|
||||||
retn
|
retn
|
||||||
|
|
||||||
max dw 2879
|
max dw 2879
|
||||||
sizeof dw 50
|
sizeof dw 50
|
||||||
|
|
||||||
gauges db '\g10,18\c05%cM\c07%cM',0
|
gauges db '\g10,18\c05%cM\c07%cM',0
|
||||||
|
|
||||||
importing
|
imports:
|
||||||
use VIDEO.LIB,print
|
db "VIDEO.LIB::print",0
|
||||||
use VIDEO,savestate
|
print dd 0
|
||||||
use VIDEO,restorestate
|
dw 0
|
||||||
use DISQUE,verifysector
|
|
||||||
endi
|
End Start
|
||||||
|
|
|
@ -1,98 +1,121 @@
|
||||||
model tiny,stdcall
|
.model tiny
|
||||||
p586N
|
.486
|
||||||
locals
|
smart
|
||||||
jumps
|
.code
|
||||||
codeseg
|
|
||||||
option procalign:byte
|
|
||||||
|
|
||||||
include "..\include\mem.h"
|
|
||||||
include "..\include\divers.h"
|
|
||||||
include "..\include\graphic.h"
|
|
||||||
|
|
||||||
org 0h
|
org 0h
|
||||||
|
|
||||||
|
include ..\include\mem.h
|
||||||
|
|
||||||
start:
|
start:
|
||||||
header exe <"CE",1,0,0,,offset imports,,offset realstart>
|
header exe <,1,0,,,offset imports,,>
|
||||||
|
|
||||||
realstart:
|
realstart:
|
||||||
mov ax,0305h
|
mov ax,0305h
|
||||||
mov bx,0008h
|
mov bx,0008h
|
||||||
int 16h
|
|
||||||
call [savestate]
|
|
||||||
call [setvideomode],2
|
|
||||||
xor ebp,ebp
|
|
||||||
xor ax,ax
|
|
||||||
mov fs,ax
|
|
||||||
call [disablescroll]
|
|
||||||
adres:
|
|
||||||
call [saveparamto],offset infos
|
|
||||||
call [readsector],[sect],offset buffer
|
|
||||||
jnc adres2
|
|
||||||
errtr:
|
|
||||||
call [setxy],0,[word ptr lastline]
|
|
||||||
call [print],offset errordisk
|
|
||||||
xor ax,ax
|
|
||||||
int 16h
|
int 16h
|
||||||
adres2:
|
mov ah,28h
|
||||||
call [saveparamto],offset infos
|
int 47H
|
||||||
mov al,[infos.lines]
|
mov ax,0002
|
||||||
dec al
|
int 47H
|
||||||
mov [lastline],al
|
mov ah,2
|
||||||
mov al,[infos.columns]
|
int 47h
|
||||||
sub al,16
|
mov ah,43
|
||||||
mov bl,al
|
int 47h
|
||||||
shr al,2
|
xor bp,bp
|
||||||
mov [sizex],al
|
push cs
|
||||||
and bl,11b
|
push cs
|
||||||
mov [sizex2],bl
|
pop es
|
||||||
mov al,[infos.mode]
|
pop ds
|
||||||
cmp al,[oldmode]
|
Adres:
|
||||||
je noinit
|
mov di,offset infos
|
||||||
call [clearscreen]
|
mov ah,34
|
||||||
mov [oldmode],al
|
int 47h
|
||||||
noinit:
|
dec infos
|
||||||
call [setxy],0,0
|
push cs
|
||||||
mov edi,ebp
|
pop es
|
||||||
mov bh,[lastline]
|
mov cx,sect
|
||||||
|
mov di,offset buffer
|
||||||
|
mov ah,0h
|
||||||
|
int 48h
|
||||||
|
jnc noerror
|
||||||
|
errtr:
|
||||||
|
mov ah,25
|
||||||
|
mov bl,infos
|
||||||
|
xor bh,bh
|
||||||
|
int 47h
|
||||||
|
push offset errordisk
|
||||||
|
call [print]
|
||||||
|
mov ax,0
|
||||||
|
int 16h
|
||||||
|
noerror:
|
||||||
|
adres2:
|
||||||
|
mov di,offset infos
|
||||||
|
mov ah,34
|
||||||
|
int 47h
|
||||||
|
dec byte ptr [di]
|
||||||
|
mov al,[di+1]
|
||||||
|
sub al,16
|
||||||
|
mov bl,al
|
||||||
|
shr al,2
|
||||||
|
mov [di+1],al
|
||||||
|
and bl,11b
|
||||||
|
mov [di+2],bl
|
||||||
|
mov al,[di+7]
|
||||||
|
cmp al,oldmode
|
||||||
|
je noinit
|
||||||
|
mov ah,2
|
||||||
|
int 47h
|
||||||
|
mov oldmode,al
|
||||||
|
noinit:
|
||||||
|
mov bx,0
|
||||||
|
mov ah,25
|
||||||
|
int 47h
|
||||||
|
mov bh,infos
|
||||||
|
mov di,bp
|
||||||
lines:
|
lines:
|
||||||
xor edx,edx
|
xor edx,edx
|
||||||
mov dx,di
|
mov dx,di
|
||||||
push edx
|
push edx
|
||||||
mov edx,edi
|
mov dx,sect
|
||||||
mov dx,[sect]
|
push edx
|
||||||
push edx
|
push offset spaces
|
||||||
push offset spaces
|
call [print]
|
||||||
call [print]
|
mov al,infos+1
|
||||||
mov dx,di
|
mov si,di
|
||||||
mov al,[sizex]
|
|
||||||
mov esi,edi
|
|
||||||
doaline:
|
doaline:
|
||||||
push [dword ptr di+offset buffer]
|
push dword ptr [di+offset buffer]
|
||||||
push 8
|
push 8
|
||||||
call [showhex]
|
call [showhex]
|
||||||
call [showchar],' '
|
push ' '
|
||||||
inc edi
|
call [showchar]
|
||||||
dec al
|
inc di
|
||||||
jnz doaline
|
dec al
|
||||||
mov edi,esi
|
jnz doaline
|
||||||
push offset spaces2
|
mov di,si
|
||||||
call [print]
|
push offset spaces2
|
||||||
mov al,[sizex]
|
call [print]
|
||||||
|
mov al,infos+1
|
||||||
doaline2:
|
doaline2:
|
||||||
push [word ptr di+offset buffer]
|
push word ptr [di+offset buffer]
|
||||||
call [showchar]
|
call [showchar]
|
||||||
inc edi
|
inc di
|
||||||
dec al
|
dec al
|
||||||
jnz doaline2
|
jnz doaline2
|
||||||
dec bh
|
dec bh
|
||||||
je outes
|
je outes
|
||||||
cmp [sizex2],0
|
cmp byte ptr infos+2,0
|
||||||
je lines
|
je lines
|
||||||
call [addline]
|
mov ah,6
|
||||||
jmp lines
|
int 47h
|
||||||
outes:
|
jmp lines
|
||||||
call [setxy],0,[word ptr lastline]
|
outes:
|
||||||
call [print],offset menu
|
mov bh,0
|
||||||
|
mov bl,infos
|
||||||
|
mov ah,25
|
||||||
|
int 47h
|
||||||
|
push offset menu
|
||||||
|
call [print]
|
||||||
waitkey:
|
waitkey:
|
||||||
mov ax,0
|
mov ax,0
|
||||||
int 16h
|
int 16h
|
||||||
|
@ -112,16 +135,16 @@ call [print],offset menu
|
||||||
suit2:
|
suit2:
|
||||||
cmp ax,3D00h
|
cmp ax,3D00h
|
||||||
jne suit3
|
jne suit3
|
||||||
cmp [sect],2880
|
cmp sect,2880
|
||||||
ja waitkey
|
ja waitkey
|
||||||
inc [sect]
|
inc sect
|
||||||
jmp adres
|
jmp adres
|
||||||
suit3:
|
suit3:
|
||||||
cmp ax,3E00h
|
cmp ax,3E00h
|
||||||
jne suit4
|
jne suit4
|
||||||
cmp [sect],0
|
cmp sect,0
|
||||||
je waitkey
|
je waitkey
|
||||||
dec [sect]
|
dec sect
|
||||||
jmp adres
|
jmp adres
|
||||||
suit4:
|
suit4:
|
||||||
cmp ax,3F00h
|
cmp ax,3F00h
|
||||||
|
@ -130,151 +153,165 @@ call [print],offset menu
|
||||||
suit5:
|
suit5:
|
||||||
cmp ax,4000h
|
cmp ax,4000h
|
||||||
jne suit6
|
jne suit6
|
||||||
call [writesector],[sect],offset buffer
|
mov cx,sect
|
||||||
|
mov di,offset buffer
|
||||||
|
mov ah,1
|
||||||
|
int 48h
|
||||||
jnc waitkey
|
jnc waitkey
|
||||||
jmp errtr
|
jmp errtr
|
||||||
suit6:
|
suit6:
|
||||||
cmp ax,4100h
|
cmp ax,4100h
|
||||||
jne suit7
|
jne suit7
|
||||||
mov [dword ptr pope],'TIDE'
|
mov dword ptr [pope],'TIDE'
|
||||||
call [setxy],0,[word ptr lastline]
|
mov bh,0
|
||||||
call [print],offset menu
|
mov bl,infos
|
||||||
mov ax,0B800h
|
mov ah,25
|
||||||
mov es,ax
|
int 47h
|
||||||
mov [xxyy2],3
|
push offset menu
|
||||||
mov [xxyy],3
|
call [print]
|
||||||
call calc1
|
mov ax,0B800h
|
||||||
call calc2
|
mov es,ax
|
||||||
|
mov xxyy2,3
|
||||||
|
mov xxyy,3
|
||||||
|
call calc1
|
||||||
|
call calc2
|
||||||
waitst:
|
waitst:
|
||||||
mov ax,0
|
mov ax,0
|
||||||
int 16h
|
int 16h
|
||||||
cmp ah,41h
|
cmp ah,41h
|
||||||
jne tre
|
jne tre
|
||||||
mov [dword ptr pope],' EUV'
|
mov dword ptr [pope],'WEIV'
|
||||||
push cs
|
push cs
|
||||||
pop es
|
pop ds
|
||||||
call [writesector],[sect],offset buffer
|
mov cx,sect
|
||||||
jnc waitkey
|
mov si,offset buffer
|
||||||
|
mov ah,1
|
||||||
|
int 48h
|
||||||
|
jnc adres
|
||||||
jmp errtr
|
jmp errtr
|
||||||
tre:
|
tre:
|
||||||
cmp al,0
|
cmp al,0
|
||||||
jne write
|
jne write
|
||||||
cmp ah,48h
|
cmp ah,48h
|
||||||
jne tre1
|
jne tre1
|
||||||
cmp [yy],0
|
cmp yy,0
|
||||||
je waitst
|
je waitst
|
||||||
dec [yy]
|
dec yy
|
||||||
jmp cursor
|
jmp cursor
|
||||||
tre1:
|
tre1:
|
||||||
cmp ah,50h
|
cmp ah,50h
|
||||||
jne tre2
|
jne tre2
|
||||||
mov al,[lastline]
|
mov al,infos
|
||||||
dec al
|
dec al
|
||||||
xor ah,ah
|
xor ah,ah
|
||||||
cmp [yy],ax
|
cmp yy,ax
|
||||||
je waitst
|
je waitst
|
||||||
inc [yy]
|
inc yy
|
||||||
jmp cursor
|
jmp cursor
|
||||||
tre2:
|
tre2:
|
||||||
cmp ah,4Dh
|
cmp ah,4Dh
|
||||||
jne tre4
|
jne tre4
|
||||||
cmp [xx],15
|
cmp xx,15
|
||||||
je waitst
|
je waitst
|
||||||
inc [xx]
|
inc xx
|
||||||
jmp cursor
|
jmp cursor
|
||||||
tre4:
|
tre4:
|
||||||
cmp ah,4Bh
|
cmp ah,4Bh
|
||||||
jne waitst
|
jne waitst
|
||||||
cmp [xx],0
|
cmp xx,0
|
||||||
je waitst
|
je waitst
|
||||||
dec [xx]
|
dec xx
|
||||||
jmp cursor
|
jmp cursor
|
||||||
write:
|
write:
|
||||||
call asciihex2dec
|
call AsciiHex2dec
|
||||||
cmp cl,15
|
cmp cl,15
|
||||||
ja waitst
|
ja waitst
|
||||||
call calc1
|
call calc1
|
||||||
call calc2
|
call calc2
|
||||||
mov edi,[es:bx-1]
|
mov byte ptr es:[bx],0112
|
||||||
mov dx,[es:si-1]
|
mov es:[bx-1],al
|
||||||
mov [byte ptr es:bx],0112
|
|
||||||
mov [es:bx-1],al
|
|
||||||
writs:
|
writs:
|
||||||
mov ax,0
|
mov ax,0
|
||||||
int 16h
|
int 16H
|
||||||
mov ch,cl
|
mov ch,cl
|
||||||
call asciihex2dec
|
call AsciiHex2dec
|
||||||
cmp cl,15
|
cmp cl,15
|
||||||
ja writs
|
ja writs
|
||||||
shl ch,4
|
shl ch,4
|
||||||
add ch,cl
|
add ch,cl
|
||||||
mov [es:bx+1],al
|
mov es:[bx+1],al
|
||||||
mov [es:si-1],ch
|
mov es:[si-1],ch
|
||||||
mov ax,bx
|
mov ax,bx
|
||||||
call calc3
|
call calc3
|
||||||
mov [bx],ch
|
mov [bx],ch
|
||||||
inc [xx]
|
inc xx
|
||||||
cmp [xx],16
|
cmp xx,16
|
||||||
jne pasde
|
jne pasde
|
||||||
inc [yy]
|
inc yy
|
||||||
mov [xx],0h
|
mov xx,0h
|
||||||
pasde:
|
pasde:
|
||||||
call calc1
|
call calc1
|
||||||
call calc2
|
call calc2
|
||||||
jmp waitst
|
jmp waitst
|
||||||
|
|
||||||
cursor:
|
cursor:
|
||||||
call calc1
|
call calc1
|
||||||
call calc2
|
call calc2
|
||||||
jmp waitst
|
jmp waitst
|
||||||
suit7:
|
suit7:
|
||||||
cmp ax,4200h
|
cmp ax,4200h
|
||||||
jne adres
|
jne adres2
|
||||||
call [restorestate]
|
mov ah,29h
|
||||||
retf
|
int 47H
|
||||||
|
retf
|
||||||
|
|
||||||
calc1:
|
calc1:
|
||||||
push ax dx si
|
push ax dx si
|
||||||
mov ax,[xx]
|
mov ax,xx
|
||||||
mov dx,[xx]
|
mov dx,xx
|
||||||
shl ax,2
|
shl ax,2
|
||||||
shl dx,1
|
shl dx,1
|
||||||
add ax,dx
|
add ax,dx
|
||||||
add ax,27
|
add ax,27
|
||||||
mov bx,[yy]
|
mov bx,YY
|
||||||
mov dx,[yy]
|
mov dx,yy
|
||||||
shl bx,5
|
shl bx,5
|
||||||
shl dx,7
|
shl dx,7
|
||||||
add bx,dx
|
add bx,dx
|
||||||
add bx,ax
|
add bx,ax
|
||||||
mov [byte ptr es:bx],112
|
mov byte ptr es:[bx],112
|
||||||
mov [byte ptr es:bx+2],112
|
mov byte ptr es:[bx+2],112
|
||||||
mov si,[xxyy]
|
mov si,xxyy
|
||||||
mov [byte ptr es:si],07
|
mov byte ptr es:[si],07
|
||||||
mov [byte ptr es:si+2],07
|
mov byte ptr es:[si+2],07
|
||||||
mov [xxyy],bx
|
mov xxyy,bx
|
||||||
pop si dx ax
|
pop si dx ax
|
||||||
ret
|
ret
|
||||||
|
|
||||||
calc2:
|
calc2:
|
||||||
push ax bx dx
|
push ax bx dx
|
||||||
mov si,[yy]
|
mov si,YY
|
||||||
mov dx,[yy]
|
mov dx,yy
|
||||||
shl si,5
|
shl si,5
|
||||||
shl dx,7
|
shl dx,7
|
||||||
add si,dx
|
add si,dx
|
||||||
mov dx,[xx]
|
add si,2
|
||||||
shl dx,1
|
mov dx,xx
|
||||||
add si,dx
|
shl dx,1
|
||||||
add si,129
|
add si,dx
|
||||||
mov [byte ptr es:si],112
|
add si,127
|
||||||
mov bx,[xxyy2]
|
mov byte ptr es:[si],112
|
||||||
mov [byte ptr es:bx],07
|
mov bx,xxyy2
|
||||||
mov [xxyy2],si
|
mov byte ptr es:[bx],07
|
||||||
pop dx bx ax
|
mov xxyy2,si
|
||||||
ret
|
pop dx bx ax
|
||||||
|
ret
|
||||||
|
|
||||||
calc3:
|
calc3:
|
||||||
push dx
|
push dx
|
||||||
xor bx,bx
|
xor bx,bx
|
||||||
mov bx,[xx]
|
mov bx,xx
|
||||||
mov dx,[yy]
|
mov dx,yy
|
||||||
shl dx,4
|
shl dx,4
|
||||||
add bx,dx
|
add bx,dx
|
||||||
add bx,bp
|
add bx,bp
|
||||||
|
@ -282,39 +319,35 @@ calc3:
|
||||||
pop dx
|
pop dx
|
||||||
ret
|
ret
|
||||||
|
|
||||||
asciihex2dec:
|
asciihex2dec:
|
||||||
cmp al,'a'
|
cmp al,'a'
|
||||||
jb nomin
|
jb nomin
|
||||||
cmp al,'f'
|
cmp al,'f'
|
||||||
ja nomin
|
ja nomin
|
||||||
sub al,'a'-'A'
|
sub al,'a'-'A'
|
||||||
jmp ismaj
|
jmp ismaj
|
||||||
nomin:
|
nomin:
|
||||||
cmp al,'A'
|
cmp al,'A'
|
||||||
jb nomaj
|
jb nomaj
|
||||||
cmp al,'F'
|
cmp al,'F'
|
||||||
ja nomaj
|
ja nomaj
|
||||||
ismaj:
|
ismaj:
|
||||||
mov cl,al
|
mov cl,al
|
||||||
sub cl,'A'-10
|
sub cl,'A'-10
|
||||||
jmp endt
|
jmp endt
|
||||||
nomaj:
|
nomaj:
|
||||||
mov cl,al
|
mov cl,al
|
||||||
sub cl,'0'
|
sub cl,'0'
|
||||||
endt:
|
endt:
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
dep db ':',0
|
||||||
|
sect dw 0
|
||||||
xx dw 0
|
xx dw 0
|
||||||
yy dw 0
|
yy dw 0
|
||||||
xxyy dw 3
|
xxyy dw 3
|
||||||
xxyy2 dw 3
|
xxyy2 dw 3
|
||||||
|
|
||||||
lastline db 0
|
|
||||||
sizex db 0
|
|
||||||
sizex2 db 0
|
|
||||||
buffer db 2048 dup (0)
|
|
||||||
|
|
||||||
dep db ':',0
|
|
||||||
errordisk db '\c74Une erreur est apparue sur le lecteur, appuyez sur une touche ',0
|
errordisk db '\c74Une erreur est apparue sur le lecteur, appuyez sur une touche ',0
|
||||||
menu db '\c70Haut&Bas [F1/2] Secteur [F3/4] Charger/Sauver [F5/6] Mode [F7] Quit. [F8] '
|
menu db '\c70Haut&Bas [F1/2] Secteur [F3/4] Charger/Sauver [F5/6] Mode [F7] Quit. [F8] '
|
||||||
pope db 'VUE ',0
|
pope db 'VUE ',0
|
||||||
|
@ -322,25 +355,21 @@ spaces db '\c02%hW:%hW \c04| \c07',0
|
||||||
spaces2 db '\c04 | \c07',0
|
spaces2 db '\c04 | \c07',0
|
||||||
|
|
||||||
showbuffer db 35 dup (0FFh)
|
showbuffer db 35 dup (0FFh)
|
||||||
oldmode db 0
|
oldmode db 0
|
||||||
sect dw 0
|
infos db 40 dup (0)
|
||||||
infos vgainf <>
|
buffer db 2048 dup (0)
|
||||||
|
|
||||||
importing
|
imports:
|
||||||
use DISQUE,readsector
|
db "VIDEO.LIB::print",0
|
||||||
use DISQUE,writesector
|
print dd 0
|
||||||
use VIDEO,setvideomode
|
db "VIDEO.LIB::showhex",0
|
||||||
use VIDEO,savestate
|
showhex dd 0
|
||||||
use VIDEO,restorestate
|
db "VIDEO.LIB::showchar",0
|
||||||
use VIDEO,setxy
|
showchar dd 0
|
||||||
use VIDEO,addline
|
dw 0
|
||||||
use VIDEO,saveparamto
|
|
||||||
use VIDEO,disablescroll
|
|
||||||
use VIDEO,clearscreen
|
end start
|
||||||
use VIDEO.LIB,print
|
|
||||||
use VIDEO.LIB,showhex
|
|
||||||
use VIDEO.LIB,showchar
|
|
||||||
endi
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue