Compare commits

...

112 Commits

Author SHA1 Message Date
Nicolas Hordé dcc8d09fcf feat: fichier/répertoire effacé 2007-03-31 20:08:19 +00:00
Nicolas Hordé 44992d56af feat: fichier/répertoire effacé 2007-03-31 20:08:10 +00:00
Nicolas Hordé bd7b31f95f feat: fichier/répertoire effacé 2007-03-31 20:07:58 +00:00
Nicolas Hordé 465618e4d6 feat: rectification du numéro de version 2007-03-31 19:00:41 +00:00
Nicolas Hordé 7b1d14b6a6 feat: fichier/répertoire effacé 2007-03-31 18:54:13 +00:00
Nicolas Hordé da48430341 build: version bêta 1.3.2fr 2007-03-31 18:51:18 +00:00
Nicolas Hordé e8f7d8a1e7 feat: version bêta 1.3.2fr 2007-03-31 18:50:54 +00:00
Nicolas Hordé 8d0fd22134 feat: version bêta 1.3.2fr 2007-03-31 18:50:36 +00:00
Nicolas Hordé 9e47321c92 feat: version bêta 1.3.2fr 2007-03-31 18:50:14 +00:00
Nicolas Hordé 2eee63e178 feat: version bêta 1.3.2fr 2007-03-31 18:49:53 +00:00
Nicolas Hordé f86bd67d51 feat: version bêta 1.3.2fr 2007-03-31 18:49:30 +00:00
Nicolas Hordé bbf2e656c9 feat: version bêta 1.3.2fr 2007-03-31 18:46:23 +00:00
Nicolas Hordé f35d742f27 feat: version bêta 1.3.2fr 2007-03-31 18:44:49 +00:00
Nicolas Hordé 17228ba373 feat: version bêta 1.3.2fr
BREAKING CHANGE: attention modification majeure du code
2007-03-31 18:43:09 +00:00
Nicolas Hordé 23d5c9f89d build: effacement de *.ce plutot que *.exe 2007-03-31 18:27:22 +00:00
Nicolas Hordé 50ac83fe99 feat: ajout d'un retour far au début du programme pour éviter le plantage a l'exécution 2007-03-31 18:26:07 +00:00
Nicolas Hordé 630a9b95d2 feat: mise a jour des numéros de version 2007-03-31 18:24:41 +00:00
Nicolas Hordé 17a79d2e83 build: ajout de la clause INSTALL pour permettre de générer l'installation de COS 2007-03-31 15:41:48 +00:00
Nicolas Hordé c81bd038c7 fix: erreur de la compilation en .COM oubli du switch /c 2007-03-31 15:40:51 +00:00
Nicolas Hordé be9b278fdf feat: suppression du fichier test.asm qui est obsolète 2007-03-31 15:06:48 +00:00
Nicolas Hordé 970aeeb0a2 feat: ajout des commandes internes DETECT,SECTIONS,EXPORTS et IMPORTS 2007-03-31 15:00:23 +00:00
Nicolas Hordé 81e2660033 feat: déplacement de la description des sections pour qu'elle intègre une section Suppression de l'attente d'une touche au démarrage 2007-03-31 14:58:11 +00:00
Nicolas Hordé 517222ec54 feat: intégration du programme detect.asm dans le shell sous la forme de la commande detect 2007-03-31 12:25:27 +00:00
Nicolas Hordé e46b38631b build: suppression de la compilation du fichier memoire.asm 2007-03-31 11:57:09 +00:00
Nicolas Hordé 2c7b28df93 feat: suppression de l'exécutable memoire.asm qui fait double emploi avec la commande "mem" du shell. 2007-03-31 11:29:47 +00:00
Nicolas Hordé 2955cca945 feat: suppression des lignes de déboguages pour une version finale 2007-03-31 11:18:56 +00:00
Nicolas Hordé ea9ab47d47 fix: corrections de bogues : - lors d'essais multiples de lecture ou d'écriture dans la fonction "readsector" et "writesector" - dans les fonctions de projection-exécution 2007-03-31 11:17:07 +00:00
Nicolas Hordé bdcfa07476 fix: correction d'un bogue qui provoqué un dépassement de pile 2007-03-31 11:14:39 +00:00
Nicolas Hordé 95140e4da4 feat: logiciels permettant la compression et décompression au format RIP 2007-03-28 21:54:53 +00:00
Nicolas Hordé e23b67afd0 fix: correction de bogues dans la coloration Ajout de fonctionnalité a la commande MEM 2007-03-28 21:49:41 +00:00
Nicolas Hordé db544a7cbe fix: correction dans la fonction "decompressrle" Modifications de "projfile" et de "execfile" afin de pouvoir gérer les appels récurant en libraire. 2007-03-28 21:28:44 +00:00
Nicolas Hordé ab40064c1f fix: bogue dans la fonction "mbfree" la mémoire libre n'était pas affichée "libre" bogue dans la fonction "mballoc" qui n'utilisait pas le bon segment pour le programme appelant 2007-03-28 21:26:59 +00:00
Nicolas Hordé b9250f34ee feat: nom de fichier en majuscules 2007-03-28 21:25:28 +00:00
Nicolas Hordé 676c3ca407 fix: correction de quelques oublis 2007-03-28 21:24:53 +00:00
Nicolas Hordé 7c0c00a696 fix: correction de bogue temporaire 2007-03-28 21:23:55 +00:00
Nicolas Hordé dd7a8c05ee feat: mise à jour du code pour compilation sur LZASM en stdcall 2007-03-28 15:54:19 +00:00
Nicolas Hordé e1b6696324 feat: mise à jour du code pour compilation sur LZASM en stdcall 2007-03-28 15:53:56 +00:00
Nicolas Hordé 2f20a86d11 feat: mise a jour des fonctions "decompressrle" et "compressrle" au format STDCALL/CE 2007-03-28 15:53:26 +00:00
Nicolas Hordé 4e91970166 feat: modification de la gestion des contextes pour un usage plus étendu 2007-03-28 15:52:40 +00:00
Nicolas Hordé 5af55420ca feat: désactivation temporaire du gestionnaire d'interruption qui provoque l'instabilité du système Ajout de l'exportation des fonctions de contexte 2007-03-28 15:51:42 +00:00
Nicolas Hordé 2791d5868e feat: ajout de la commande REGS permettant d'afficher le contenu des registres processeurs 2007-03-28 15:50:22 +00:00
Nicolas Hordé 1ba80b5b98 feat: ajout des blocs d'exportations précédemment dans "mcb.asm" 2007-03-27 14:54:59 +00:00
Nicolas Hordé 13f6476a96 feat: déplacement du blocs d'exportation dans "systeme.asm" Ajout de la préservation d'ax dans la fonction "bioswaitkey" 2007-03-27 14:54:21 +00:00
Nicolas Hordé d911b9f44b feat: ajout de 3 fonctions testant IRR,ISR et IMR Suppression de la commande "readmaskirq" au profit de la commande "readimr" 2007-03-27 14:52:53 +00:00
Nicolas Hordé 368d613e9f feat: rajout de la commande "INT" et de la commande "IRQS" qui permettent l'exploration des interruptions et des IRQs 2007-03-27 14:51:28 +00:00
Nicolas Hordé 8abfe12dcb feat: ajout de l'initialisation du gestionnaire d'interruption au démarrage Ajout d'un pause avant le chargement du shell pour permettre de voir correctement le boot 2007-03-27 10:26:06 +00:00
Nicolas Hordé fa8dcc4442 fix: correction d'un bogue ne permettant plus d'identifier le père du bloc mémoire dans toutes les fonctions de restauration et de sauvegarde 2007-03-27 10:25:12 +00:00
Nicolas Hordé 3942d63f1e fix: correction d'un pointeur non précorrectioné et d'une erreur de frappe 2007-03-27 10:22:47 +00:00
Nicolas Hordé cc272f8bff feat: ajout de plusieurs fonctions permettant de gérer les vecteurs d'interruptions ("installirqhandler","irqhandler") et les contextes ("savecontext","restorecontextg") 2007-03-27 10:16:47 +00:00
Nicolas Hordé fb3a734cd2 feat: ajouts de structures pour la gestion des vecteurs d'interruption et des contextes 2007-03-27 10:14:59 +00:00
Nicolas Hordé 8f2ddfdab7 feat: mise à jour du code pour compilation sur LZASM en stdcall 2007-03-27 10:13:50 +00:00
Nicolas Hordé f8a1b7f118 build: compilation plus verbeuse 2007-03-27 10:12:45 +00:00
Nicolas Hordé 88c44c06ea build: compilation plus verbeuse 2007-03-27 10:12:34 +00:00
Nicolas Hordé 52808d4c15 build: compilation plus verbeuse 2007-03-27 10:12:20 +00:00
Nicolas Hordé a4e2e8f650 build: compilation plus verbeuse 2007-03-27 10:12:04 +00:00
Nicolas Hordé d2507210c9 build: compilation plus verbeuse 2007-03-27 10:11:51 +00:00
Nicolas Hordé c6db694ba2 feat: mise en minuscule de l'ensemble du fichier 2007-03-25 00:58:01 +00:00
Nicolas Hordé 08cd618e46 build: ajout de la compilation de bmp.lib 2007-03-25 00:44:24 +00:00
Nicolas Hordé c4cfd2b05c build: compilation de tout les programmes 2007-03-25 00:17:54 +00:00
Nicolas Hordé def6ea675d fix: correction d'un bogue dans l'implémentation de la fonction "verifysector" (inverse) 2007-03-25 00:13:54 +00:00
Nicolas Hordé 1f1e1628b1 feat: mise à jour du code pour compilation sur LZASM en stdcall 2007-03-25 00:12:18 +00:00
Nicolas Hordé 1d17c0fc92 feat: mise à jour du code pour compilation sur LZASM en stdcall 2007-03-24 19:52:56 +00:00
Nicolas Hordé 1742c77553 feat: mise à jour du code pour compilation sur LZASM en stdcall 2007-03-24 19:39:03 +00:00
Nicolas Hordé 35af9ebbed fix: correction d'un bogue dans la fonction "showsigned" (argument en trop dans l'appel de showint) Suppression de l'appel a l'int 47h sans la fonction "print" 2007-03-24 19:38:31 +00:00
Nicolas Hordé 694f7cf605 fix: correction d'un bogue (paramètre en trop) dans les fonctions "page1to2" et "page2to1" 2007-03-24 19:36:59 +00:00
Nicolas Hordé a7c923e5fb fix: correction de bogue dans les nouvelles fonctions (oublie de se mettre sur CS) 2007-03-23 22:33:56 +00:00
Nicolas Hordé 1d3ce9c6e6 feat: mise à jour du code pour compilation sur LZASM en stdcall 2007-03-23 22:33:05 +00:00
Nicolas Hordé 2e23d3853b feat: mise à jour du code pour compilation sur LZASM en stdcall 2007-03-23 21:46:21 +00:00
Nicolas Hordé 2b1f562890 build: ajout de la copie des *.lib de "programs" dans "make copy" 2007-03-23 17:54:43 +00:00
Nicolas Hordé d352c80b5d build: compilation par paquets des toutes les librairies 2007-03-23 17:46:05 +00:00
Nicolas Hordé dcb2c5a203 feat: suppression de "format.asm" qui fait double usage avec la librairie "str0.asm" 2007-03-23 17:42:05 +00:00
Nicolas Hordé 226db1c980 feat: déplacement de "str0.asm" au sein du répertoire dédié aux librairies 2007-03-23 17:39:01 +00:00
Nicolas Hordé ede79c0bd9 feat: déplacement de "str0.asm" au sein du répertoire dédié aux librairies 2007-03-23 17:37:28 +00:00
Nicolas Hordé 79296d337d feat: mise à jour du code pour compilation sur LZASM en stdcall 2007-03-23 16:53:15 +00:00
Nicolas Hordé 3218661366 feat: mise à jour du code pour compilation sur LZASM en stdcall 2007-03-23 16:53:04 +00:00
Nicolas Hordé c83c7cf1fe feat: mise à jour du code pour compilation sur LZASM en stdcall 2007-03-23 16:52:46 +00:00
Nicolas Hordé 85ea3e1514 feat: mise à jour du code pour compilation sur LZASM en stdcall 2007-03-23 16:52:17 +00:00
Nicolas Hordé a756911670 feat: mise à jour du code pour compilation sur LZASM en stdcall 2007-03-23 16:52:11 +00:00
Nicolas Hordé 2dba1d4217 feat: mise à jour du code pour compilation sur LZASM en stdcall 2007-03-23 16:52:03 +00:00
Nicolas Hordé a7110cd360 build: mise à jour du code pour compilation sur LZASM en stdcall 2007-03-23 16:50:55 +00:00
Nicolas Hordé 33abc91a3e build: ajout de la compilation du répertoire "programs" 2007-03-23 16:49:56 +00:00
Nicolas Hordé 1582591ab8 fix: correction d'un bogue dans la fonction "getxy" (paramètre en trop) Ajout de nombreuses exportations qui n'étaient alors pas au format STDCALL/CE (sauvegarde/restaurations) 2007-03-23 16:49:04 +00:00
Nicolas Hordé 2a1dd56ef4 feat: rajout du précorrectione CS sur tout les appels 2007-03-23 16:47:20 +00:00
Nicolas Hordé abb4ab5b5a fix: prise en charge de la projection de librairie a la demande dans la fonction "mbloadfuncs" Correction d'un bogue dans la fonction "mbsearchfunc" 2007-03-23 16:46:35 +00:00
Nicolas Hordé f145c0617c feat: ajout du chargement de la FAT12 en bloc mémoire Mise a jour STDCALL/CE de la fonction "changedir" Remaniement total des fonctions loadfile, projfile, execfile La fonction "cmpnames" prend en compte les répertoires "." et ".." 2007-03-23 16:42:51 +00:00
Nicolas Hordé 780f0d4287 feat: ajout de la fonction "showchar" et importation de la fonction "VIDEO::SHOWCHARS" plutôt que "VIDEO::SHOWCHAR" pour éviter les conflits 2007-03-23 16:38:39 +00:00
Nicolas Hordé cda46c39be fix: correction d'un bogue dans "getcardinfo" 2007-03-23 16:36:54 +00:00
Nicolas Hordé 171ec40b83 fix: correction de bogues dans les fonctions "compstr" et "evalue" 2007-03-23 16:33:45 +00:00
Nicolas Hordé a733711bc2 fix: mise à jour du code pour compilation sur LZASM en stdcall Déclaration des imports et exports en utilisant les macros Changement de lettre pour désignation de chaîne dans la fonction "checksyntax" Utilisation de "str0.lib" plutôt qu'une inclusion de code Correction de quelques bogues dans l'application des couleurs 2007-03-23 16:31:09 +00:00
Nicolas Hordé 48fd1d4ca3 feat: mise à jour du code pour compilation sur LZASM en stdcall Passage au format CE, offset a 0 Déclaration des imports et exports en utilisant les macros 2007-03-23 16:27:16 +00:00
Nicolas Hordé a646265760 feat: mise à jour du code pour compilation sur LZASM en stdcall Passage au format CE, offset a 0 Déclaration des imports et exports en utilisant les macros 2007-03-23 16:26:58 +00:00
Nicolas Hordé 474e2aedbb feat: permet de tester la librairie STR0.asm 2007-03-19 10:44:44 +00:00
Nicolas Hordé ef63b674bd feat: exécution du shell "commande.ce" a la fin du chargement du système Passage d'argument modifié lors de l'appel de la fonction "mbloadsection" 2007-03-18 20:46:18 +00:00
Nicolas Hordé cccc113a35 fix: dans la fonction "mbloadsection" : - bogue corrigé lors du chargement d'un fichier CE avec sections vides - Utilisation d'un pointeur sur le segment plutôt que le bloc lui même en tant que paramètre 2007-03-18 20:44:40 +00:00
Nicolas Hordé d61a193186 feat: finalisation des commandes "execfile" et "projfile" Prise en compte des sections dans la commande execfile 2007-03-18 20:39:24 +00:00
Nicolas Hordé a0c5c481fd fix: bogue corrigé avec l'oubli du "e" de commande 2007-03-18 20:36:59 +00:00
Nicolas Hordé d37324ac00 build: rajout de la commande COPY Ajout de la compilation du dossier commande 2007-03-18 20:33:32 +00:00
Nicolas Hordé dec9675b7d build: compilation pour format CE sans include 2007-03-18 20:30:58 +00:00
Nicolas Hordé e8e82d8713 feat: mise à jour du code pour compilation sur LZASM en stdcall Passage au format CE, offset a 0 2007-03-18 20:28:51 +00:00
Nicolas Hordé f8f8bdfff3 feat: utilisation de macros pour les importations 2007-03-18 20:27:31 +00:00
Nicolas Hordé fe2558dda0 feat: logiciel permettant d'explorer les ressources d'un exécutable au format CE (sections, importations, exportations) 2007-03-17 11:48:35 +00:00
Nicolas Hordé d539bd2d8c feat: déclaration des imports et exports en utilisant les macros Ajout de la section DISQUE Detection de vmware 2007-03-14 11:20:13 +00:00
Nicolas Hordé d920b35473 feat: déclaration des imports et exports en utilisant les macros 2007-03-14 11:18:58 +00:00
Nicolas Hordé 4d03b78533 build: mise à jour du code pour compilation de disque.asm (DISQUE) 2007-03-14 11:11:18 +00:00
Nicolas Hordé b0cf779a88 feat: mise à jour du code pour compilation sur LZASM en stdcall 2007-03-14 11:07:54 +00:00
Nicolas Hordé a9f30e0e43 feat: mise a jour de l'emplacement vers lequel le systeme est copié (0x8000) 2007-03-14 11:03:25 +00:00
Nicolas Hordé c1d24b71fe feat: déclaration des imports et exports en utilisant les macros 2007-03-14 10:22:42 +00:00
Nicolas Hordé 8cc5b8aa70 feat: rajout d'une structure pour la sauvegarde et la restauration de l'état de la carte video 2007-03-14 10:03:40 +00:00
Nicolas Hordé 25420a02cc feat: rajout d'une structure permettant de réaliser des recherches 2007-03-14 10:03:11 +00:00
Nicolas Hordé 626ce27670 feat: rajout de macros pour une declaration plus lisible des entêtes, importations et exportations 2007-03-14 10:02:16 +00:00
Nicolas Hordé a126bbdf55 Merge tag '1.3.1' into develop
Merge avec develop 1.3.1
2007-03-13 20:49:51 +00:00
Nicolas Hordé a845b77632 Merge tag '1.3.0' into develop
Merge avec master 1.3.0
2007-03-13 20:44:48 +00:00
61 changed files with 5004 additions and 8844 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 111 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 126 KiB

File diff suppressed because it is too large Load Diff

View File

@ -11,9 +11,31 @@ all:
make make
cd .. cd ..
copy: cd commande
make all make
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
@ -27,3 +49,11 @@ clean:
cd install cd install
make clean make clean
cd .. cd ..
cd commande
make clean
cd ..
cd programs
make clean
cd ..

View File

@ -2,12 +2,14 @@
## 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)

View File

@ -1,17 +1,20 @@
lnk_boot = tlink /x asm= lzasm /z/t
asm= tasm /t/m5/zi lnk= elink
lnk= tlink /x/t
all: commande.exe all: commande.ce
commande.exe: commande.asm str0.asm commande.ce: commande.obj
$(asm) commande $(lnk) commande.obj commande.ce
$(lnk) commande
ren commande.com commande.exe commande.obj: commande.asm
$(asm) commande.asm
clean: clean:
del *.obj del *.obj
del *.exe del *.ce
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

View File

@ -1,857 +0,0 @@
;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 lments 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'lment 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 pointe par ds:si lment 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 pointe 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 pointe 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 pointe 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 pointe 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 dlimiteur par dfaut
SetDelimiter0:
mov cs:delim,dl
ret
;Renvoie le dlimiteur par dfaut dans dl
GetDelimiter0:
mov dl,cs:delim
ret
delim db 0
;Dtruit les dlimiteur qui sont conscutifs 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'lments … 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'lment 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'lment 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'lment 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'lments 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 pointe 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 pointe 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

View File

@ -1,25 +0,0 @@
.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

View File

@ -1,14 +1,27 @@
[bits 16] ;16 bits [bits 16] ;16 bits
[org 0x0100] ;Point d'entré en 0100h [org 0x0] ;Point d'entré en 0h
section .text ;Segment de code section .text ;Segment de code
start: checks db "CE" ;signature de l'exe
mov ah,0x0D major db 1 ;N° version
mov si,msg checksum dd 0 ;Checksum de l'exe
int 0x47 ;Afficher le texte (Showstring0) compressed db 0 ;a 1 si compressé par RLE
xor ax,ax exports dw 0 ;importation de fonctions
int 0x16 ;Attendre l'appuie sur une touche imports dw imported ;exportation de fonctions
retf ;retour far sections dw 0 ;sections des blocs mémoire
starting dw realstart
msg db 'Hello World',0 imported:
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

View File

@ -3,17 +3,29 @@
Smart ;Optimisations Smart ;Optimisations
.code ;Segment de code .code ;Segment de code
org 0100h ;Point d'entré en 0100h org 0h ;Point d'entré en 0h
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:
mov ah,0Dh push msg
mov si,offset msg call far [cs:print] ;Afficher le texte (Showstring0)
int 47h ;Afficher le texte (Showstring0) xor ax,ax
xor ax,ax int 16h ;Attendre l'appuie sur une touche
int 16h ;Attendre l'appuie sur une touche db 0CBH ;retour far
db 0CBH ;retour far
msg db 'Hello World',0 msg db 'Hello World !!',0
end start end start

Binary file not shown.

View File

@ -1,40 +1,40 @@
BMP_File struc struc bmp_file
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 ?
BMP_file ends ends bmp_file
;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

View File

@ -28,6 +28,15 @@ 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

View File

@ -2,3 +2,25 @@ 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

View File

@ -1,3 +1,50 @@
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
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
@ -29,4 +76,49 @@ 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

View File

@ -1,10 +1,10 @@
asm= lzasm asm= lzasm /z/t
lnk= elink lnk= elink
all: setup.com all: setup.com
setup.com: setup.obj setup.com: setup.obj
$(lnk) setup.obj setup.com $(lnk) setup.obj setup.com /c
setup.obj: setup.obj:
$(asm) setup.asm $(asm) setup.asm

View File

@ -11,7 +11,7 @@ ent equ 32h
jmp copycos jmp copycos
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,'$' message db 0Dh,0Ah,'COS 2000 V1.3.2BetaFr 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,'$'

View File

@ -1,23 +1,17 @@
asm= lzasm asm= lzasm /z/t
lnk= elink lnk= elink
all: detect.lib video.lib all: detect.lib video.lib str0.lib bmp.lib
detect.lib: detect.obj .asm.obj:
$(lnk) detect.obj detect.lib $(asm) $<
video.lib: video.obj .obj.lib:
$(lnk) video.obj video.lib $(lnk) $< $*.lib
detect.obj:
$(asm) detect.asm
video.obj:
$(asm) video.asm
clean: clean:
del *.obj del *.obj
del *.exe del *.ce
del *.bak del *.bak
del *.lib del *.lib
del *.com del *.com

View File

@ -1,77 +1,72 @@
.model tiny model tiny,stdcall
.486 p586N
smart
locals locals
.code jumps
codeseg
option procalign:byte
include "..\include\mem.h"
include "..\include\divers.h"
include "..\include\bmp.h"
org 0h org 0h
include ..\include\mem.h
include ..\include\bmp.h
start: start:
header exe <,1,0,,,,offset exports,> header exe <"CE",1,0,0,offset exports,offset imports,,>
exports:
db "showbmp",0
dw showbmp
db "loadbmppalet",0
dw loadbmppalet
dw 0
exporting
declare showbmp
declare loadbmppalet
ende
importing
use VIDEO,showpixel
endi
;==========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
;-> ;->
;========================== ;==========================
showbmp PROC FAR PROC showbmp FAR
ARG pointer:word, x:word, y:word=taille ARG @pointer:word, @x:word, @y:word
push bp USES ax,bx,cx,dx,si,di
mov bp,sp mov si,[@pointer]
push ax bx cx dx si di cmp [word ptr (bmp_file si).bmp_filetype],"MB"
mov si,[pointer]
cmp word ptr [si+BMP_file.BMP_FileType],"MB"
jne @@errorshowing jne @@errorshowing
mov edi,[si+BMP_BitMapOffset] mov edi,[(bmp_file si).bmp_bitmapoffset]
add di,400h
add di,si add di,si
mov ah,8
xor ebx,ebx xor ebx,ebx
mov ecx,[si+offset BMP_File.BMP_height] mov ecx,[(bmp_file si).bmp_height]
mov edx,[si+offset BMP_File.BMP_width] mov edx,[(bmp_file si).bmp_width]
and dx,11111100b ;and dx,11111100b
cmp edx,[si+offset BMP_File.BMP_width] cmp edx,[(bmp_file si).bmp_width]
jae @@noadjust ;jae @@noadjust
add dx,4 ;add dx,4
@@noadjust: @@noadjust:
sub dx,[si+offset BMP_File.BMP_width] sub edx,[(bmp_file si).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]
int 47h call [cs:showpixel],bx,cx,[word ptr di]
pop cx bx pop cx bx
inc bx inc bx
inc di inc di
cmp ebx,[si+offset BMP_File.BMP_width] cmp ebx,[(bmp_file si).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
pop di si dx cx bx ax ret
pop bp
retf taille
@@errorshowing: @@errorshowing:
stc stc
pop di si cx bx ax ret
pop bp ENDP showbmp
retf taille
showbmp ENDP
;==========LOADBMPPALET========= ;==========LOADBMPPALET=========
@ -79,16 +74,14 @@ showbmp ENDP
;-> DS:%0 BMP ;-> DS:%0 BMP
;<- ;<-
;=============================== ;===============================
loadbmppalet PROC FAR PROC loadbmppalet FAR
ARG pointer:word=taille ARG @pointer:word
push bp USES ax,bx,cx,dx,si
mov bp,sp mov si,[@pointer]
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
@ -105,10 +98,8 @@ paletteload:
sub bx,4 sub bx,4
dec dx dec dx
dec cl dec cl
jnz paletteload jnz @@paletteload
pop si dx cx bx ax ret
pop bp ENDP loadbmppalet
retf taille
loadbmppalet ENDP
end start

View File

@ -13,28 +13,18 @@ org 0h
header exe <"CE",1,0,0,offset exports,,,> header exe <"CE",1,0,0,offset exports,,,>
exports: exporting
db "cpuinfo",0 declare cpuinfo
dw cpuinfo declare setinfo
db "setinfo",0 declare pciinfo
dw setinfo declare getpciclass
db "pciinfo",0 declare getpcisubclass
dw pciinfo declare getcardinfo
db "getpciclass",0 declare pcireadbyte
dw getpciclass declare pcireadword
db "getpcisubclass",0 declare pcireaddword
dw getpcisubclass declare detectvmware
db "getcardinfo",0 ende
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
@ -317,6 +307,7 @@ 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
@ -327,7 +318,6 @@ 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
@ -351,7 +341,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
@ -373,7 +363,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
@ -395,7 +385,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

993
lib/str0.asm Normal file
View File

@ -0,0 +1,993 @@
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 lments 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'lment 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 pointe par ds:%0 lment %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 pointe 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 pointe 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 pointe 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 pointe 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
;Dtruit les dlimiteur qui sont conscutifs 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'lments 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'lment %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'lment %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'lment %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'lments 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 pointe 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 pointe 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

View File

@ -11,63 +11,41 @@ org 0h
header exe <"CE",1,0,0,offset exports,offset imports,,> header exe <"CE",1,0,0,offset exports,offset imports,,>
exports: exporting
db "print",0 declare print
dw print declare showdate
db "showdate",0 declare showtime
dw showdate declare showname
db "showtime",0 declare showattr
dw showtime declare showsize
db "showname",0 declare showspace
dw showname declare showint
db "showattr",0 declare showsigned
dw showattr declare showhex
db "showsize",0 declare showbin
dw showsize declare showbcd
db "showspace",0 declare showstring
dw showspace declare showstring0
db "showint",0 declare showintr
dw showint declare showintl
db "showsigned",0 declare showchar
dw showsigned ende
db "showhex",0
dw showhex importing
db "showbin",0 use VIDEO,addline
dw showbin use VIDEO,setcolor
db "showbcd",0 use VIDEO,getxy
dw showbcd use VIDEO,setxy
db "showstring",0 use VIDEO,setvideomode
dw showstring use VIDEO,setfont
db "showstring0",0 use VIDEO,clearscreen
dw showstring0 use VIDEO,enablescroll
db "showintr",0 use VIDEO,disablescroll
dw showintr use VIDEO,showchars
db "showintl",0 use VIDEO,savestate
dw showintl use VIDEO,restorestate
dw 0 endi
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
@ -89,7 +67,7 @@ PROC print FAR
je @@special2 je @@special2
@@showit: @@showit:
xor ch,ch xor ch,ch
call [cs:showchar],cx,0FFFFh call [cs:showchars],cx,0FFFFh
inc si inc si
jmp @@strinaize0 jmp @@strinaize0
@@special: @@special:
@ -100,7 +78,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 @@showchar je @@showchars
cmp cl,'u' cmp cl,'u'
je @@showint je @@showint
cmp cl,'v' cmp cl,'v'
@ -132,10 +110,10 @@ PROC print FAR
clc clc
jmp @@no0 jmp @@no0
@@showchar: @@showchars:
cmp [byte ptr si+2],'M' cmp [byte ptr si+2],'M'
je @@showmultchar je @@showmultchar
call [cs:showchar],[word ptr @@pointer+di+2],0FFFFh call [cs:showchars],[word ptr @@pointer+di+2],0FFFFh
add si,2 add si,2
add di,2 add di,2
jmp @@strinaize0 jmp @@strinaize0
@ -143,10 +121,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
@@showcharx: @@showcharsx:
call [cs:showchar],[word ptr @@pointer+di+2],0FFFFh call [cs:showchars],[word ptr @@pointer+di+2],0FFFFh
dec cx dec cx
jnz @@showcharx jnz @@showcharsx
@@nextfunc: @@nextfunc:
add si,3 add si,3
add di,4 add di,4
@ -351,7 +329,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] call [cs:setvideomode],ax
add si,4 add si,4
jmp @@strinaize0 jmp @@strinaize0
@ -380,14 +358,12 @@ PROC print FAR
jmp @@strinaize0 jmp @@strinaize0
@@savestate: @@savestate:
mov ah,40 call [cs:savestate]
int 47h
add si,2 add si,2
jmp @@strinaize0 jmp @@strinaize0
@@restorestate: @@restorestate:
mov ah,41 call [cs:restorestate]
int 47h
add si,2 add si,2
jmp @@strinaize0 jmp @@strinaize0
@ -422,8 +398,6 @@ 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
@ -439,7 +413,6 @@ 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
@ -455,12 +428,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:showchar],'/',0FFFFh call [cs:showchars],'/',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:showchar],'/',0FFFFh call [cs:showchars],'/',0FFFFh
mov dx,[@dates] mov dx,[@dates]
shr dx,8 shr dx,8
and dx,11111111b and dx,11111111b
@ -482,12 +455,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:showchar],':',0FFFFh call [cs:showchars],':',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:showchar],':',0FFFFh call [cs:showchars],':',0FFFFh
mov dx,[@times] mov dx,[@times]
and dx,11111b and dx,11111b
shl dx,1 shl dx,1
@ -506,12 +479,12 @@ PROC showname FAR
mov si,[@thename] mov si,[@thename]
xor cx,cx xor cx,cx
@@showthename: @@showthename:
call [cs:showchar],[word ptr ds:si],0FFFFh call [cs:showchars],[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:showchar],' ',0FFFFh call [cs:showchars],' ',0FFFFh
@@suiteaname: @@suiteaname:
cmp cx,8+3 cmp cx,8+3
jb @@showthename jb @@showthename
@ -533,7 +506,7 @@ PROC showattr FAR
@@noreadonly: @@noreadonly:
push '-' push '-'
@@readonly: @@readonly:
call [cs:showchar] call [cs:showchars]
push 0FFFFh push 0FFFFh
test [@attr],00000010b test [@attr],00000010b
je @@nohidden je @@nohidden
@ -542,7 +515,7 @@ PROC showattr FAR
@@nohidden: @@nohidden:
push '-' push '-'
@@hidden: @@hidden:
call [cs:showchar] call [cs:showchars]
push 0FFFFh push 0FFFFh
test [@attr],00000100b test [@attr],00000100b
je @@nosystem je @@nosystem
@ -551,7 +524,7 @@ PROC showattr FAR
@@nosystem: @@nosystem:
push '-' push '-'
@@system: @@system:
call [cs:showchar] call [cs:showchars]
push 0FFFFh push 0FFFFh
test [@attr],00100000b test [@attr],00100000b
je @@noarchive je @@noarchive
@ -560,7 +533,7 @@ PROC showattr FAR
@@noarchive: @@noarchive:
push '-' push '-'
@@archive: @@archive:
call [cs:showchar] call [cs:showchars]
push 0FFFFh push 0FFFFh
test [@attr],00010000b test [@attr],00010000b
je @@nodirectory je @@nodirectory
@ -569,7 +542,7 @@ PROC showattr FAR
@@nodirectory: @@nodirectory:
push '-' push '-'
@@directory: @@directory:
call [cs:showchar] call [cs:showchars]
ret ret
ENDP showattr ENDP showattr
@ -622,7 +595,7 @@ ENDP showsize
;<- ;<-
;============================== ;==============================
PROC showspace FAR PROC showspace FAR
call [cs:showchar],' ',0FFFFh call [cs:showchars],' ',0FFFFh
clc clc
ret ret
ENDP showspace ENDP showspace
@ -653,7 +626,7 @@ PROC showint FAR
@@showinteger: @@showinteger:
inc bx inc bx
mov cl,[cs:bx] mov cl,[cs:bx]
call [cs:showchar],cx,0FFFFh call [cs:showchars],cx,0FFFFh
dec ax dec ax
jnz @@showinteger jnz @@showinteger
ret ret
@ -700,7 +673,7 @@ PROC showintl FAR
@@showinteger: @@showinteger:
inc bx inc bx
mov cl,[cs:bx] mov cl,[cs:bx]
call [cs:showchar],cx,0FFFFh call [cs:showchars],cx,0FFFFh
dec ax dec ax
jnz @@showinteger jnz @@showinteger
ret ret
@ -745,7 +718,7 @@ PROC showintr FAR
@@showinteger: @@showinteger:
inc bx inc bx
mov cl,[cs:bx] mov cl,[cs:bx]
call [cs:showchar],cx,0FFFFh call [cs:showchars],cx,0FFFFh
dec ax dec ax
jnz @@showinteger jnz @@showinteger
ret ret
@ -783,9 +756,9 @@ PROC showsigned FAR
jbe @@notsigned jbe @@notsigned
neg edx neg edx
@@showminus: @@showminus:
call [cs:showchar],'-',0FFFFh call [cs:showchars],'-',0FFFFh
@@notsigned: @@notsigned:
call showint,edx,0FFFFh call showint,edx
ret ret
ENDP showsigned ENDP showsigned
@ -809,7 +782,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:showchar],cx,0FFFFh call [cs:showchars],cx,0FFFFh
dec al dec al
jnz @@Hexaize jnz @@Hexaize
ret ret
@ -835,7 +808,7 @@ PROC showbin FAR
rol edx,1 rol edx,1
mov cl,'0' mov cl,'0'
adc cl,0 adc cl,0
call [cs:showchar],cx,0FFFFh call [cs:showchars],cx,0FFFFh
dec al dec al
jnz @@binaize jnz @@binaize
ret ret
@ -861,7 +834,7 @@ PROC showbcd FAR
mov cl,dl mov cl,dl
and cl,0fh and cl,0fh
add cl,'0' add cl,'0'
call [cs:showchar],cx,0FFFFh call [cs:showchars],cx,0FFFFh
dec al dec al
jnz @@BCDaize jnz @@BCDaize
ret ret
@ -879,12 +852,23 @@ PROC showstring FAR
mov bl,[si] mov bl,[si]
@@strinaize: @@strinaize:
inc si inc si
call [cs:showchar],[word ptr si],0FFFFh call [cs:showchars],[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
@ -898,7 +882,7 @@ PROC showstring0 FAR
mov cl,[si] mov cl,[si]
cmp cl,0 cmp cl,0
je @@no0 je @@no0
call [cs:showchar],cx,0FFFFh call [cs:showchars],cx,0FFFFh
inc si inc si
jmp @@strinaize0 jmp @@strinaize0
@@no0: @@no0:

View File

@ -1,266 +0,0 @@
;****************************************************************
; *
; Periphrique : DMA *
; Plages Entres-Sorties : 0000-000F *
; 00C0-00DF *
; 0080-0090 *
; (0094-009F) *
; Plages Mmoires : AUCUNES *
; *
DmaRead equ 044h ;I/O to memory, no autoinit, increment, single mode
DmaWrite equ 048h ;Memory to I/O, no autoinit, increment, single mode
;Lecture des bits du registre d'tat (08, D0 )
STATUS_REQ3 = 80h ;Bit actif: le canal DMA concern
STATUS_REQ2 = 40h ;re‡oit une requˆte DMA
STATUS_REQ1 = 20h ;Request
STATUS_REQ0 = 10h
STATUS_TC3 = 08h ;Bit actif: Un transfert DMA a t
STATUS_TC2 = 04h ;excut depuis la derniŠre lecture
STATUS_TC1 = 02h ;du registre d'tat.
STATUS_TC0 = 01h ;Terminal Count
;Ecriture des bits du registre de commande (08, D0)
COMMAND_DACKLEVEL = 80h ;Bit 7 actif: ligne DMA Acknowledge HIGH active
COMMAND_DREQLEVEL = 40h ;Bit 6 actif: ligne REQ Acknowledge LOW active
COMMAND_EXTWRITE = 20h ;Bit 5 actif: EXTENDED Write,sinon LATE Write
COMMAND_FIXEDPRI = 10h ;Bit 4 actif: priorit constante
COMMAND_COMPRESS = 08h ;Bit 3 actif: compression
COMMAND_INACTIVE = 04h ;Bit 2 actif: contr“leur dsactiv
COMMAND_ADH0 = 02h ;Bit 1 actif: Adress Hold pour canal 0/4 dsactiv
COMMAND_MEM2MEM = 01h ;Bit 0 actif: mmoire/mmoire, sinon mmoire/priphrie
;Ecriture des bits du registre de requˆte ( 09, D2 )
REQUEST_RESERVED = 0F8h ;Rglage des bits rservs =0
REQUEST_SET = 04h ;Dfinir requˆte DMA
REQUEST_CLR = 00h ;Supprimer requˆte DMA
REQUEST_MSK = 03h ;Indiquer le canal dans les deux bits du bas
;Ecriture des bits du registre de masquage de canal ( 0A, D4 )
CHANNEL_RESERVED = 0F8h ;Rglage des bits rservs =0
CHANNEL_SET = 04h ;Masquer/verrouiller canal DMA
CHANNEL_CLR = 00h ;Librer canal DMA
CHANNEL_MSK = 03h ;Indiquer le canal dans les deux bits du bas
;Ecriture des bits du registre de mode (0B,D6)
MODE_DEMAND = 00h ;Transfrer … la demande
MODE_SINGLE = 40h ;Transfrer valeurs uniques
MODE_BLOCK = 80h ;Transfrer en bloc
MODE_CASCADE = 0C0h ;Transfrer en cascade
MODE_DECREMENT = 20h ;Dcrmenter
MODE_AUTOINIT = 10h ;Autoinitialisation vers la fin
MODE_VERIFY = 00h ;Vrifier
MODE_WRITE = 04h ;Ecrire dans la mmoire
MODE_READ = 08h ;Lire depuis la mmoire
MODE_INVALID = 0Ch ;Incorrect
MODE_CHANNELMSK = 03h ;Indiquer le canal dans les deux bits du bas
;Ports du DMA esclave
DmaStatusS dw 08h ;R SLAVE Registre d'tat
DmaCommandS dw 08h ;W SLAVE Registre de commande
DmaRequestS dw 09h ;W SLAVE Excuter requˆte DMA
DmachMaskS dw 0ah ;W SLAVE Masquer canaux
DmaModeS dw 0bh ;W SLAVE Mode de transfert
DmaFlipFlopS dw 0ch ;W SLAVE Flipflop adr/compteur
DmaTempS dw 0dh ;R SLAVE Reset du contr“leur
DmaClearS dw 0dh ;R SLAVE Registre temporaire
DmaMaskClrS dw 0eh ;R SLAVE Librer canaux
DmaMaskS dw 0fh ;R SLAVE Masquer canaux
;Ports du DMA esclave
DmaStatusM dw 0D0h ;R MASTER Registre d'tat
DmaCommandM dw 0D0h ;W MASTER Registre de commande
DmaRequestM dw 0D2h ;W MASTER Excuter requˆte DMA
DmaMaskM dw 0D4h ;W MASTER Masquer canaux
DmaModeM dw 0D6h ;W MASTER Mode de transfert
DmaFlipFlopM dw 0D8h ;W MASTER Flipflop adr/compteur
DmaTempM dw 0DAh ;R MASTER Reset du contr“leur
DmaClearM dw 0DAh ;R MASTER Registre temporaire
DmaMaskClrM dw 0DCh ;R MASTER Librer canaux
DmaMaskM2 dw 0DEh ;R MASTER Masquer canaux
DmaAdress db 00h ;DMA address register 0
db 002h ;DMA address register 1
db 004h ;DMA address register 2
db 006h ;DMA address register 3
db 0c0h ;DMA address register 4
db 0c4h ;DMA address register 5
db 0c8h ;DMA address register 6
db 0cch ;DMA address register 7
DmaCount db 001h ;DMA count registers 0
db 003h ;DMA count registers 1
db 005h ;DMA count registers 2
db 007h ;DMA count registers 3
db 0c2h ;DMA count registers 4
db 0c6h ;DMA count registers 5
db 0cah ;DMA count registers 6
db 0ceh ;DMA count registers 7
DmaPage db 087h ;DMA page registers 0
db 083h ;DMA page registers 1
db 081h ;DMA page registers 2
db 082h ;DMA page registers 3
db 08fh ;DMA page registers 4
db 08bh ;DMA page registers 5
db 089h ;DMA page registers 6
db 08ah ;DMA page registers 7
;verouille le canal AL
DisableDma:
push ax dx
cmp al, 4
jae MasterDisableDma
mov dx, DmaMaskS
or al, 00000100b
out dx, al
jmp EndDisableDma
MasterDisableDma:
mov dx, DmaMaskS
and al, 00000011b
or al, 00000100b
out dx, al
EndDisableDma:
pop dx ax
ret
;déverouille le canal AL
EnableDma:
push ax dx
cmp al, 4
jae MasterDisableDma
mov dx, DmaMaskS
out dx, al
jmp EndEnableDma
MasterEnableDma:
mov dx, DmaMaskS
and al, 00000011b
out dx, al
EndEnableDma:
pop dx ax
ret
;Efface le FlipFlop canal AL
ClrDmaFlipFlop:
push ax dx
cmp al, 4
jae MasterClrFlipFlopDma
mov dx,DmaFlipFlopS
xor ax, ax
out dx, al
jmp EndClrFlipFlopDma
MasterClrFlipFlopDma:
mov dx,DmaFlipFlopM
xor ax, ax
out dx, al
EndClrFlipFlopDma:
pop dx ax
ret
;Met le mode du canal al à ah
SetDmaMode:
push ax dx
cmp al, 4
jae MasterSetDmaMode
mov dx,DmaModeS
or al, ah
out dx, al
jmp EndSetDmaMode
MasterSetDmaMode:
mov dx,DmaModeM
and al, 00000011b
or al, ah
out dx, al
EndSetDmaMode:
pop dx ax
ret
;Met le page du canal al a ah
SetDmaPage:
push ax bx dx si
cmp al, 4
jae MasterSetDmaPage
mov si, offset DmaPage
xor dh, dh
xor bh, bh
mov bl, al
mov dl, cs:[si+bx]
xchg al, ah
out dx, al
jmp EndSetDmaPage
MasterSetDmaPage:
EndSetDmaPage:
pop si dx bx ax
ret
;Met l'adresse du canal al a DS:BX
SetDmaAdress:
push ax bx cx dx si
push ax
mov ax, ds
and ax, 0000111111111111b
shl ax,4
add bx, ax
mov ax, ds
and ax, 1111000000000000b
shr ax, 4
mov cx,ax
pop ax
push ax
add ax,cx
call SetDmaPage
pop ax
call ClrDmaFlipFlop
mov si, offset DmaAdress
xor dh, dh
push bx
xor bh, bh
mov bl, al
mov dl, byte ptr cs:[si+bx]
pop bx
cmp al, 4
jae MasterSetDmaAddress
mov al, bh
out dx, al
mov al, bl
out dx, al
jmp EndSetDmaAddress
MasterSetDmaAddress:
mov al, bh
out dx, al
call ClrDmaFlipFlop
mov al, bl
out dx, al
EndSetDmaAddress:
pop si dx cx bx ax
ret
;Spécifie au controleur DMA le nombre d'octets à transférer dans CX
SetDmaCount:
push ax bx dx si
call ClrDmaFlipFlop
mov si, offset DmaCount
xor dh, dh
xor bh, bh
mov bl, al
mov dl, byte ptr cs:[si+bx]
cmp al, 4
jae MasterSetDmaCount
mov al, ch
out dx, al
mov al, cl
out dx, al
jmp EndSetDmaCount
MasterSetDmaCount:
mov al, ch
out dx, al
call ClrDmaFlipFlop
mov al, cl
out dx, al
EndSetDmaCount:
pop si dx bx ax
ret

View File

@ -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 readmaskirq FAR PROC readimr FAR
ARG @controleur:word ARG @controleur:word
USES bx,dx USES bx,dx
mov bx,[@controleur] mov bx,[@controleur]
@ -104,7 +104,7 @@ PROC readmaskirq FAR
in al,dx in al,dx
pop dx pop dx
ret ret
endp readmaskirq endp readimr
;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,4 +139,277 @@ 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

View File

@ -1,14 +1,16 @@
asm= lzasm asm= lzasm /z/t
lnk= elink lnk= elink
all: systeme.sys boot.bin all: systeme.sys boot.bin
systeme.sys: video.obj systeme.obj systeme.sys: video.obj disque.obj systeme.obj
$(lnk) systeme.obj systeme.sys $(lnk) systeme.obj systeme.sys
systeme.obj: ../lib/detect.lib ../lib/video.lib video.sys systeme.obj: ..\lib\detect.lib ..\lib\video.lib video.sys disque.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
@ -16,12 +18,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

View File

@ -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,0900h mov ax,8000h
mov es,ax mov es,ax
push es push es
mov di,0000h mov di,0000h

View File

@ -1,261 +0,0 @@
.model tiny
.486
smart
.code
org 0h
include ..\include\mem.h
start:
jmp tsr
offsets dd 0
db 'KEYBOARD'
tsr:
pushf
db 2eh,0ffh,1eh
dw offsets
cli
cmp cs:isstate,1
je endofforce
mov cs:isstate,1
mov cs:eaxr,eax
in al,60h
cmp al,68
je F10
cmp al,87
je F11
cmp al,88
je F12
endof:
mov cs:isstate,0
mov eax,cs:eaxr
endofforce:
sti
iret
isstate db 0
infos db 40 dup (0)
feax dd 0
F10:
push cs
pop ds
mov si,offset com
mov ah,5
int 49h
pop ax
pop ax
pop ax
push gs
push gs
push gs
pop ds
pop es
pop fs
push gs
push size exe
sti
mov cs:[isstate],0
retf
com db 'COMMANDE.CE',0
F11:
push ax di es
push cs
pop es
mov di,offset infos
mov ah,34
int 47h
mov al,cs:[di+7]
inc al
cmp al,9
jbe notabove
mov al,0
notabove:
mov ah,0
int 47h
pop es di ax
jmp endof
f12:
pushad
pushf
push ds
mov cs:[eaxr],eax
mov cs:[ebxr],ebx
mov cs:[ecxr],ecx
mov cs:[edxr],edx
mov cs:[esir],esi
mov cs:[edir],edi
mov cs:[espr],esp
mov cs:[ebpr],ebp
mov cs:[csr],cs
mov cs:[dsr],ds
mov cs:[esr],es
mov cs:[fsr],fs
mov cs:[gsr],gs
mov cs:[ssr],ss
push cs
pop ds
mov si,offset sep
call Showstr
mov si,offset reg
mov di,offset regdata
mov bx,7
showregs:
cmp byte ptr cs:[si+6],":"
jne endshowregs
call Showstr
cmp byte ptr cs:[si+4]," "
je segsss
mov edx,cs:[di]
mov cx,32
call Showhex
add di,4
jmp showmax
segsss:
mov dx,cs:[di]
mov cx,16
call Showhex
add di,2
showmax:
add si,9
mov bp,dx
push si
mov si,offset beginds
call showstr
mov si,bp
mov cx,8
mov al,0
letshow:
mov dl,ds:[si]
inc si
call showhex
inc al
cmp al,10
jb letshow
mov si,offset ende
call showstr
mov si,offset begines
call showstr
mov si,bp
mov cx,8
mov al,0
letshow2:
mov dl,es:[si]
inc si
call showhex
inc al
cmp al,10
jb letshow2
mov si,offset ende
call showstr
pop si
jmp showregs
endshowregs:
mov si,offset sep
call Showstr
xor ax,ax
int 16h
pop ds
popf
popad
jmp endof
begines db ' es[',0
beginds db ' ds[',0
ende db '] ',0
;==============================Affiche le nombre nb hexa en EDX de taille CX et couleur BL==============
ShowHex:
push ax bx cx edx si di
mov di,cx
sub cx,32
neg cx
shl edx,cl
shr di,2
mov ah,09h
and bx,1111b
Hexaize:
rol edx,4
mov si,dx
and si,1111b
mov al,[si+offset tab]
push cx
mov cx,1
cmp al,32
jb control2
mov ah,09h
int 10h
control2:
mov ah,0Eh
int 10h
pop cx
dec di
jnz Hexaize
pop di si edx cx bx ax
ret
Tab db '0123456789ABCDEF'
;==============================Affiche une chaine DS:SI de couleur BL==============
showstr:
push ax bx cx si
mov cx,1
again:
lodsb
or al,al
jz fin
and bx,0111b
cmp al,32
jb control
mov ah,09h
int 10h
control:
mov ah,0Eh
int 10h
jmp again
fin:
pop si cx bx ax
ret
;================================================
;Routine de débogage
;================================================
regdata:
eaxr dd 0
ebxr dd 0
ecxr dd 0
edxr dd 0
esir dd 0
edir dd 0
espr dd 0
ebpr dd 0
csr dw 0
dsr dw 0
esr dw 0
fsr dw 0
gsr dw 0
ssr dw 0
reg db 0Dh,0Ah,"eax : ",0
db 0Dh,0Ah,"ebx : ",0
db 0Dh,0Ah,"ecx : ",0
db 0Dh,0Ah,"edx : ",0
db 0Dh,0Ah,"esi : ",0
db 0Dh,0Ah,"edi : ",0
db 0Dh,0Ah,"esp : ",0
db 0Dh,0Ah,"ebp : ",0
db 0Dh,0Ah,"cs : ",0
db 0Dh,0Ah,"ds : ",0
db 0Dh,0Ah,"es : ",0
db 0Dh,0Ah,"fs : ",0
db 0Dh,0Ah,"gs : ",0
db 0Dh,0Ah,"ss : ",0
sep db 0Ah,0Dh,'********************',0Ah,0Dh,0
end start

File diff suppressed because it is too large Load Diff

View File

@ -1,911 +0,0 @@
.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 lments 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'lment 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 pointe par ds:si lment 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 pointe 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 pointe 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 pointe 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 pointe 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 dlimiteur par dfaut
SetDelimiter0:
mov cs:delim,dl
ret
;Renvoie le dlimiteur par dfaut dans dl
GetDelimiter0:
mov dl,cs:delim
ret
delim db 0
;Dtruit les dlimiteur qui sont conscutifs 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'lments … 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'lment 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'lment 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'lment 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'lments 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 pointe 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 pointe 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

View File

@ -1,81 +0,0 @@
.model tiny
.486
smart
.code
org 0h
start:
jmp tsr
offsets dd 0
db 'HOURS'
tsr:
pushf
db 2eh,0ffh,1eh
dw offsets
cli
pusha
push ds es
push cs
push cs
pop ds
pop es
mov ah,22h
mov di,offset infos
int 47h
mov bl,[infos+1]
xor bh,bh
sub bl,8
mov di,bx
shl di,1
mov dx,71h
xor eax,eax
mov cx,0B800h
mov es,cx
mov cl,4
mov bp,8
show:
dec dx
mov al,cl
out dx,al
inc dx
in al,dx
call showbcd
cmp cl,0
je finic
mov byte ptr es:[di],':'
add di,2
sub cl,2
jmp show
finic:
pop es ds
popa
sti
iret
;==============================Affiche le nombre nb hexa en EDX==============
Showbcd:
push ax bx cx edx
mov edx,eax
mov cx,bp
sub cx,32
neg cx
shl edx,cl
mov ax,bp
shr ax,2
bcdaize:
rol edx,4
mov bx,dx
and bx,0fh
add bl,'0'
mov es:[di],bl
add di,2
dec al
jnz bcdaize
pop edx cx bx ax
ret
infos db 40 dup (0)
end start

View File

@ -1,32 +0,0 @@
.model tiny
.486
smart
.code
org 0h
start:
jmp tsr
offsets dd 0
db 'TIMER'
tsr:
pushf
db 2eh,0ffh,1eh
dw offsets
cli
push ax bx es
mov bx,cs:compteur
inc bx
and bx,11b
mov cs:compteur,bx
mov bx,cs:[offset fig+bx]
mov ax,0B800h
mov es,ax
mov es:[0],bl
pop es bx ax
sti
iret
compteur dw 0
fig db 'Ä\³/'
end start

View File

@ -1,298 +0,0 @@
.model tiny
.486
smart
.code
org 0h
start:
jmp tsr
drv db 'JOYSTICK',0
Tsr:
cli
cmp ax,1234h
jne nomore
mov ax,4321h
jmp itsok
nomore:
push bx
cmp byte ptr cs:isact,1
je nottest
mov cs:isact,1
jmp react
mov bl,ah
xor bh,bh
shl bx,1
mov bx,cs:[bx].tables
mov cs:current,bx
pop bx
call cs:current
itsok:
jnc noerror
push bp
mov bp,sp
or byte ptr [bp+6],1b
pop bp
mov ax,cs
shl eax,16
mov ax,cs:current
jmp endofint
noerror:
push bp
mov bp,sp
and byte ptr [bp+6],0FEh
pop bp
endofint:
mov cs:isact,0
sti
iret
nottest:
pop bx
jmp endofint
current dw 0
tables dw 0;detectjoystick
;dw getjoystick
;dw getjoystickscreen
;dw configjoystick
isact db 0
;envoie en bx,cx les coordonnes et en dl les boutons
getjoystick:
push ax cx
mov bx,cs:rx
mov cx,cs:ry
mov al,cs:button
not al
mov cl,4
shr al,cl
mov dl,al
pop cx ax
ret
;envoie en di les coordonnes ecran et en dl les boutons
getjoystickscreen:
push ax cx
mov di,cs:xy
mov al,cs:button
not al
mov cl,4
shr al,cl
mov dl,al
pop cx ax
ret
db 'button'
Button db 0
db 'rx'
rx dw 0
db 'ry'
ry dw 0
db 'vx'
VX db 0
db 'vy'
VY db 0
db 'x'
X dw 7FFFh
db 'y'
Y dw 7FFFh
speed db 6
spherex db 0
spherey db 0
db 'count'
count db 0
db 'error'
error db 0
xy dw 0
old db 0
calibrate db 0
db 'ticks'
ticks dw 0
db 'state'
state db 0
db 'connard'
connard db 1
connard2 db 1
;Gestionnaire de joystick
react:
push ax bx cx dx si di bp ds es
push cs
pop ds
mov dx,201h
cmp error, 1
je gest1
cmp count,1
je gest1
cmp count,2
je gest2
gest1:
mov error,0
mov count,2
call getticks
mov ticks,ax
out dx,al
in al,dx
and al,00000011b
mov state,al
jmp endgest
gest2:
not connard
call getticks
sub ax,ticks
cmp ax,1FF0h
jb nofinish
mov error,1
jmp endgest
nofinish:
mov bx,ax
in al,dx
and al,00000011b
cmp state,al
je endgest
xchg state,al
xor al,state
mov cl,4
or bx,bx
js noadj
shr bx,cl
noadj:
test al,1
je isy
mov VX,bl
jmp wasx
isy:
test al,2
je endgest
mov VY,bl
wasx:
mov connard2,0fh
mov count,1
endgest:
in al,dx
not al
mov cl,4
shr al,cl
mov button,al
push cs
pop es
mov di,offset infos
mov ah,34
int 47h
mov cl,speed
movsx bx,VY
shl bx,cl
cmp spherey,0
jne nolimity
xor ah,ah
mov al,[di]
cmp byte ptr [di+7],4
jbe text4
shl ax,3
text4:
dec ax
cmp bx,0
jg decy
cmp ry,ax
jae noaddy
jmp nolimity
decy:
cmp ry,0
je noaddy
nolimity:
sub y,bx
noaddy:
movsx bx,VX
shl bx,cl
cmp spherex,0
jne nolimitx
xor ah,ah
mov al,[di+1]
cmp byte ptr [di+7],4
jbe text5
shl ax,3
text5:
dec ax
cmp bx,0
jl decx
cmp rx,ax
jae noaddx
jmp nolimitx
decx:
cmp rx,0
je noaddx
nolimitx:
add x,bx
noaddx:
mov ax,x
mov bx,0FFFFh
xor ch,ch
mov cl,[di+1]
cmp byte ptr [di+7],4
jbe text1
shl cx,3
text1:
mul cx
div bx
mov rx,ax
mov ax,y
xor ch,ch
mov cl,[di]
cmp byte ptr [di+7],4
jbe text2
shl cx,3
text2:
mul cx
div bx
mov ry,ax
xor ch,ch
mov cl,[di+1]
cmp byte ptr [di+7],4
jbe text3
shl cx,3
text3:
mul cx
add ax,rx
cmp byte ptr [di+7],4
mov di,ax
jbe textpoint
mov ax,0A000h
mov es,ax
jmp graphpoint
textpoint:
mov ax,0B800h
mov es,ax
shl di,1
inc di
graphpoint:
mov bx,xy
cmp byte ptr es:[bx],070h
jne waschanged
mov al,old
mov byte ptr es:[bx],al
waschanged:
mov xy,di
mov al,es:[di]
mov old,al
mov byte ptr es:[di],070h
mov al, 20h
out 0a0h, al
out 20h, al
errormouse:
pop es ds bp di si dx cx bx ax
mov cs:isact,0
pop bx
iret
infos db 40 dup (0)
getticks:
mov al,0
out 43h,al
jmp wait1
wait1:
in al,40h
mov ah,al
jmp wait2
wait2:
in al,40h
xchg ah,al
ret
end start

View File

@ -1,52 +1,4 @@
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
@ -97,34 +49,85 @@ PROC biosprint FAR
ret ret
endp biosprint endp biosprint
;PROC flatmode FAR PROC enablea20 FAR
; USES eax,bx,edx USES ax
; ; first, calculate the linear address of GDT mov al,0d1h
; xor edx,edx out 64h,al
; xor eax,eax call a20wait
; mov dx,cs mov al,0dfh
; shl edx,4 out 60h,al
; add [dword ptr cs:offset @@gdt+2],edx ; store as GDT linear base addr call a20wait
; ; now load the GDT into the GDTR ;mov al,0ffh
; lgdt [fword ptr cs:offset @@gdt] ; load GDT base (286-style 24-bit load) ;out 64h,al
; mov bx,1 * size descriptor ; point to first descriptor ;call a20wait
; mov eax,cr0 ; prepare to enter protected mode ret
; or al,1 ; flip the PE bit endp enablea20
; cli ; turn off interrupts
; mov cr0,eax ; we're now in protected mode PROC disablea20 FAR
; mov fs,bx ; load the FS segment register USES ax
; and al,0FEh ; clear the PE bit again mov al,0d1h
; mov cr0,eax ; back to real mode out 64h,al
; sti ; resume handling interrupts call a20wait
; ret ; mov al,0DDh
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 <@@gdtend - @@gdt - 1, @@gdt, 0, 0, 0, 0> ; the GDT itself @@gdt descriptor <offset @@gdtend - offset @@gdt - 1, offset @@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
@ -139,8 +142,6 @@ 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"
@ -148,11 +149,16 @@ 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
@ -174,11 +180,6 @@ PROC mbloadsection FAR
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]
@ -229,7 +230,16 @@ 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 gs,[ss:bp+4] mov ax,[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
@ -244,21 +254,19 @@ 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
@ -276,14 +284,16 @@ 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
clc
pop gs pop gs
clc
ret ret
@@notsogood: @@notsogood:
inc bx inc bx
@ -291,8 +301,8 @@ PROC mbcreate FAR
add bx,[es:mb.sizes] add bx,[es:mb.sizes]
jmp @@searchfree jmp @@searchfree
@@memoryerror: @@memoryerror:
stc
pop gs pop gs
stc
ret ret
@@notenougtmem: @@notenougtmem:
pop gs pop gs
@ -339,6 +349,8 @@ 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
@ -477,7 +489,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 ax,si,ds USES si,ds
push cs push cs
pop ds pop ds
call mbcreate,offset @@data,[@size] call mbcreate,offset @@data,[@size]
@ -532,9 +544,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
@ -639,14 +651,20 @@ 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 projectfile,bx call [cs:projfile],si
jc @@erroronload jc @@erroronload
mov [byte ptr bx],':' mov [byte ptr bx],':'
;pushad
;call biosprint,si
;popad
call mbsearchfunc,si call mbsearchfunc,si
jc @@libnotexist jc @@libnotexist
@@toendoftext: @@toendoftext:
@ -676,18 +694,18 @@ PROC mbloadfuncs FAR
endp mbloadfuncs endp mbloadfuncs
;Recherche une fonction pointé par DS:SI en mémoire et renvoie son adresse en DX:AX ;Recherche une fonction pointé par DS:%0 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]
push bx mov si,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 call mbfind,si
mov [byte ptr bx],':' mov [byte ptr bx],':'
jc @@notfoundattallthesb jc @@notfoundattallthesb
mov es,ax mov es,ax

View File

@ -1,699 +0,0 @@
.model tiny
.486
smart
.code
org 0h
start:
jmp tsr
drv db 'LPT ',0
Tsr:
cli
cmp ax,1234h
jne nomore
mov ax,4321h
jmp itsok
nomore:
push bx ax
mov ah,4
mov bh,1
int 50h
mov bl,al
pop ax
cmp byte ptr cs:isact,1
je nottest
mov cs:isact,1
cmp bl,80h
jae react
mov bl,ah
xor bh,bh
shl bx,1
mov bx,cs:[bx].tables
mov cs:current,bx
pop bx
call cs:current
itsok:
jnc noerror
push bp
mov bp,sp
or byte ptr [bp+6],1b
pop bp
mov ax,cs
shl eax,16
mov ax,cs:current
jmp endofint
noerror:
push bp
mov bp,sp
and byte ptr [bp+6],0FEh
pop bp
endofint:
mov cs:isact,0
sti
iret
nottest:
pop bx
jmp endofint
current dw 0
tables dw getlptin
dw getlptout
dw getlptinout
dw setlptin
dw setlptout
dw setlptinout
dw getlpt
dw getfirstlpt
dw setemettor
dw setreceptor
dw settimeout
dw gettimeout
dw receivelpt
dw sendlpt
dw receivelptblock
dw sendlptblock
dw receivecommand
dw sendcommand
react:
push ds es
mov cs:isact,1
pushad
push cs
pop ds
push cs
pop es
cmp byte ptr never,1
je oknever
mov bl,[drv+3]
sub bl,'0'
xor bh,bh
call getlpt
dec bl
shl bl,1
mov al,7
sub al,bl
mov ah,40
mov di,offset video
int 47h
push ax
mov ah,01h
int 50h
mov ah,21
mov cl,4
int 47h
sti
mov al,0111b
call setlptout
call setreceptor
call initlpt
jc errorie
mov cx,0
mov ah,20
mov bx,1012h
mov si,offset initok
int 47h
cmp byte ptr always,1
je yes
mov ah,20
mov bx,1010h
mov si,offset mdd
int 47h
mov ah,13
mov si,offset drv
int 47h
mov ah,6
int 47h
mov ah,20
mov bx,1011h
mov si,offset msg
int 47h
waitkey:
mov ax,0
int 16h
cmp al,'n'
je no
cmp al,'N'
je no
cmp al,'Y'
je yes
cmp al,'y'
je yes
cmp al,'e'
je nev
cmp al,'E'
je nev
cmp al,'a'
je alw
cmp al,'A'
je alw
jmp waitkey
yes:
call receivecommand
jc errortimeout
no:
mov al,0111b
call setlptout
cli
mov ah,41
mov si,offset video
int 47h
pop ax
mov ah,00h
int 50h
mov ah,09h
int 50h
oknever:
popad
pop es ds
mov cs:isact,0
pop bx
jmp endofint
errorie:
mov si,offset inits
jmp show
errortimeout:
mov si,offset timeouts
show:
mov ah,20
mov bx,1012h
int 47h
mov ax,0
int 16h
jmp no
nev:
mov byte ptr never,1
jmp no
alw:
mov byte ptr always,1
jmp yes
initok db 'Initialisation is realised !',0
inits db 'Error on initialisation',0
timeouts db 'Connection lost or timeout complete !!',0
mdd db 'Connection demand on ',0
msg db 'Accept connection ? (Y)es (N)o n(E)ver (A)lways',0
isact db 0
always db 0
never db 0
;envois une commande al
sendcommand:
push ax bx cx di
mov bl,al
xor bh,bh
shl bx,1
add bx,offset cmde
call cs:[bx]
pop di cx bx ax
ret
cmde dw nothing
dw getram
;recupŠre la ram en ds:si de cx distant caractŠres en es:di local
getram:
push ax bx cx ds
mov bx,offset command
mov cs:[bx+2],ds
mov cs:[bx],si
mov cs:[bx+4],cx
push cs
pop ds
mov si,bx
mov cx,6
call sendlptblock
jc endofget
call receivelptblock
endofget:
pop ds cx bx ax
ret
;Re‡ois une commande et l'execute
Receivecommand:
push ax bx cx di ds es
push cs
pop es
push cs
pop ds
mov di,offset command
call receivelptblock
jc endofno
mov bl,al
xor bh,bh
shl bx,1
add bx,offset cmd
call cs:[bx]
clc
endofno:
pop es ds di cx bx ax
ret
command db 25 dup (0)
cmd dw nothings
dw sendram
dw receiveram
dw sendreg
dw receivereg
dw sendport
dw receiveport
dw letexecute
nothings:
ret
letexecute:
push ds es fs gs
pushad
push cs
push offset suite
mov ax,es:[di+2]
mov ds,ax
mov es,ax
mov fs,ax
mov gs,ax
push ax
mov ax,es:[di]
push ax
DB 0CBh
suite:
popad
pop gs fs es ds
ret
Sendram:
push ax cx si ds
mov si,es:[di]
mov ax,es:[di+2]
mov ds,ax
mov cx,es:[di+4]
call sendlptblock
pop ds si cx ax
ret
receiveram:
sendreg:
receivereg:
sendport:
push ax cx dx si
mov dx,es:[di]
in ax,dx
mov cx,2
mov si,offset tempblock
mov ds:[si],ax
call sendlptblock
pop si dx cx ax
ret
receiveport:
push ax dx
mov dx,es:[di]
mov ax,es:[di+2]
out dx,ax
pop dx ax
ret
tempblock db 25 dup (0)
;---------Segment Adress-----------
Bios equ 040h
;---------Offset Adress------------
Lptadr equ 008h
Timer equ 06Ch
;---------Constant-----------------
onesec equ 18
tensec equ 182
Ack equ 00
Nack equ 0FFh
maxtry equ 10
Initlpt:
push ax ecx
call StartTimer
cmp cs:emettor,0
je receptinit
mov al,10000b
call SetLptOut
waitinit1:
call EndTimer
cmp cx,cs:timeout
ja errorinit
call getlptIn
cmp al,00000b
jnz waitinit1
jmp endinit
receptinit:
call EndTimer
cmp cx,cs:timeout
ja errorinit
call getlptIn
cmp al,00000b
jnz receptinit
mov al,10000b
call SetLptOut
endinit:
clc
pop ecx ax
ret
errorinit:
stc
pop ecx ax
ret
;-Envoie DL (dh) JNE si problŠme JNC error timeout
Sendlpt:
push ax bx ecx
call StartTimer
mov dh,dl
mov al,dl
and al,0Fh
call SetLptOut
waitSend:
call EndTimer
cmp cx,cs:timeout
ja errorsend
call getlptIn
bt ax,4
jnc waitsend
and al,0Fh
mov bl,al
call StartTimer ;/////
mov al,dh
shr al,4
or al,10000b
call SetLptOut
waitSend2:
call EndTimer
cmp cx,cs:timeout
ja errorsend
call getlptIn
bt ax,4
jc waitsend2
and al,0Fh
shl al,4
add bl,al
cmp dl,bl
pop ecx bx ax
clc
ret
errorsend:
pop ecx bx ax
stc
ret
;-Re‡ois DL (dh)
Receivelpt:
push ax bx ecx
call StartTimer
waitreceive:
call EndTimer
cmp cx,cs:timeout
ja errorreceive
call getlptIn
bt ax,4
jnc waitreceive
and al,0Fh
mov dl,al
call SetLptOut
call StartTimer ;/////
waitreceive2:
call EndTimer
cmp cx,cs:timeout
ja errorreceive
call getlptIn
bt ax,4
jc waitreceive2
and al,0Fh
mov dh,al
shl dh,4
add dl,dh
or al,10000b
call SetlptOut
clc
pop ecx bx ax
ret
errorreceive:
stc
pop ecx bx ax
ret
;-AX
SetTimeout:
mov cs:Timeout,dx
ret
timeout dw tensec
getTimeout:
mov dx,cs:Timeout
ret
SetEmettor:
mov cs:Emettor,1
ret
Emettor db 0
SetReceptor:
mov cs:Emettor,0
ret
;->bx Nøport->Adresse dx
GetLpt:
push ax bx ds
mov ax,bios
mov ds,ax
dec bx
shl bx,1
mov dx,ds:[Lptadr+bx]
mov cs:lpt,dx
pop ds bx ax
ret
lpt dw 0
;->bx Nøport->Adresse dx
GetFirstLpt:
push ax ds
mov ax,bios
mov ds,ax
xor bx,bx
findlpt:
mov dx,ds:[Lptadr+bx]
cmp dx,0
jne oklpt
add bx,2
cmp bx,4
jbe findlpt
oklpt:
mov cs:lpt,dx
pop ds ax
ret
;->
StartTimer:
push ax ecx ds
mov ax,Bios
mov ds,ax
mov ecx,ds:[timer]
mov cs:times,ecx
pop ds ecx ax
ret
times dd 0
;->Ecx time elapsed
EndTimer:
push ax ds
mov ax,Bios
mov ds,ax
mov ecx,ds:[timer]
sub ecx,cs:times
pop ds ax
ret
;->
GetLptOut:
push dx
mov dx,cs:lpt
in al,dx
pop dx
ret
GetLptIn:
push dx
mov dx,cs:lpt
inc dx
in al,dx
shr al,3
pop dx
ret
GetLptInOut:
push dx
mov dx,cs:lpt
add dx,2
in al,dx
and al,11111b
pop dx
ret
SetLptOut:
push dx
mov dx,cs:lpt
out dx,al
pop dx
ret
SetLptIn:
push dx
mov dx,cs:lpt
inc dx
out dx,al
pop dx
ret
SetLptInOut:
push dx
mov dx,cs:lpt
add dx,2
out dx,al
pop dx
ret
;Ralise un checksum 8 bits sur donnes DS:SI, nb CX rsultat dans dl
Checksum8:
push cx si
check:
add dl,[si]
inc si
dec cx
jnz check
pop si cx
ret
;DS:SI pointeur sur donnes, CX nombres de donnes, AL token
SendLptBlock:
push ax bx cx edx si edi bp
mov dx,cx
shl edx,16
mov dh,al
call checksum8
mov edi,edx
xor dh,dh
mov bp,dx
mov ah,maxtry
retry:
mov bl,4
xor al,al
header:
mov dx,di
call sendlpt
setne al
jc outt
rol edi,8
dec bl
jnz header
cmp al,0
jne notgood
mov dl,ACK
jmp allsend
notgood:
mov dl,NACK
allsend:
call sendlpt
setne al
jc outt
cmp al,0
je okheader
dec ah
jnz retry
jmp outt
okheader:
cmp cx,0
je endoftrans
mov di,maxtry
retry2:
mov bx,cx
xor ax,ax
body:
mov dl,[si+bx-1]
add ah,dl
call sendlpt
setne al
jc outt
dec bx
jnz body
cmp al,0
jne notgood2
mov dl,ACK
jmp allisend
notgood2:
mov dl,NACK
allisend:
call sendlpt
setne al
jc outt
cmp al,0
je endoftrans
dec di
jnz retry2
outt:
stc
endoftrans:
mov al,ah
xor ah,ah
cmp bp,ax
pop bp edi si edx cx bx ax
ret
;Receptionne en es:di les donnes au nombres de CX token AL (AH) (ECX)
receiveLptBlock:
push bx dx si bp
mov ah,maxtry
retrye:
mov bl,4
headere:
call receivelpt
jc outte
mov cl,dl
rol ecx,8
dec bl
jnz headere
call receivelpt
jc outte
cmp dl,ACK
je okheadere
dec ah
jnz retrye
jmp outte
okheadere:
mov al,ch
xor ch,ch
mov bp,cx
rol ecx,16
cmp cx,0
je endoftranse
mov si,maxtry
retrye2:
mov bx,cx
xor ah,ah
bodye:
call receivelpt
jc outte
mov es:[di+bx-1],dl
add ah,dl
dec bx
jnz bodye
call receivelpt
jc outte
cmp dl,ACK
je endoftranse
dec si
jnz retrye2
outte:
stc
endoftranse:
mov bl,ah
xor bh,bh
cmp bp,bx
pop bp si dx bx
ret
video db 0
end start

View File

@ -1,327 +0,0 @@
.model tiny
.486
smart
.code
org 0h
start:
jmp tsr
drv db 'MOUSE',0
Tsr:
cli
cmp ax,1234h
jne nomore
mov ax,4321h
jmp itsok
nomore:
push bx ax
mov ah,4
mov bh,0
int 50h
mov bl,al
pop ax
cmp byte ptr cs:isact,1
je nottest
mov cs:isact,1
and bl,10000b
cmp bl,16
jae react
mov bl,ah
xor bh,bh
shl bx,1
mov bx,cs:[bx].tables
mov cs:current,bx
pop bx
call cs:current
itsok:
jnc noerror
push bp
mov bp,sp
or byte ptr [bp+6],1b
pop bp
mov ax,cs
shl eax,16
mov ax,cs:current
jmp endofint
noerror:
push bp
mov bp,sp
and byte ptr [bp+6],0FEh
pop bp
endofint:
mov cs:isact,0
sti
iret
nottest:
pop bx
jmp endofint
current dw 0
tables dw cmdmouse
dw cmdmouse2
dw detectmouse
dw getmouse
dw getmousescreen
dw configmouse
isact db 0
;Envoie une commande AL … la souris via controleur clavier
cmdmouse:
push ax
videbuff1:
in al, 64h
and al, 10b
jne videbuff1
mov al, 00d4h
out 64h, al
videbuff2:
in al, 64h
and al, 10b
jne videbuff2
pop ax
out 60h, al
in al, 60h
ret
;Envoie une commande2 AL … la souris via controleur clavier carry=nomouse
cmdmouse2:
push ax
videbuff21:
in al, 64h
and al, 10b
jne videbuff21
mov al, 0060h
out 64h, al
videbuff22:
in al, 64h
and al, 10b
jne videbuff22
pop ax
out 60h, al
in al, 60h
ret
Detectmouse:
push ax cx
mov al, 0a8h ;AUX enable
out 64h, al
mov al, 0f3h ;Set sample
call cmdmouse
mov al, 100 ;Set sample
call cmdmouse
mov al, 0e8h ;Set resolution
call cmdmouse
mov al, 01 ;Set resolution
call cmdmouse
mov al, 0e7h ;Set scale 2:1
call cmdmouse
mov al, 0f4h ;Enable device
call cmdmouse
mov al, 47h ;Interruption ON
call cmdmouse2
mov cx, 1024
testmouse:
in al, 60h ;Lecture du port de donnes
cmp al, 250 ;Test si il y a une souris
je okmouse
dec cx
jnz testmouse
stc
jmp endoftest
okmouse:
clc
endoftest:
pop cx ax
ret
;envoie en bx,cx les coordonnes et en dl les boutons
getmouse:
mov bx,cs:rx
mov cx,cs:ry
mov dl,cs:button
sub dl,8
and dl,0Fh
clc
ret
;envoie en di les coordonnes ecran et en dl les boutons
getmousescreen:
mov di,cs:xy
mov dl,cs:button
sub dl,8
and dl,0Fh
clc
ret
;configure la rapidit dans cl et dans ah,al sphŠre x et y
Configmouse:
mov cs:speed,cl
mov cs:spherex,ah
mov cs:spherey,al
ret
Button db 0
rx dw 0
ry dw 0
VX db 0
VY db 0
X dw 7FFFh
Y dw 7FFFh
speed db 6
spherex db 0
spherey db 0
count db 0
error db 0
xy dw 0
old db 0
;Gestionnaire de souris PS/2
react:
push ax bx cx dx di ds es
push cs
pop ds
in al, 60h
cmp error, 1
je gest1
cmp count, 1
je gest1
cmp count, 2
je gest2
cmp count, 3
je gest3
gest1:
mov count, 2
mov Button, al
and al, 00001000b
cmp al, 8
je gest1end
mov error, 1
jmp gest1end2
gest1end:
mov error, 0
gest1end2:
mov count, 2
jmp endgest
gest2:
mov count, 3
mov VX, al
jmp endgest
gest3:
mov count, 1
mov VY, al
jmp endgest
endgest:
cmp error,1
je errormouse
push cs
pop es
mov di,offset infos
mov ah,34
int 47h
mov cl,speed
movsx bx,VY
shl bx,cl
cmp spherey,0
jne nolimity
xor ah,ah
mov al,[di]
cmp byte ptr [di+7],4
jbe text4
shl ax,3
text4:
dec ax
cmp bx,0
jg decy
cmp ry,ax
jae noaddy
jmp nolimity
decy:
cmp ry,0
je noaddy
nolimity:
sub y,bx
noaddy:
movsx bx,VX
shl bx,cl
cmp spherex,0
jne nolimitx
xor ah,ah
mov al,[di+1]
cmp byte ptr [di+7],4
jbe text5
shl ax,3
text5:
dec ax
cmp bx,0
jl decx
cmp rx,ax
jae noaddx
jmp nolimitx
decx:
cmp rx,0
je noaddx
nolimitx:
add x,bx
noaddx:
mov ax,x
mov bx,0FFFFh
xor ch,ch
mov cl,[di+1]
cmp byte ptr [di+7],4
jbe text1
shl cx,3
text1:
mul cx
div bx
mov rx,ax
mov ax,y
xor ch,ch
mov cl,[di]
cmp byte ptr [di+7],4
jbe text2
shl cx,3
text2:
mul cx
div bx
mov ry,ax
xor ch,ch
mov cl,[di+1]
cmp byte ptr [di+7],4
jbe text3
shl cx,3
text3:
mul cx
add ax,rx
cmp byte ptr [di+7],4
mov di,ax
jbe textpoint
mov ax,0A000h
mov es,ax
jmp graphpoint
textpoint:
mov ax,0B800h
mov es,ax
shl di,1
inc di
graphpoint:
mov bx,xy
cmp byte ptr es:[bx],070h
jne waschanged
mov al,old
mov byte ptr es:[bx],al
waschanged:
mov xy,di
mov al,es:[di]
mov old,al
mov byte ptr es:[di],070h
mov al, 20h
out 0a0h, al
out 20h, al
errormouse:
pop es ds di dx cx bx ax
mov cs:isact,0
pop bx
iret
infos db 40 dup (0)
end start

View File

@ -9,6 +9,9 @@ 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
@ -33,8 +36,6 @@ 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
@ -54,23 +55,26 @@ 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 [setvideomode],2 call [cs:setvideomode],2
jc error jc error
call [clearscreen] call [cs:clearscreen]
call [print],offset msg_memory call [cs:print],offset msg_memory
call [print],offset msg_ok2 call [cs:print],offset msg_ok2
call [print],offset msg_memory_init call [cs:print],offset msg_memory_init
call [print],offset msg_ok2 call [cs:print],offset msg_ok2
call [print],offset msg_memory_section call [cs:print],offset msg_memory_section
call [print],offset msg_ok2 call [cs:print],offset msg_ok2
call [print],offset msg_memory_jumps call [cs:print],offset msg_memory_jumps
call [print],offset msg_ok2 call [cs:print],offset msg_ok2
call [print],offset msg_video_init call [cs:print],offset msg_video_init
call [print],offset msg_ok2 call [cs:print],offset msg_ok2
call [print],offset msg_cpu_detect call [cs:print],offset msg_handler
call [cpuinfo],offset thecpu ;call installirqhandler
call [setinfo],offset thecpu,offset temp call [cs:print],offset msg_ok2
call [print],offset msg_ok2 call [cs:print],offset msg_cpu_detect
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]
@ -81,11 +85,11 @@ suite:
push eax push eax
push offset thecpu.names push offset thecpu.names
push offset thecpu.vendor push offset thecpu.vendor
call [print],offset msg_cpu_detect_inf call [cs:print],offset msg_cpu_detect_inf
call [print],offset msg_pci call [cs:print],offset msg_pci
call [pciinfo],offset thepci call [cs:pciinfo],offset thepci
jc nopci jc nopci
call [print],offset msg_ok2 call [cs:print],offset msg_ok2
xor eax,eax xor eax,eax
mov al,[thepci.maxbus] mov al,[thepci.maxbus]
push eax push eax
@ -93,25 +97,25 @@ suite:
push eax push eax
mov al,[thepci.version_major] mov al,[thepci.version_major]
push eax push eax
call [print],offset msg_pci_info call [cs:print],offset msg_pci_info
call [print],offset msg_pci_enum call [cs:print],offset msg_pci_enum
xor ebx,ebx xor bx,bx
xor ecx,ecx xor cx,cx
xor esi,esi xor si,si
searchpci: searchpci:
call [getcardinfo],bx,cx,si,offset temp call [cs: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 [getpcisubclass] call [cs: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 [getpciclass] call [cs:getpciclass]
push dx push dx
push ax push ax
push 4 push 4
@ -124,7 +128,7 @@ searchpci:
push eax push eax
mov ax,[(pcidata offset temp).vendor] mov ax,[(pcidata offset temp).vendor]
push eax push eax
call [print],offset msg_pci_card call [cs:print],offset msg_pci_card
inc si inc si
cmp si,7 cmp si,7
jbe searchpci jbe searchpci
@ -139,16 +143,28 @@ stopthis:
jbe searchpci jbe searchpci
jmp next jmp next
nopci: nopci:
call [print],offset msg_echec2 call [cs:print],offset msg_echec2
next: next:
call [print],offset msg_fini call [cs:detectvmware]
; call [detectvmware] jne novirtual
; jne novirtual call [cs:print],offset msg_vmware
; call [print],offset msg_vmware novirtual:
;novirtual: call [cs:print],offset msg_flat
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:execfile],offset shell
error2: error2:
call [print],offset msg_error2 call [cs:print],offset msg_error2
call bioswaitkey call bioswaitkey
jmp far 0FFFFh:0000h jmp far 0FFFFh:0000h
@ -157,7 +173,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)
@ -165,56 +181,83 @@ 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 -Nombre de bus : %u\l",0 msg_pci_info db " -Version : %yB.%yB\l -Numero bus max: %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 " | %hW | %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 été detecté !!!\c07",0 msg_vmware db "\c04 VMWare a ete detecte !!!\c07\l",0
msg_fini db "\c04Demarrage terminee : c pas encore fini :(:(:( mais c pour l'inspiration !",0 msg_flat db "Initialisation du Flat Real Mode\l",0
msg_disk_init db "Initialisation du pilote DISQUE\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"
mb1: include "8259a.asm"
includebin "video.sys"
mb2:
includebin "..\lib\video.lib"
mb3:
includebin "..\lib\detect.lib"
mb4:
section: section:
dw offset mb0 dw offset mb0
@ -230,9 +273,25 @@ dw offset mb3-offset mb2
db "VIDEO.LIB",0 db "VIDEO.LIB",0
dw offset mb3 dw offset mb3
dw offset mb4-offset mb dw offset mb4-offset mb3
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:

View File

@ -1,9 +0,0 @@
mcb.sys(49)
video.sys(47)
horloge.sys(8)
8259a.sys(50)
disque.sys(48)
souris.sys(74)
heure.sys(8)
clavier.sys(9)
port.sys(D)

File diff suppressed because it is too large Load Diff

View File

@ -1,53 +1,23 @@
lnk_boot = tlink /x asm= lzasm /z/t
asm= tasm /t/m5/zi lnk= elink
lnk= tlink /x/t
all: detect.com editeur.com gestion.com logo.com pmode.com souris.com test.com verifier.com volume.com memoire.com 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
memoire.com: memoire.asm .asm.obj:
$(asm) memoire $(asm) $<
$(lnk) memoire
detect.com: detect.asm .obj.ce:
$(asm) detect $(lnk) $< $*.ce
$(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 *.com del *.bin
del *.sys del *.sys
del *.err del *.err

View File

@ -1,551 +0,0 @@
.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

View File

@ -1,373 +1,350 @@
.model tiny model tiny,stdcall
.486 p586N
smart locals
.code jumps
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 <,1,0,,,offset imports,,> header exe <"CE",1,0,0,,offset imports,,offset realstart>
realstart: realstart:
mov ax,0305h mov ax,0305h
mov bx,0008h mov bx,0008h
int 16h int 16h
mov ah,28h call [savestate]
int 47h call [setvideomode],2
mov ax,0002 xor ebp,ebp
int 47H xor ax,ax
mov ah,2 mov fs,ax
int 47h call [disablescroll]
xor ebp,ebp adres:
xor ax,ax call [saveparamto],offset infos
mov fs,ax mov al,[infos.lines]
mov ah,43 dec al
int 47h mov [lastline],al
Adres: mov al,[infos.columns]
mov di,offset infos sub al,16
mov ah,34 mov bl,al
int 47h shr al,2
dec byte ptr [di] mov [sizex],al
mov al,[di+1] and bl,11b
sub al,16 mov [sizex2],bl
mov bl,al mov al,[infos.mode]
shr al,2 cmp al,[oldmode]
mov [di+1],al je noinit
and bl,11b call [clearscreen]
mov [di+2],bl mov [oldmode],al
mov al,[di+7] noinit:
cmp al,oldmode call [setxy],0,0
je noinit mov edi,ebp
mov ah,2 mov bh,[lastline]
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,infos+1 mov al,[sizex]
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]
push ' ' call [showchar],' '
call [showchar] inc edi
inc edi dec al
dec al jnz doaline
jnz doaline mov edi,esi
mov edi,esi push offset spaces2
push offset spaces2 call [print]
call [print] mov al,[sizex]
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 byte ptr infos+2,0 cmp [sizex2],0
je lines je lines
mov ah,6 call [addline]
int 47h jmp lines
jmp lines outes:
outes: call [setxy],0,[word ptr lastline]
mov bh,0 call [print],offset menu
mov bl,infos waitkey:
mov ah,25 mov ax,0
int 47h int 16h
push offset menu cmp ax,3B00h
call [print] jne suit
waitkey: inc ebp
mov ax,0 jmp adres
int 16h suit:
cmp ax,3B00h cmp ax,3C00h
jne suit jne suit2
inc ebp dec ebp
jmp adres jmp adres
suit: suit2:
cmp ax,3C00h cmp ax,3D00h
jne suit2 jne suit3
dec ebp add ebp,24*16
jmp adres jmp adres
suit2: suit3:
cmp ax,3D00h cmp ax,3E00h
jne suit3 jne suit4
add ebp,24*16 sub ebp,24*16
jmp adres jmp adres
suit3: suit4:
cmp ax,3E00h cmp ax,3F00h
jne suit4 jne suit5
sub ebp,24*16 add ebp,010000h
jmp adres jmp adres
suit4: suit5:
cmp ax,3F00h cmp ax,4000h
jne suit5 jne suit6
add ebp,010000h sub ebp,010000h
jmp adres jmp adres
suit5: suit6:
cmp ax,4000h cmp ax,4100h
jne suit6 jne suit7
sub ebp,010000h mov [dword ptr pope],'TIDE'
jmp adres call [setxy],0,[word ptr lastline]
suit6: call [print],offset menu
cmp ax,4100h mov ax,0B800h
jne suit7 mov es,ax
mov dword ptr [pope],'TIDE' mov [xxyy2],3
mov bh,0 mov [xxyy],3
mov bl,infos call calc1
mov ah,25 call calc2
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,infos mov al,[lastline]
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
mov bh,0 call [setxy],0,[word ptr lastline]
mov bl,infos call [print],offset msg
mov ah,25 mov ax,0
int 47h int 16h
push offset msg call [setxy],0,[word ptr lastline]
call [print] call [print],offset menu
mov ax,0 pop bx si
int 16h mov [es:bx-1],edi
mov bh,0 mov [es:si-1],dx
mov bl,infos no:
mov ah,25 inc [xx]
int 47h cmp [xx],16
push offset menu jne pasde
call [print] inc [yy]
pop bx si mov [xx],0h
mov es:[bx-1],edi pasde:
mov es:[si-1],dx call calc1
no: call calc2
jmp waitst
inc xx
cmp xx,16
jne pasde
inc yy
mov xx,0h
pasde:
call calc1
call calc2
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 adres
mov ah,29h call [restorestate]
int 47h retf
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 mov dx,[xx]
shl dx,1 shl dx,1
add si,dx add si,dx
add si,129 add si,129
mov byte ptr es:[si],112 mov [byte ptr es:si],112
mov bx,xxyy2 mov bx,[xxyy2]
mov byte ptr es:[bx],07 mov [byte ptr es:bx],07
mov xxyy2,si mov [xxyy2],si
pop dx bx ax pop dx bx ax
ret ret
calc3: calc3:
push dx push dx
xor ebx,ebx xor ebx,ebx
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 ebx,ebp add ebx,ebp
mov edx,ebx mov edx,ebx
shr edx,4*4 shr edx,4*4
shl edx,4*3 shl edx,4*3
mov gs,dx mov gs,dx
pop dx pop dx
ret 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
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 db 40 dup (0) infos vgainf <>
imports: importing
db "VIDEO.LIB::print",0 use VIDEO,setvideomode
print dd 0 use VIDEO,savestate
db "VIDEO.LIB::showhex",0 use VIDEO,restorestate
showhex dd 0 use VIDEO,setxy
db "VIDEO.LIB::showchar",0 use VIDEO,addline
showchar dd 0 use VIDEO,saveparamto
dw 0 use VIDEO,disablescroll
use VIDEO,clearscreen
end start use VIDEO.LIB,print
use VIDEO.LIB,showhex
use VIDEO.LIB,showchar
endi

View File

@ -1,29 +1,26 @@
.model small model tiny,stdcall
.486 p586N
smart 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 <,1,0,,,offset imports,offset exports,> header exe <"CE",1,0,0,,offset imports,,offset realstart>
realstart: realstart:
push offset message call [print],offset message
call [affiche] call [waitkey]
call [waitkey] retf
retf
message db 'Appel de la librairie video !',0 message db 'Appel de la librairie \c02video\c07 et de la librairie \c02EXEM-LIB.LIB\c07 !',0
importing
imports: use VIDEO.LIB,print
db "VIDEO.LIB::print",0 use EXEM-LIB.LIB,waitkey
affiche dd 0 endi
db "EXEM-LIB.LIB::waitkey",0
waitkey dd 0
dw 0
exports:
end start

View File

@ -1,25 +1,24 @@
.model tiny model tiny,stdcall
.486 p586N
smart 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 <,1,0,,,offset imports,offset exports,> header exe <"CE",1,0,0,offset exports,,,>
waitkey:
mov ax,0
int 16h
retf
getvar2: exporting
mov ax,0
int 16h
retf
declare waitkey
imports: ende
exports:
db "waitkey",0
dw getvar2
dw 0
end start

View File

@ -1,94 +1,100 @@
.model tiny model tiny,stdcall
.486 p586N
smart locals
.code jumps
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 <,1,0,,,offset imports,,> header exe <"CE",1,0,0,,offset imports,,offset realstart>
realstart: realstart:
push offset msg1 call [saveparamto],offset infos
call [print] call [print],offset msg1
call [initdrive]
mov ah,3 xor bp,bp
int 48h call [findfirstfile],offset bufferentry
xor bp,bp jc nofiles
mov di,offset bufferentry
mov ah,7
int 48h
jc nofiles
go: go:
push word ptr [di+Entries.FileAttr] push [word bufferentry.result.fileattr]
push dword ptr [di+Entries.FileSize] push [bufferentry.result.filesize]
push word ptr [di+Entries.FileTime] push [bufferentry.result.filetime]
push word ptr [di+Entries.FileDate] push [bufferentry.result.filedate]
push word ptr [di+Entries.FileTimeCrea] push [bufferentry.result.filetimecrea]
push word ptr [di+Entries.FileDateCrea] push [bufferentry.result.filedatecrea]
push di mov bx,offset bufferentry.result.filename
push offset line push bx
call [print] push offset line
inc bp call [print]
mov ah,8
int 48h call [findnextfile],offset bufferentry
jnc go jc nofiles
inc bp
jmp go
nofiles: nofiles:
push offset menu call [print],offset menu
call [print] mov [xx],1
mov xx,1 call changelineattr,[xx],112
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
inc xx call changelineattr,[xx],7
call select inc [xx]
jmp endof call changelineattr,[xx],112
jmp endof
tre1: tre1:
cmp ah,48h cmp ah,48h
jne tre2 jne tre2
cmp xx,1 cmp [xx],1
je endof je endof
dec xx call changelineattr,[xx],7
call select dec [xx]
jmp endof call changelineattr,[xx],112
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
;selectionne la ligne xx ;couleur al pour ligne %0 en %1
Select: PROC changelineattr near
push ax di USES ax,bx,di,es
mov di,xxold ARG @line:word,@attr:word
mov al,7 mov ax,0B800h
add di,3 mov es,ax
mov ah,32 mov ax,[@line]
int 47h add ax,3
mov ax,xx mul [cs:infos.columns]
mov xxold,ax mov di,ax
mov di,xx shl di,1
mov ah,32 mov al,[cs:infos.columns]
mov al,112 inc di
add di,3 mov bx,[@attr]
int 47h @@popep:
pop di ax mov [es:di],bl
ret add di,2
dec al
jnz @@popep
ret
endp changelineattr
xx dw 1 xx dw 1
xxold dw 0 xxold dw 0
@ -96,14 +102,16 @@ 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 db 512 dup (0) bufferentry find <>
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

View File

@ -1,11 +1,20 @@
.model tiny model tiny,stdcall
.486 p586N
smart locals
.code jumps
codeseg
option procalign:byte
org 0100h include "..\include\mem.h"
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
@ -23,17 +32,15 @@ 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

View File

@ -1,100 +1,73 @@
.model tiny model tiny,stdcall
.486 p586N
smart 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 <,1,0,,,offset imports,,> header exe <"CE",1,0,0,,offset imports,,offset realstart>
realstart: realstart:
mov ah,7 call [cs:mballoc],65535
mov cx,65535 jc problem3
int 49h push ax
jc problem3 pop es
push gs call [cs:projfile],offset logo
pop es jc problem
mov ah,7 mov ecx,eax
mov cx,65535 call [cs:mbfind],offset logo
int 49h jc problem
jc problem3 call [cs:decompressrle],ax,0,es,0,cx
mov si,offset logo jc problem2
mov ah,4 push es
xor di,di pop ds
int 48h call [cs:savestate]
jc problem call [cs:setvideomode],word 8
call [cs:clearscreen]
call [cs:loadbmppalet],word 0
push es call [cs:showbmp],word 0,word 20,word 150
pop ds jc problem4
push gs push cs
pop es pop ds
xor si,si call [cs:print],offset poper
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
mov ah,29h call [cs:restorestate]
int 47h retf
retf
problem: problem:
push cs push cs
pop ds pop ds
push offset error call [cs:print],offset error
call [print] jmp endofit
jmp endofit
problem2: problem2:
push cs push cs
pop ds pop ds
push offset error2 call [cs:print],offset error2
call [print] jmp endofit
jmp endofit
problem3: problem3:
push cs push cs
pop ds pop ds
push offset error3 call [cs:print],offset error3
call [print] jmp endofit
jmp endofit
problem4: problem4:
push cs push cs
pop ds pop ds
push offset error4 call [cs:print],offset error4
call [print] jmp endofit
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
@ -103,12 +76,16 @@ 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
imports: importing
db "VIDEO.LIB::print",0 use VIDEO,restorestate
print dd 0 use VIDEO,savestate
db "BMP.LIB::showbmp",0 use VIDEO,setvideomode
showbmp dd 0 use VIDEO,clearscreen
db "BMP.LIB::loadbmppalet",0 use DISQUE,decompressrle
loadbmppalet dd 0 use DISQUE,projfile
dw 0 use SYSTEME,mbfind
end start use SYSTEME,mballoc
use VIDEO.LIB,print
use BMP.LIB,showbmp
use BMP.LIB,loadbmppalet
endi

View File

@ -1,82 +0,0 @@
.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

View File

@ -1,15 +1,22 @@
.model tiny model tiny,stdcall
.486p p586N
smart locals
.code jumps
codeseg
option procalign:byte
include "..\include\mem.h"
include "..\include\divers.h"
org 0h org 0h
start: start:
mov eax,cr0 header exe <"CE",1,0,0,,,,offset realstart>
or al,1
mov cr0,eax realstart:
mov eax,cr0
or al,1
mov cr0,eax
retf
db 0CBh
end start

View File

@ -1,27 +1,32 @@
.model tiny model tiny,stdcall
.486 p586N
smart 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 <,1,0,,,offset imports,,> header exe <"CE",1,0,0,,offset imports,,offset realstart>
realstart: realstart:
mov ah,2 call [mouseon]
int 74h jc errormouse
push offset message call [print],offset message
call [print] retf
retf
message db 'Activation de la souris',0 errormouse:
call [print],offset errormessage
retf
imports: message db 'Activation de la souris\l',0
db "VIDEO.LIB::print",0 errormessage db 'impossible d''activer la souris\l',0
print dd 0
dw 0
end start importing
use VIDEO.LIB,print
use MOUSE.SYS,mouseon
endi

View File

@ -1,160 +1,122 @@
.model tiny model tiny,stdcall
.486 p586N
smart 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 <,1,0,,,offset imports,,> header exe <"CE",1,0,0,,offset imports,,offset realstart>
realstart: realstart:
mov ah,28h call [savestate]
int 47h push 0FFFFh
pushd 652201
push word ptr 0FFFFh pushd 1545454545
push dword ptr 652201 push 1523
push dword ptr 1545454545 push 2041
push word ptr 1523 push offset zero
push word ptr 2041 push offset fixe
push offset zero push 5
push offset fixe push 'i'
push word ptr 5 push 'a'
push word ptr 'i' pushd 5041
push word ptr 'a' pushd 125645
push dword ptr 5041 pushd 5041
push dword ptr 125645 pushd 125645
push dword ptr 5041 pushd 5041
push dword ptr 125645 pushd 125645
push dword ptr 5041 push offset message
push dword ptr 125645 call [print]
push offset message xor ax,ax
call [print] int 16h
mov ax,0 call [clearscreen]
int 16h call [xchgpages]
call [clearscreen]
mov ah,2 mov cx,200
int 47h
mov ah,30
int 47h
mov ah,2
int 47h
mov cx,200
go1: go1:
mov ah,30 call [xchgpages]
int 47h call [waitretrace]
mov ah,33 call [print],offset textdemo1
int 47 call put
push offset textdemo1 call [xchgpages]
call [print] call [waitretrace]
call put dec cx
mov ah,30 jnz go1
int 47h mov cx,200
mov ah,33
int 47h
dec cx
jnz go1
mov cx,200
go2: go2:
mov ah,30 call [xchgpages]
int 47h call [waitretrace]
mov ah,33 call [print],offset textdemo2
int 47h call put
push offset textdemo2 call [xchgpages]
call [print] call [waitretrace]
call put dec cx
mov ah,30 jnz go2
int 47h mov cx,200
mov ah,33
int 47h
dec cx
jnz go2
mov cx,200
go3: go3:
mov ah,30 call [xchgpages]
int 47h call [waitretrace]
mov ah,33 call [print],offset textdemo3
int 47h call put
push offset textdemo3 call [xchgpages]
call [print] call [waitretrace]
call put dec cx
mov ah,30 jnz go3
int 47h call [xchgpages]
mov ah,33 call [clearscreen]
int 47h call [print],offset texte2
dec cx call [xchgpages]
jnz go3 call [clearscreen]
call [xchgpages]
mov ah,30 mov bp,255
int 47h xor edx,edx
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: go4:
mov ah,30 call [xchgpages]
int 47h call [waitretrace]
mov ah,33 inc edx
int 47h push edx
inc edx push offset texte3
push edx call [print]
push offset texte3 call [xchgpages]
call [print] call [waitretrace]
mov ah,30 dec bp
int 47h jnz go4
mov ah,33 push offset texte4
int 47h call [print]
dec bp mov ax,0
jnz go4 int 16h
push offset texte4 call [restorestate]
call [print] retf
mov ax,0
int 16h
mov ah,29h
int 47h
retf
put: put:
call random call random
mov di,dx mov di,dx
and di,4096-2 and di,4096-2
mov si,offset fond mov si,offset fond
call showstring2 call showstring2
ret ret
random:
Random: push ax
push ax MOV AX,[cs:randseed]
MOV AX,cs:[RandSeed] MOV DX,8405h
MOV DX,8405h MUL DX
MUL DX INC AX
INC AX MOV [cs:randseed],AX
MOV cs:[RandSeed],AX pop ax
pop ax ret
ret
randseed dw 1234h randseed dw 1234h
Randomize: Randomize:
push ax cx dx push ax cx dx
mov ah,0 mov ah,0
int 1ah int 1ah
mov cs:randseed,dx mov [cs:randseed],dx
pop dx cx ax pop dx cx ax
ret ret
zero db 'Chaine a zro terminal',0 zero db 'Chaine a zro terminal',0
fixe db 20,'Chaine a taille fixe' fixe db 20,'Chaine a taille fixe'
@ -179,25 +141,29 @@ 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
end start importing
use VIDEO.LIB,print
use VIDEO,xchgpages
use VIDEO,setvideomode
use VIDEO,clearscreen
use VIDEO,savestate
use VIDEO,restorestate
use VIDEO,waitretrace
endi

View File

@ -1,80 +1,73 @@
.model tiny model tiny,stdcall
.386c p586N
.code locals
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 <,1,0,,,offset imports,,> header exe <"CE",1,0,0,,offset imports,,offset realstart>
realstart: realstart:
mov ah,28h call [savestate]
int 47h call [print],offset msg
push offset msg mov bp,1000h
call [print] xor di,di
mov bp,1000h xor cx,cx
xor di,di xor edx,edx
xor cx,cx verifall:
xor edx,edx mov ah,1
VerifAll: int 16h
mov ah,1 jz nokey
int 16h cmp al,' '
jz nokey je enend
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
push offset msg2 call [print],offset msg2
call [print] call gauge
call gauge call [verifysector],cx
mov ah,2 jc errors
int 48h je noprob
jc errors inc di
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
push offset error2 call [print],offset error2
call [print] jmp someof
jmp someof
noatall: noatall:
push offset noerror call [print],offset noerror
call [print]
someof: someof:
mov ah,0 mov ah,0
int 16h int 16h
mov ah,29h call [restorestate]
int 47H retf
retf
errors: errors:
push offset error call [print],offset error
call [print] mov ah,0
mov ah,0 int 16h
int 16h call [restorestate]
mov ah,29h retf
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
@ -83,31 +76,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
imports: importing
db "VIDEO.LIB::print",0 use VIDEO.LIB,print
print dd 0 use VIDEO,savestate
dw 0 use VIDEO,restorestate
use DISQUE,verifysector
End Start endi

View File

@ -1,121 +1,98 @@
.model tiny model tiny,stdcall
.486 p586N
smart locals
.code jumps
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 <,1,0,,,offset imports,,> header exe <"CE",1,0,0,,offset imports,,offset realstart>
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
mov ah,28h adres2:
int 47H call [saveparamto],offset infos
mov ax,0002 mov al,[infos.lines]
int 47H dec al
mov ah,2 mov [lastline],al
int 47h mov al,[infos.columns]
mov ah,43 sub al,16
int 47h mov bl,al
xor bp,bp shr al,2
push cs mov [sizex],al
push cs and bl,11b
pop es mov [sizex2],bl
pop ds mov al,[infos.mode]
Adres: cmp al,[oldmode]
mov di,offset infos je noinit
mov ah,34 call [clearscreen]
int 47h mov [oldmode],al
dec infos noinit:
push cs call [setxy],0,0
pop es mov edi,ebp
mov cx,sect mov bh,[lastline]
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 dx,sect mov edx,edi
push edx mov dx,[sect]
push offset spaces push edx
call [print] push offset spaces
mov al,infos+1 call [print]
mov si,di mov dx,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]
push ' ' call [showchar],' '
call [showchar] inc edi
inc di dec al
dec al jnz doaline
jnz doaline mov edi,esi
mov di,si push offset spaces2
push offset spaces2 call [print]
call [print] mov al,[sizex]
mov al,infos+1
doaline2: doaline2:
push word ptr [di+offset buffer] push [word ptr di+offset buffer]
call [showchar] call [showchar]
inc di inc edi
dec al dec al
jnz doaline2 jnz doaline2
dec bh dec bh
je outes je outes
cmp byte ptr infos+2,0 cmp [sizex2],0
je lines je lines
mov ah,6 call [addline]
int 47h jmp lines
jmp lines outes:
outes: call [setxy],0,[word ptr lastline]
mov bh,0 call [print],offset menu
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
@ -135,16 +112,16 @@ outes:
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
@ -153,165 +130,151 @@ outes:
suit5: suit5:
cmp ax,4000h cmp ax,4000h
jne suit6 jne suit6
mov cx,sect call [writesector],[sect],offset buffer
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'
mov bh,0 call [setxy],0,[word ptr lastline]
mov bl,infos call [print],offset menu
mov ah,25 mov ax,0B800h
int 47h mov es,ax
push offset menu mov [xxyy2],3
call [print] mov [xxyy],3
mov ax,0B800h call calc1
mov es,ax call calc2
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],'WEIV' mov [dword ptr pope],' EUV'
push cs push cs
pop ds pop es
mov cx,sect call [writesector],[sect],offset buffer
mov si,offset buffer jnc waitkey
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,infos mov al,[lastline]
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 byte ptr es:[bx],0112 mov edi,[es:bx-1]
mov es:[bx-1],al mov dx,[es:si-1]
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 adres2 jne adres
mov ah,29h call [restorestate]
int 47H retf
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
add si,2 mov dx,[xx]
mov dx,xx shl dx,1
shl dx,1 add si,dx
add si,dx add si,129
add si,127 mov [byte ptr es:si],112
mov byte ptr es:[si],112 mov bx,[xxyy2]
mov bx,xxyy2 mov [byte ptr es:bx],07
mov byte ptr es:[bx],07 mov [xxyy2],si
mov xxyy2,si pop dx bx ax
pop dx bx ax ret
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
@ -319,35 +282,39 @@ 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
@ -355,21 +322,25 @@ 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 db 40 dup (0) sect dw 0
buffer db 2048 dup (0) infos vgainf <>
imports: importing
db "VIDEO.LIB::print",0 use DISQUE,readsector
print dd 0 use DISQUE,writesector
db "VIDEO.LIB::showhex",0 use VIDEO,setvideomode
showhex dd 0 use VIDEO,savestate
db "VIDEO.LIB::showchar",0 use VIDEO,restorestate
showchar dd 0 use VIDEO,setxy
dw 0 use VIDEO,addline
use VIDEO,saveparamto
use VIDEO,disablescroll
end start use VIDEO,clearscreen
use VIDEO.LIB,print
use VIDEO.LIB,showhex
use VIDEO.LIB,showchar
endi