Compare commits

...

121 Commits

Author SHA1 Message Date
Nicolas Hordé b8248c75a2 feat: ajout du logiciel test2d.ce qui permet de vérifier le bon fonctionnement des fonctions graphiques 2D 2007-04-18 07:44:43 +00:00
Nicolas Hordé eb533335e6 feat: utilisation de la librarie math.lib pour l'usage des fonctions Randomize et random. 2007-04-18 07:43:47 +00:00
Nicolas Hordé d1320a4772 feat: ajout de la librairie math.lib qui contiendra les fonctionnalités mathématiques de base 2007-04-18 07:43:02 +00:00
Nicolas Hordé cb57000850 fix: correction de divers bogues d'affichage 2007-04-11 19:22:29 +00:00
Nicolas Hordé fbaa6d5c24 feat: fichier au format 3ds (3Dstudio max) utilisé par le logiciel CE "test3d" 2007-04-11 19:08:02 +00:00
Nicolas Hordé ad60791663 feat: logiciel démontrant les possibilités de la librairie 3D.lib 2007-04-11 19:07:29 +00:00
Nicolas Hordé 04437364c4 fix: correction d'un bogue dans la fonction "detect" Suppression de l'appel en "enablea20","flatmode" et "detectvmware" suspecté de causer des plantages sur de vrais PC (pas emulé) 2007-04-11 19:06:02 +00:00
Nicolas Hordé 101a2f1b11 feat: implémentation de la gestion des tampons Ajout des fonctions "setbuffer" et "getbuffer" Modification de la fonction "readsector" pour quelle utilise les tampons 2007-04-11 19:03:37 +00:00
Nicolas Hordé aad0a86377 fix: correction d'un bogue dans la fonction "mbloadfuncs" qui pouvait intervenir lors d'un chargement non fructueux 2007-04-11 16:05:35 +00:00
Nicolas Hordé 0c56fda060 feat: passage en minuscule de la fonction "polyfill". 2007-04-11 16:03:51 +00:00
Nicolas Hordé 600fe4e7d2 feat: ajout de l'exportation de la fonction "load3ds" dorénavant fonctionnelle Modification des fonctions 3D pour éviter l'ambiguïté entre les variables @nbfaces et @type. 2007-04-11 16:03:16 +00:00
Nicolas Hordé 5e55bdcba3 feat: ajout de la structure "diskbuffer" qui permet l'usage de tampons lors des accès disquette 2007-04-11 16:00:32 +00:00
Nicolas Hordé 9234f6a2bf fix: ajout des commandes SETBUFFER et GETBUFFER Correction d'un bogue dans la commande DETECT Ajout du précorrectione 0x pour les nombre en base 16 dans la commande MEM 2007-04-11 15:59:34 +00:00
Nicolas Hordé 40095b4a40 docs: ajout de copie d'écran de la version 1.3.2fr 2007-03-31 19:48:39 +00:00
Nicolas Hordé 17ca3e1b4a build: ajout de la compilation de "test3d.ce" 2007-03-31 19:26:38 +00:00
Nicolas Hordé 74b27cd1c1 feat: librairie permettant l'affichage de figures bidimensionnelles 2007-03-31 19:25:56 +00:00
Nicolas Hordé d938d8f7f6 feat: libraire permettant l'affichage de figures tridimensionnelles 2007-03-31 19:25:21 +00:00
Nicolas Hordé 7176b83cf2 build: ajout de le compilation de "graphic.asm" et de "3d.asm" 2007-03-31 19:24:17 +00:00
Nicolas Hordé 0b90fadbdc feat: mise a jour du numéro de version 2007-03-31 19:23:20 +00:00
Nicolas Hordé a723b22728 feat: mise a jour du numéro de version 2007-03-31 19:22:04 +00:00
Nicolas Hordé 8b89273f46 feat: ajout des structures "vertex3d" et "mat" nécessaire a la 3D 2007-03-31 19:21:23 +00:00
Nicolas Hordé a7ef3ac243 feat: ajout de la structure vertex 2D 2007-03-31 19:20:19 +00:00
Nicolas Hordé 9fe93fcf95 feat: mise a jour de la structure de contexte pour la gestion de la FPU 2007-03-31 19:19:50 +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
63 changed files with 9170 additions and 5444 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

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
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
endofimport dd 0
realstart:
push msg
call far [cs:print] ;Afficher le texte (Showstring0)
xor ax,ax xor ax,ax
int 0x16 ;Attendre l'appuie sur une touche int 0x16 ;Attendre l'appuie sur une touche
retf ;retour far retf ;retour far
msg db 'Hello World',0 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.

32
include/3d.h Normal file
View File

@ -0,0 +1,32 @@
struc vertex3d
tx dd ?
ty dd ?
tz dd ?
ends vertex3d
struc mat
p1 dd ?
p2 dd ?
p3 dd ?
p4 dd ?
p5 dd ?
p6 dd ?
p7 dd ?
p8 dd ?
p9 dd ?
p10 dd ?
p11 dd ?
p12 dd ?
p13 dd ?
p14 dd ?
p15 dd ?
p16 dd ?
ends mat
main equ 4D4Dh
edit equ 3D3Dh
object equ 4000h
mesh equ 4100h
vertex equ 4110h
face equ 4120h
locale equ 4160h

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

@ -1,3 +1,9 @@
struc diskbuffer
size dw 12
current dw 0FFFFh
chain dw 128 dup (0FFFFh)
ends diskbuffer
struc dpt struc dpt
steprate&headunload db 0DFh ;Vitesse de progression & monte de la tˆte steprate&headunload db 0DFh ;Vitesse de progression & monte de la tˆte
dmaflag&headload db 002h ;Etat Dma et temps de descente de la tˆte dmaflag&headload db 002h ;Etat Dma et temps de descente de la tˆte
@ -28,6 +34,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,31 @@ struc point
coordx db 0 coordx db 0
coordy db 0 coordy db 0
ends point ends point
struc vgainf
lines db 0
columns db 0
x db 0
y db 0
xy dw 0
colors db 7
mode db 0FFh
pagesize dw 0
style db 0
font db 0
graphic db 0
nbpage db 0
color db 0
cursor db 0
segments dw 0
linesize dw 0
adress dw 0
base dw 0
scrolling db 1
ends vgainf
struc vertex2d
px dw ?
py dw ?
ends vertex2d

View File

@ -1,3 +1,58 @@
struc regs
seip dd 0
seax dd 0
sebx dd 0
secx dd 0
sedx dd 0
sesi dd 0
sedi dd 0
sebp dd 0
sesp dd 0
scs dw 0
sds dw 0
ses dw 0
sfs dw 0
sgs dw 0
sss dw 0
seflags dd 0
;sst0 dt 0
;sst1 dt 0
;sst2 dt 0
;sst3 dt 0
;sst4 dt 0
;sst5 dt 0
;sst6 dt 0
;sst7 dt 0
ends regs
struc tuple ;vecteur d'interruption
off dw 0 ;adresse
seg dw 0 ;segment
ends tuple
union vector
data tuple <>
content dd 0
ends
struc ints ;bloc interruption
number db 0 ;numero de l'interruption
activated db 0 ;activé ou non
locked db 0 ;verrouillée
launchedlow dd 0
launchedhigh dd 0
calledlow dd 0
calledhigh dd 0
vector1 vector ?
vector2 vector ?
vector3 vector ?
vector4 vector ?
vector5 vector ?
vector6 vector ?
vector7 vector ?
vector8 vector ?
ends ints
struc mb ;Bloc de mémoire struc mb ;Bloc de mémoire
check db "NH" ;signature du bloc de mémoire check db "NH" ;signature du bloc de mémoire
isnotlast db 0 ;flag indiquant le dernier bloc isnotlast db 0 ;flag indiquant le dernier bloc
@ -29,4 +84,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.4Fr programme d''installation',0Dh,0AH,'Inserez une disquette formatee et appuyez sur entre...',0Dh,0AH,'Attention le contenu de celle ci peut etre altere !!!',0Dh,0AH,'$'
message2 db 0Dh,0AH,'Creation du secteur de demarrage...',0Dh,0Ah,'$' message2 db 0Dh,0AH,'Creation du secteur de demarrage...',0Dh,0Ah,'$'
message3 db 0Dh,0AH,'Copie des fichiers systeme...',0Dh,0Ah,'$' message3 db 0Dh,0AH,'Copie des fichiers systeme...',0Dh,0Ah,'$'
errormsg db 0Dh,0AH,'Erreur d''installation, contactez moi a COS2000@MULTIMANIA.COM !',0Dh,0AH,'$' errormsg db 0Dh,0AH,'Erreur d''installation, contactez moi a COS2000@MULTIMANIA.COM !',0Dh,0AH,'$'

1222
lib/3d.asm Normal file

File diff suppressed because it is too large Load Diff

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 graphic.lib 3d.lib math.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: exporting
db "showbmp",0 declare showbmp
dw showbmp declare loadbmppalet
db "loadbmppalet",0 ende
dw loadbmppalet
dw 0
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

230
lib/graphic.asm Normal file
View File

@ -0,0 +1,230 @@
model tiny,stdcall
p586
locals
jumps
codeseg
option procalign:byte
include "..\include\mem.h"
include "..\include\graphic.h"
org 0h
header exe <"CE",1,0,0,offset exports,offset imports,,>
exporting
declare hline
declare line
declare polyfill
ende
importing
use VIDEO,showpixel
endi
PROC hline FAR
ARG @x1:word,@x2:word,@y:word,@color:word
USES cx,dx
mov cx,[@x1]
mov dx,[@x2]
cmp cx,dx
jbe @@boucle
xchg cx,dx
@@boucle:
call [cs:showpixel],cx,[@y],[@color]
inc cx
cmp cx,dx
jbe @@boucle
ret
endp hline
; affiche un pixel en %0 %1 couleur %2
PROC line FAR
ARG @x1:word,@y1:word,@x2:word,@y2:word,@color:word
USES ax,bx,cx,dx,si,di
LOCAL @@deltax:word,@@deltay:word
mov ax,[@x2]
sub ax,[@x1]
call absolute
mov [@@deltax],ax
mov cx,ax
mov ax,[@y2]
sub ax,[@y1]
call absolute
mov dx,ax
mov [@@deltay],ax
mov ax,-1
mov bx,-1
mov si,[@x1]
mov di,[@y1]
cmp si,[@x2]
jg @@x1greater
mov ax,1
@@x1greater:
cmp di,[@y2]
jg @@y1greater
mov bx,1
@@y1greater:
cmp cx,dx
jl @@deltaxgreater
mov dx,[@@deltax]
sar dx,1
xor cx,cx
@@boucle1:
add si,ax
add dx,[@@deltay]
cmp dx,[@@deltax]
jl @@above1
sub dx,[@@deltax]
add di,bx
@@above1:
call [cs:showpixel],si,di,[@color]
inc cx
cmp cx,[@@deltax]
jl @@boucle1
jmp @@endofline
@@deltaxgreater:
mov dx,[@@deltay]
sar dx,1
xor cx,cx
@@boucle2:
add di,bx
add dx,[@@deltax]
cmp dx,[@@deltay]
jle @@above2
sub dx,[@@deltay]
add si,ax
@@above2:
call [cs:showpixel],si,di,[@color]
inc cx
cmp cx,[@@deltay]
jl @@boucle2
@@endofline:
ret
endp line
;renvoie la valeur absolue de AX
PROC absolute NEAR
cmp ax,0
jg @@noabs
neg ax
@@noabs:
ret
endp absolute
ymax equ 200
; initialise un segment 2
PROC polyfill FAR
ARG @pointer:word,@nbfaces:word,@color:word;
LOCAL @@startx:word:200,@@endx:word:200,@@pas:dword,@@miny:word,@@maxy:word
USES eax,ebx,ecx,edx,si,di,es
mov di,bp
sub di,2
mov ax,16000
mov cx,(200+200)*2
push ss
pop es
std
rep stosw
mov si,[@pointer]
mov di,[@pointer]
add di,size vertex2d
mov [@@miny],ymax
mov [@@maxy],0
mov cx,[@nbfaces]
dec cx
@@boucle:
push si di cx
mov ax,[(vertex2d di).py]
cmp ax,[(vertex2d si).py]
je @@noexchange
jge @@nothingtodo
xchg si,di
@@nothingtodo:
xor eax,eax
mov ax,[(vertex2d si).px]
cwde
sal eax,8
mov ebx,eax
xor eax,eax
mov ax,[(vertex2d di).px]
sub ax,[(vertex2d si).px]
cwde
sal eax,8
xor ecx,ecx
mov cx,[(vertex2d di).py]
sub cx,[(vertex2d si).py]
cdq
idiv ecx
mov [@@pas],eax
add ebx,eax
mov dx,[(vertex2d si).py]
inc dx
cmp dx,[@@miny]
jge @@notinf
mov [@@miny],dx
@@notinf:
mov ax,[(vertex2d di).py]
cmp ax,[@@maxy]
jle @@boucle2
mov [@@maxy],ax
@@boucle2:
cmp dx,0
jl @@notgood
cmp dx,ymax
jge @@notgood
mov si,dx
shl si,1
neg si
cmp [word ptr bp+si-2],16000
jne @@notgoodforinf
mov eax,ebx
sar eax,8
mov [bp+si-2],ax
@@notgoodforinf:
mov eax,ebx
sar eax,8
mov [bp+si-200*2-2],ax
@@notgood:
add ebx,[@@pas]
inc dx
cmp dx,[(vertex2d di).py]
jle @@boucle2
@@noexchange:
pop cx di si
add si,size vertex2d
add di,size vertex2d
dec cx
js @@finished
jnz @@boucle
mov di,[@pointer]
mov cx,0FFFFh
jmp @@boucle
@@finished:
cmp [word ptr @@miny],0
jae @@noadj
mov [@@miny],0
@@noadj:
cmp [word ptr @@maxy],ymax
jb @@noadj2
mov [@@maxy],ymax-1
@@noadj2:
mov cx,[@@miny]
@@drawboucle:
mov si,cx
shl si,1
neg si
mov ax,[bp+si-2]
mov bx,[bp+si-200*2-2]
cmp bx,16000
jnz @@noinfatall
mov ax,bx
@@noinfatall:
call hline,ax,bx,cx,[@color]
inc cx
cmp cx,[@@maxy]
jna @@drawboucle
ret
endp polyfill

38
lib/math.asm Normal file
View File

@ -0,0 +1,38 @@
model tiny,stdcall
p586
locals
jumps
codeseg
option procalign:byte
include "..\include\mem.h"
org 0h
header exe <"CE",1,0,0,offset exports,,,>
exporting
declare random
declare randomize
ende
randseed dw 1234h
PROC random FAR
USES dx
mov ax,[cs:randseed]
mov dx,8405h
mul dx
inc ax
mov [cs:randseed],ax
mov ax,dx
ret
endp random
PROC randomize FAR
USES ax,cx,dx
mov ah,0
int 1ah
mov [cs:randseed],dx
ret
endp randomize

993
lib/str0.asm 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

@ -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
@ -140,3 +140,276 @@ PROC readirr FAR
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

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,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
; mov fs,bx ; load the FS segment register
; and al,0FEh ; clear the PE bit again
; mov cr0,eax ; back to real mode
; sti ; resume handling interrupts
; ret ;
;@@gdt descriptor <@@gdtend - @@gdt - 1, @@gdt, 0, 0, 0, 0> ; the GDT itself PROC disablea20 FAR
; descriptor <0ffffh, 0, 0, 091h, 0cfh, 0> ; 4G data segment USES ax
;@@gdtend: mov al,0d1h
;endp flatmode out 64h,al
call a20wait
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 <offset @@gdtend - offset @@gdt - 1, offset @@gdt, 0, 0, 0, 0> ; the GDT itself
descriptor <0ffffh, 0, 0, 091h, 0cfh, 0> ; 4G data segment
@@gdtend:
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
@ -250,15 +260,13 @@ PROC mbcreate FAR
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
mov [byte ptr bx],':' mov [byte ptr bx],':'
jc @@erroronload
;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

@ -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 ebx,ebx
xor ecx,ecx xor ecx,ecx
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,29 @@ 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 [print],offset msg_vmware ;call [cs: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:print],offset msg_launchcommand
call [cs:execfile],offset shell
jc error2
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 +174,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,17 +182,20 @@ 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 " | 0x%hW | 0x%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_launchcommand db "Execution du SHELL\l",0
msg_error db " [Erreur]",0dh,0ah,"<Pressez une touche pour redemarrer le systeme>",0 msg_error db " [Erreur]",0dh,0ah,"<Pressez une touche pour redemarrer le systeme>",0
msg_ok db " [ Ok ]",0dh,0ah,0 msg_ok db " [ Ok ]",0dh,0ah,0
@ -183,38 +203,62 @@ msg_error2 db "\h70 [\c04Erreur\c07]\g00,49<Pressez une touche pour rede
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
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: 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
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 +274,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:

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 766 B

BIN
outils/CE explorer/imgs.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

View File

@ -0,0 +1,139 @@
<?xml version='1.0' encoding='utf-8' ?>
<!-- C++Builder XML Project -->
<PROJECT>
<MACROS>
<VERSION value="BCB.06.00"/>
<PROJECT value="Project1.exe"/>
<OBJFILES value="Project1.obj Unit1.obj"/>
<RESFILES value="Project1.res"/>
<IDLFILES value=""/>
<IDLGENFILES value=""/>
<DEFFILE value=""/>
<RESDEPEN value="$(RESFILES) Unit1.dfm"/>
<LIBFILES value=""/>
<LIBRARIES value="rtl.lib vcl.lib"/>
<SPARELIBS value="vcl.lib rtl.lib"/>
<PACKAGES value="vcl.bpi rtl.bpi dbrtl.bpi adortl.bpi vcldb.bpi vclx.bpi bdertl.bpi
ibxpress.bpi dsnap.bpi cds.bpi bdecds.bpi qrpt.bpi teeui.bpi teedb.bpi
tee.bpi vcldbx.bpi dss.bpi teeqr.bpi visualclx.bpi visualdbclx.bpi
dsnapcrba.bpi dsnapcon.bpi bcbsmp.bpi vclie.bpi xmlrtl.bpi inet.bpi
inetdbbde.bpi inetdbxpress.bpi inetdb.bpi nmfast.bpi webdsnap.bpi
bcbie.bpi websnap.bpi soaprtl.bpi dclocx.bpi dbexpress.bpi dbxcds.bpi
indy.bpi bcb2kaxserver.bpi OpenGLPanel_DP.bpi IcsBcb60.bpi ZComponent.bpi
ZPlain.bpi ZCore.bpi ZDbc.bpi ZParseSql.bpi"/>
<PATHCPP value=".;"/>
<PATHPAS value=".;"/>
<PATHRC value=".;"/>
<PATHASM value=".;"/>
<DEBUGLIBPATH value="$(BCB)\lib\debug"/>
<RELEASELIBPATH value="$(BCB)\lib\release"/>
<LINKER value="ilink32"/>
<USERDEFINES value=""/>
<SYSDEFINES value="_RTLDLL;NO_STRICT"/>
<MAINSOURCE value="Project1.cpp"/>
<INCLUDEPATH value="D:\CBuilder6\Bin;&quot;C:\Documents and Settings\admin\Bureau\perso\cos\CE explorer&quot;;$(BCB)\include;$(BCB)\include\vcl"/>
<LIBPATH value="D:\CBuilder6\Bin;&quot;C:\Documents and Settings\admin\Bureau\perso\cos\CE explorer&quot;;$(BCB)\Projects\Lib;$(BCB)\lib\obj;$(BCB)\lib"/>
<WARNINGS value="-w-par"/>
<OTHERFILES value=""/>
</MACROS>
<OPTIONS>
<IDLCFLAGS value="-ID:\CBuilder6\Bin
-I&quot;C:\Documents and Settings\admin\Bureau\perso\cos\CE explorer&quot;
-I$(BCB)\include -I$(BCB)\include\vcl -src_suffix cpp -boa"/>
<CFLAG1 value="-O2 -H=$(BCB)\lib\vcl60.csm -Hc -Vx -Ve -X- -a8 -b- -k- -vi -c -tW -tWM"/>
<PFLAGS value="-$Y- -$L- -$D- -$A8 -v -JPHNE -M"/>
<RFLAGS value=""/>
<AFLAGS value="/mx /w2 /zn"/>
<LFLAGS value="-D&quot;&quot; -aa -Tpe -x -Gn"/>
<OTHERFILES value=""/>
</OPTIONS>
<LINKER>
<ALLOBJ value="c0w32.obj Memmgr.Lib sysinit.obj $(OBJFILES)"/>
<ALLRES value="$(RESFILES)"/>
<ALLLIB value="$(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib"/>
<OTHERFILES value=""/>
</LINKER>
<FILELIST>
<FILE FILENAME="Project1.res" FORMNAME="" UNITNAME="Project1.res" CONTAINERID="ResTool" DESIGNCLASS="" LOCALCOMMAND=""/>
<FILE FILENAME="Project1.cpp" FORMNAME="" UNITNAME="Project1" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>
<FILE FILENAME="Unit1.cpp" FORMNAME="Form1" UNITNAME="Unit1" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>
</FILELIST>
<BUILDTOOLS>
</BUILDTOOLS>
<IDEOPTIONS>
[Version Info]
IncludeVerInfo=1
AutoIncBuild=1
MajorVer=1
MinorVer=0
Release=0
Build=0
Debug=0
PreRelease=0
Special=0
Private=0
DLL=0
Locale=1036
CodePage=1252
[Version Info Keys]
CompanyName=COS2000
FileDescription=Cos2000 lib explorer
FileVersion=1.0.0.0
InternalName=
LegalCopyright=
LegalTrademarks=
OriginalFilename=
ProductName=Cos2000 lib explorer
ProductVersion=1.0.0.0
Comments=FOR CE ONLY
[Excluded Packages]
..\lib\DragDrop_B5.bpl=(untitled)
..\lib\Moje_B5.bpl=(untitled)
..\lib\DriveDir_B5.bpl=(untitled)
..\lib\tb2k_cb6.bpl=(untitled)
..\lib\tb2kdsgn_cb6.bpl=(untitled)
..\lib\tbx_cb6.bpl=(untitled)
..\lib\tbxdsgn_cb6.bpl=(untitled)
d:\cbuilder6\Bin\dclite60.bpl=Borland Integrated Translation Environment
[HistoryLists\hlIncludePath]
Count=1
Item0=D:\CBuilder6\Bin;C:\Documents and Settings\admin\Bureau\perso\cos\CE explorer;$(BCB)\include;$(BCB)\include\vcl
[HistoryLists\hlLibraryPath]
Count=1
Item0=D:\CBuilder6\Bin;C:\Documents and Settings\admin\Bureau\perso\cos\CE explorer;$(BCB)\Projects\Lib;$(BCB)\lib\obj;$(BCB)\lib
[HistoryLists\hlDebugSourcePath]
Count=1
Item0=$(BCB)\source\vcl
[Debugging]
DebugSourceDirs=$(BCB)\source\vcl
[Parameters]
RunParams=
Launcher=
UseLauncher=0
DebugCWD=
HostApplication=
RemoteHost=
RemotePath=
RemoteLauncher=
RemoteCWD=
RemoteDebug=0
[Compiler]
ShowInfoMsgs=0
LinkDebugVcl=0
LinkCGLIB=0
[CORBA]
AddServerUnit=1
AddClientUnit=1
PrecompiledHeaders=1
</IDEOPTIONS>
</PROJECT>

View File

@ -0,0 +1,34 @@
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
//---------------------------------------------------------------------------
USEFORM("Unit1.cpp", Form1);
//---------------------------------------------------------------------------
WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
{
try
{
Application->Initialize();
Application->Title = "CE explorer";
Application->CreateForm(__classid(TForm1), &Form1);
Application->Run();
}
catch (Exception &exception)
{
Application->ShowException(&exception);
}
catch (...)
{
try
{
throw Exception("");
}
catch (Exception &exception)
{
Application->ShowException(&exception);
}
}
return 0;
}
//---------------------------------------------------------------------------

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,273 @@
//---------------------------------------------------------------------------
#include <vcl.h>
#include <math.h>
#include <stdio.h>
#pragma hdrstop
#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
tree(AnsiString file,int offset,TTreeNode* rootnode)
{
FILE* in;
#pragma option -a1
struct CE {
char checks[2];
unsigned char major;
unsigned int checksum;
unsigned char compressed;
unsigned short exports;
unsigned short imports;
unsigned short sections;
unsigned short starting;
} myce;
#pragma option -a
long pointeur=0;
if ((in = fopen(file.c_str(), "rb"))!= NULL)
{
fseek(in, pointeur+offset, SEEK_SET);
fread(&myce, sizeof(myce), 1, in);
TTreeNode* currentnode;
TTreeNode* subcurrentnode;
TTreeNode* subsubcurrentnode;
if (offset==0)
{
fseek(in, 0L, SEEK_END);
Form1->TreeView->Items->AddChild(rootnode,"Adresse réelle: 0x0000")->ImageIndex=31;
Form1->TreeView->Items->AddChild(rootnode,"Adresse : 0x0000")->ImageIndex=31;
}
currentnode=Form1->TreeView->Items->AddChild(rootnode,"Entête");
currentnode->ImageIndex=10;
Form1->TreeView->Items->AddChild(currentnode,"Adresse réelle: 0x"+IntToHex((int)pointeur+offset,4))->ImageIndex=31;
Form1->TreeView->Items->AddChild(currentnode,"Adresse : 0x"+IntToHex((int)pointeur,4))->ImageIndex=31;
if (AnsiString(myce.checks,2)!="CE")
{
rootnode->ImageIndex=4;
Form1->TreeView->Items->AddChild(currentnode,"Type : ceci n'est pas un fichier CE")->ImageIndex=1;
}
else
{
rootnode->ImageIndex=2;
subcurrentnode=Form1->TreeView->Items->AddChild(currentnode,"Type : "+AnsiString(myce.checks,2));
Form1->TreeView->Items->AddChild(subcurrentnode,"Adresse réelle: 0x"+IntToHex((int)0+offset,4))->ImageIndex=31;
Form1->TreeView->Items->AddChild(subcurrentnode,"Adresse : 0x"+IntToHex((int)0,4))->ImageIndex=31;
Form1->TreeView->Items->AddChild(subcurrentnode,"Taille: 0x0002")->ImageIndex=31;
subcurrentnode=Form1->TreeView->Items->AddChild(currentnode,"Version : "+IntToStr(myce.major));
Form1->TreeView->Items->AddChild(subcurrentnode,"Adresse réelle: 0x"+IntToHex((int)2+offset,4))->ImageIndex=31;
Form1->TreeView->Items->AddChild(subcurrentnode,"Adresse : 0x"+IntToHex((int)2,4))->ImageIndex=31;
Form1->TreeView->Items->AddChild(subcurrentnode,"Taille: 0x0001")->ImageIndex=31;
subcurrentnode=Form1->TreeView->Items->AddChild(currentnode,"Checksum : 0x"+IntToHex((int)myce.checksum,8));
Form1->TreeView->Items->AddChild(subcurrentnode,"Adresse réelle: 0x"+IntToHex((int)3+offset,4))->ImageIndex=31;
Form1->TreeView->Items->AddChild(subcurrentnode,"Adresse : 0x"+IntToHex((int)3,4))->ImageIndex=31;
Form1->TreeView->Items->AddChild(subcurrentnode,"Taille: 0x0004")->ImageIndex=31;
if (myce.compressed>=1)
subcurrentnode=Form1->TreeView->Items->AddChild(currentnode,"Fichier compressé avec RIP");
else
subcurrentnode=Form1->TreeView->Items->AddChild(currentnode,"Fichier sans compression");
Form1->TreeView->Items->AddChild(subcurrentnode,"Adresse réelle: 0x"+IntToHex((int)7+offset,4))->ImageIndex=31;
Form1->TreeView->Items->AddChild(subcurrentnode,"Adresse : 0x"+IntToHex((int)7,4))->ImageIndex=31;
Form1->TreeView->Items->AddChild(subcurrentnode,"Taille: 0x0001")->ImageIndex=31;
subcurrentnode=Form1->TreeView->Items->AddChild(currentnode,"Pointeur exportation : 0x"+IntToHex(myce.exports,4));
Form1->TreeView->Items->AddChild(subcurrentnode,"Adresse réelle: 0x"+IntToHex((int)8+offset,4))->ImageIndex=31;
Form1->TreeView->Items->AddChild(subcurrentnode,"Adresse : 0x"+IntToHex((int)8,4))->ImageIndex=31;
Form1->TreeView->Items->AddChild(subcurrentnode,"Taille: 0x0002")->ImageIndex=31;
subcurrentnode=Form1->TreeView->Items->AddChild(currentnode,"Pointeur Importation : 0x"+IntToHex(myce.imports,4));
Form1->TreeView->Items->AddChild(subcurrentnode,"Adresse réelle: 0x"+IntToHex((int)10+offset,4))->ImageIndex=31;
Form1->TreeView->Items->AddChild(subcurrentnode,"Adresse : 0x"+IntToHex((int)10,4))->ImageIndex=31;
Form1->TreeView->Items->AddChild(subcurrentnode,"Taille: 0x0002")->ImageIndex=31;
subcurrentnode=Form1->TreeView->Items->AddChild(currentnode,"Pointeur sections : 0x"+IntToHex(myce.sections,4));
Form1->TreeView->Items->AddChild(subcurrentnode,"Adresse réelle: 0x"+IntToHex((int)12+offset,4))->ImageIndex=31;
Form1->TreeView->Items->AddChild(subcurrentnode,"Adresse : 0x"+IntToHex((int)12,4))->ImageIndex=31;
Form1->TreeView->Items->AddChild(subcurrentnode,"Taille: 0x0002")->ImageIndex=31;
subcurrentnode=Form1->TreeView->Items->AddChild(currentnode,"Point d'entrée : 0x"+IntToHex(myce.starting,4));
Form1->TreeView->Items->AddChild(subcurrentnode,"Adresse réelle: 0x"+IntToHex((int)14+offset,4))->ImageIndex=31;
Form1->TreeView->Items->AddChild(subcurrentnode,"Adresse : 0x"+IntToHex((int)14,4))->ImageIndex=31;
Form1->TreeView->Items->AddChild(subcurrentnode,"Taille: 0x0002")->ImageIndex=31;
Form1->TreeView->Items->AddChild(currentnode,"Taille : 0x0010")->ImageIndex=31;
char imported[30];
AnsiString imports[30]={""};
AnsiString exports[30]={""};
AnsiString sections[30]={""};
unsigned short iaddrs[30]={0};
unsigned short eaddrs[30]={0};
unsigned short saddrs[30]={0};
unsigned short ssize[30]={0};
AnsiString libraries[30]={""};
AnsiString alib;
int i=0;
pointeur=myce.imports;
int nblib=0;
int nbimp=0;
if (myce.imports!=0)
{
currentnode=Form1->TreeView->Items->AddChild(rootnode,"Importations");
currentnode->ImageIndex=14;
Form1->TreeView->Items->AddChild(currentnode,"Adresse réelle: 0x"+IntToHex((int)pointeur+offset,4))->ImageIndex=31;
Form1->TreeView->Items->AddChild(currentnode,"Adresse : 0x"+IntToHex((int)pointeur,4))->ImageIndex=31;
do
{
fseek(in, pointeur+offset, SEEK_SET);
fread(&imported, sizeof(imported), 1, in);
imports[i]=AnsiString((char*)&imported);
iaddrs[i]=pointeur;
pointeur+=imports[i].Length()+5;
alib=imports[i].SubString(0,imports[i].Pos(":")-1);
int j;
for(j=0;(j<nblib)&&(alib!=libraries[j])&&(libraries[j]!="");j++);
if ((libraries[j]=="")&&(alib!="")) {
libraries[j]=alib;
nblib++;
}
i++;
} while(imports[i-1]!="");
nbimp=i-1;
for(int i=0;i<nblib;i++)
{
subcurrentnode=Form1->TreeView->Items->AddChild(currentnode,libraries[i]);
subcurrentnode->ImageIndex=13;
for(int j=0;j<nbimp;j++)
{
if (imports[j].SubString(0,imports[j].Pos(":")-1)==libraries[i])
{
subsubcurrentnode=Form1->TreeView->Items->AddChild(subcurrentnode,imports[j].SubString(imports[j].Pos(":")+2,255));
subsubcurrentnode->ImageIndex=3;
Form1->TreeView->Items->AddChild(subsubcurrentnode,"Adresse réelle: 0x"+IntToHex((int)iaddrs[j]+offset,4))->ImageIndex=31;
Form1->TreeView->Items->AddChild(subsubcurrentnode,"Adresse : 0x"+IntToHex((int)iaddrs[j],4))->ImageIndex=31;
}
}
}
currentnode->Text="importations ("+IntToStr(nbimp)+"/"+IntToStr(nblib)+")";
Form1->TreeView->Items->AddChild(currentnode,"Taille : 0x"+IntToHex((int)pointeur-myce.imports,4))->ImageIndex=31;
}
else
{
nbimp=0;
}
i=0;
pointeur=myce.exports;
int nbexp=0;
if (myce.exports!=0)
{
currentnode=Form1->TreeView->Items->AddChild(rootnode,"Exportations");
currentnode->ImageIndex=14;
Form1->TreeView->Items->AddChild(currentnode,"Adresse réelle: 0x"+IntToHex((int)pointeur+offset,4))->ImageIndex=31;
Form1->TreeView->Items->AddChild(currentnode,"Adresse : 0x"+IntToHex((int)pointeur,4))->ImageIndex=31;
do
{
fseek(in, pointeur+offset, SEEK_SET);
fread(&imported, sizeof(imported), 1, in);
exports[i]=AnsiString((char*)&imported);
pointeur+=exports[i].Length()+1;
fseek(in, pointeur+offset, SEEK_SET);
fread(&eaddrs[i],sizeof(eaddrs[i]),1,in);
pointeur+=2;
i++;
} while(exports[i-1]!="");
nbexp=i-1;
for(int i=0;i<nbexp;i++)
{
subcurrentnode=Form1->TreeView->Items->AddChild(currentnode,exports[i]);
subcurrentnode->ImageIndex=3;
Form1->TreeView->Items->AddChild(subcurrentnode,"Adresse réelle: 0x"+IntToHex(eaddrs[i]+offset,4))->ImageIndex=31;
Form1->TreeView->Items->AddChild(subcurrentnode,"Adresse : 0x"+IntToHex(eaddrs[i],4))->ImageIndex=31;
}
currentnode->Text="exportations ("+IntToStr(nbexp)+")";
Form1->TreeView->Items->AddChild(currentnode,"Taille : 0x"+IntToHex((int)pointeur-myce.exports,4))->ImageIndex=31;
}
else
{
nbexp=0;
}
pointeur=myce.sections;
i=0;
int nbsec=0;
if (myce.sections!=0)
{
currentnode=Form1->TreeView->Items->AddChild(rootnode,"Sections");
currentnode->ImageIndex=12;
Form1->TreeView->Items->AddChild(currentnode,"Adresse réelle: 0x"+IntToHex((int)pointeur+offset,4))->ImageIndex=31;
Form1->TreeView->Items->AddChild(currentnode,"Adresse : 0x"+IntToHex((int)pointeur,4))->ImageIndex=31;
do
{
fseek(in, pointeur+offset, SEEK_SET);
fread(&saddrs[i],sizeof(saddrs[i]),1,in);
pointeur+=2;
fseek(in, pointeur+offset, SEEK_SET);
fread(&ssize[i],sizeof(ssize[i]),1,in);
pointeur+=2;
fseek(in, pointeur+offset, SEEK_SET);
fread(&imported, sizeof(imported), 1, in);
sections[i]=AnsiString((char*)&imported);
pointeur+=sections[i].Length()+1;
i++;
} while(ssize[i-1]!=0);
nbsec=i-1;
for(int i=0;i<nbsec;i++)
{
subcurrentnode=Form1->TreeView->Items->AddChild(currentnode,sections[i]);
Form1->TreeView->Items->AddChild(subcurrentnode,"Adresse réelle: 0x"+IntToHex(saddrs[i]+offset,4))->ImageIndex=31;
Form1->TreeView->Items->AddChild(subcurrentnode,"Adresse : 0x"+IntToHex(saddrs[i],4))->ImageIndex=31;
if (saddrs[i]!=0) tree(file,saddrs[i],subcurrentnode);
subcurrentnode->ImageIndex=2;
Form1->TreeView->Items->AddChild(subcurrentnode,"Taille : 0x"+IntToHex(ssize[i],4))->ImageIndex=31;
}
Form1->TreeView->Items->AddChild(currentnode,"Taille : 0x"+IntToHex((int)pointeur-myce.sections,4))->ImageIndex=31;
currentnode->Text="Sections ("+IntToStr(nbsec)+")";
}
else
{
nbsec=0;
}
if (offset==0)
{
fseek(in, 0L, SEEK_END);
int size = ftell(in);
Form1->TreeView->Items->AddChild(rootnode,"Taille : 0x"+IntToHex(size,4))->ImageIndex=31;
}
}
fclose(in);
}
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Ouvrir1Click(TObject *Sender)
{
if (OpenDialog->Execute())
tree(OpenDialog->FileName,0,Form1->TreeView->Items->Add(Form1->TreeView->Items->GetFirstNode(),ExtractFileName(OpenDialog->FileName)));
TTreeNode* node=Form1->TreeView->Items->GetFirstNode();
while(node!=NULL)
{
node->SelectedIndex=node->ImageIndex;
node=node->GetNext();
}
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Quitter1Click(TObject *Sender)
{
Close();
}
//---------------------------------------------------------------------------

Binary file not shown.

1434
outils/CE explorer/unit1.dfm Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,37 @@
//---------------------------------------------------------------------------
#ifndef Unit1H
#define Unit1H
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include <Menus.hpp>
#include <Dialogs.hpp>
#include <ComCtrls.hpp>
#include <ImgList.hpp>
//---------------------------------------------------------------------------
class TForm1 : public TForm
{
__published: // IDE-managed Components
TMainMenu *MainMenu1;
TMenuItem *Fichier1;
TMenuItem *Ouvrir1;
TOpenDialog *OpenDialog;
TTreeView *TreeView;
TImageList *ImageList;
TMenuItem *N1;
TMenuItem *Quitter1;
TRichEdit *RichEdit1;
void __fastcall Ouvrir1Click(TObject *Sender);
void __fastcall Quitter1Click(TObject *Sender);
private: // User declarations
public: // User declarations
__fastcall TForm1(TComponent* Owner);
};
//---------------------------------------------------------------------------
extern PACKAGE TForm1 *Form1;
//---------------------------------------------------------------------------
#endif

108
outils/compression/rip.asm Normal file
View File

@ -0,0 +1,108 @@
net segment
org 0100h
assume cs:net,ds:net
start:
jmp deb
taille dw 0
signe db 'rip'
signe2 db 64 dup (0)
p1 db '@'
p2 db '@'
min db 4
deb:
mov BL,DS:[0080h]
xor BH,BH
or BX,BX
mov byte ptr [0081h+BX],00h
mov AX,3D02h
mov DX,0082H
int 21h
mov bx,ax
mov ah,3fh
mov cx,0ffffh
mov dx,offset data
int 21h
mov taille,ax
mov ah,3eh
int 21h
mov si,82h
mov di,offset signe2
mov cx,64
rep movsb
mov di,offset signe2
mov cx,64
mov al,2eh
repne scasb
push di
mov si,di
mov di,offset data
add di,taille
mov cx,3
rep movsb
mov ax,di
pop di
mov cx,3
mov si,offset signe
rep movsb
mov di,ax
mov cx,taille
mov si,offset data
mov dx,1
boucle:
lodsb
cmp al,[si]
jne pas
inc dl
loop boucle
jmp fin
pas:
cmp dl,min
jb suite
cmp dl,1
jne go
suite:
mov bx,cx
mov cx,dx
rep stosb
mov cx,bx
mov dl,1
loop boucle
jmp fin
go:
mov ah,al
mov al,p1
stosb
mov al,dl
stosb
mov al,ah
stosb
mov al,p2
stosb
mov dl,1
loop boucle
fin:
mov ah,3ch
mov cx,0
mov dx,offset signe2
int 21h
mov bx,ax
mov ah,40h
mov cx,di
sub cx,offset data
sub cx,taille
mov dx,offset data
add dx,taille
int 21h
mov ah,3eh
int 21h
mov ah,41h
mov dx,82h
int 21h
ret
data db 0
net ends
end start
net

View File

@ -0,0 +1,88 @@
net segment
org 0100h
assume cs:net,ds:net
start:
jmp deb
taille dw 0
signe2 db 64 dup (0)
p1 db '@'
p2 db '@'
deb:
mov BL,DS:[0080h]
xor BH,BH
or BX,BX
mov byte ptr [0081h+BX],00h
mov AX,3D02h
mov DX,0082H
int 21h
mov bx,ax
mov ah,3fh
mov cx,0ffffh
mov dx,offset data
int 21h
mov taille,ax
mov ah,3eh
int 21h
mov si,82h
mov di,offset signe2
mov cx,64
rep movsb
mov di,offset signe2
mov cx,64
mov al,2eh
repne scasb
mov si,offset data
mov cx,3
rep movsb
mov cx,taille
mov di,offset data
add di,taille
mov dx,1
boucle:
lodsb
cmp al,p1
je pas
suite:
stosb
loop boucle
jmp fin
pas:
mov al,p2
cmp [si+2],al
jne suite
lodsb
mov bx,cx
mov cl,al
xor ch,ch
lodsb
rep stosb
mov cx,bx
sub cx,3
inc si
loop boucle
fin:
mov ah,3ch
mov cx,0
mov dx,offset signe2
int 21h
mov bx,ax
mov ah,40h
mov cx,di
sub cx,offset data
sub cx,taille
mov dx,offset data
add dx,taille
int 21h
mov ah,3eh
int 21h
mov ah,41h
mov dx,82h
int 21h
ret
data db 0
net ends
end start
net

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 test3d.ce test2d.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,54 +1,50 @@
.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
int 47H
mov ah,2
int 47h
xor ebp,ebp xor ebp,ebp
xor ax,ax xor ax,ax
mov fs,ax mov fs,ax
mov ah,43 call [disablescroll]
int 47h adres:
Adres: call [saveparamto],offset infos
mov di,offset infos mov al,[infos.lines]
mov ah,34 dec al
int 47h mov [lastline],al
dec byte ptr [di] mov al,[infos.columns]
mov al,[di+1]
sub al,16 sub al,16
mov bl,al mov bl,al
shr al,2 shr al,2
mov [di+1],al mov [sizex],al
and bl,11b and bl,11b
mov [di+2],bl mov [sizex2],bl
mov al,[di+7] mov al,[infos.mode]
cmp al,oldmode cmp al,[oldmode]
je noinit je noinit
mov ah,2 call [clearscreen]
int 47h mov [oldmode],al
mov oldmode,al
noinit: noinit:
mov bx,0 call [setxy],0,0
mov ah,25
int 47h
mov bh,infos
mov edi,ebp mov edi,ebp
mov bh,[lastline]
lines: lines:
xor edx,edx xor edx,edx
mov dx,di mov dx,di
@ -60,49 +56,43 @@ lines:
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,infos+1 mov al,[sizex]
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:
mov bh,0 call [setxy],0,[word ptr lastline]
mov bl,infos call [print],offset menu
mov ah,25
int 47h
push offset menu
call [print]
waitkey: waitkey:
mov ax,0 mov ax,0
int 16h int 16h
@ -138,17 +128,13 @@ outes:
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
int 47h
push offset menu
call [print]
mov ax,0B800h mov ax,0B800h
mov es,ax mov es,ax
mov xxyy2,3 mov [xxyy2],3
mov xxyy,3 mov [xxyy],3
call calc1 call calc1
call calc2 call calc2
waitst: waitst:
@ -156,7 +142,7 @@ waitst:
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
@ -165,93 +151,83 @@ tre:
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
int 47h
push offset msg
call [print]
mov ax,0 mov ax,0
int 16h int 16h
mov bh,0 call [setxy],0,[word ptr lastline]
mov bl,infos call [print],offset menu
mov ah,25
int 47h
push offset menu
call [print]
pop bx si pop bx si
mov es:[bx-1],edi mov [es:bx-1],edi
mov es:[si-1],dx mov [es:si-1],dx
no: no:
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
@ -259,56 +235,52 @@ cursor:
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
@ -318,7 +290,6 @@ calc3:
mov gs,dx mov gs,dx
pop dx pop dx
ret ret
asciihex2dec: asciihex2dec:
cmp al,'a' cmp al,'a'
jb nomin jb nomin
@ -341,13 +312,16 @@ calc3:
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
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
@ -356,18 +330,21 @@ 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:
getvar2:
mov ax,0 mov ax,0
int 16h int 16h
retf retf
exporting
imports: declare waitkey
ende
exports:
db "waitkey",0
dw getvar2
dw 0
end start

View File

@ -1,64 +1,66 @@
.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
int 48h
xor bp,bp xor bp,bp
mov di,offset bufferentry call [findfirstfile],offset bufferentry
mov ah,7
int 48h
jc nofiles 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 bx
push offset line push offset line
call [print] call [print]
call [findnextfile],offset bufferentry
jc nofiles
inc bp inc bp
mov ah,8 jmp go
int 48h
jnc 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]
call changelineattr,[xx],112
jmp endof jmp endof
tre1: tre1:
cmp ah,48h cmp ah,48h
jne tre2 jne tre2
cmp xx,1 cmp [xx],1
je endof je endof
dec xx call changelineattr,[xx],7
call select dec [xx]
call changelineattr,[xx],112
jmp endof jmp endof
tre2: tre2:
cmp al,0Dh cmp al,0Dh
@ -72,23 +74,27 @@ tre4:
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
add di,2
dec al
jnz @@popep
ret 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
@ -35,5 +44,3 @@ ctc:
;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
int 49h
jc problem3 jc problem3
push gs push ax
pop es pop es
mov ah,7 call [cs:projfile],offset logo
mov cx,65535
int 49h
jc problem3
mov si,offset logo
mov ah,4
xor di,di
int 48h
jc problem jc problem
mov ecx,eax
call [cs:mbfind],offset logo
push es jc problem
pop ds call [cs:decompressrle],ax,0,es,0,cx
push gs
pop es
xor si,si
xor di,di
mov ah,6
int 48h
jc problem2 jc problem2
push es push es
pop ds pop ds
call [cs:savestate]
mov ah,28h call [cs:setvideomode],word 8
int 47h call [cs:clearscreen]
mov ax,0008h call [cs:loadbmppalet],word 0
int 47h call [cs:showbmp],word 0,word 20,word 150
mov ah,2
int 47h
push 0
call cs:[loadbmppalet]
push 150
push 20
push 0
call cs:[showbmp]
jc problem4 jc problem4
push cs push cs
pop ds pop ds
push offset poper call [cs:print],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:
header exe <"CE",1,0,0,,,,offset realstart>
realstart:
mov eax,cr0 mov eax,cr0
or al,1 or al,1
mov cr0,eax 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

BIN
programs/sphere.3ds Normal file

Binary file not shown.

View File

@ -1,164 +1,108 @@
.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 [cs:randomize]
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 word ptr 2041
push offset zero push offset zero
push offset fixe push offset fixe
push word ptr 5 push 5
push word ptr 'i' push 'i'
push word ptr 'a' push 'a'
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 pushd 5041
push dword ptr 125645 pushd 125645
push offset message push offset message
call [print] call [print]
mov ax,0 xor ax,ax
int 16h int 16h
call [clearscreen]
mov ah,2 call [xchgpages]
int 47h call [clearscreen]
mov ah,30
int 47h
mov ah,2
int 47h
mov cx,200 mov cx,200
go1: go1:
mov ah,30 call [xchgpages]
int 47h call [waitretrace]
mov ah,33 call [print],offset textdemo1
int 47
push offset textdemo1
call [print]
call put call put
mov ah,30 call [xchgpages]
int 47h call [waitretrace]
mov ah,33
int 47h
dec cx dec cx
jnz go1 jnz go1
mov cx,200 mov cx,200
go2: go2:
mov ah,30 call [xchgpages]
int 47h call [waitretrace]
mov ah,33 call [print],offset textdemo2
int 47h
push offset textdemo2
call [print]
call put call put
mov ah,30 call [xchgpages]
int 47h call [waitretrace]
mov ah,33
int 47h
dec cx dec cx
jnz go2 jnz go2
mov cx,200 mov cx,200
go3: go3:
mov ah,30 call [xchgpages]
int 47h call [waitretrace]
mov ah,33 call [print],offset textdemo3
int 47h
push offset textdemo3
call [print]
call put call put
mov ah,30 call [xchgpages]
int 47h call [waitretrace]
mov ah,33
int 47h
dec cx dec cx
jnz go3 jnz go3
call [clearscreen]
mov ah,30 call [xchgpages]
int 47h call [clearscreen]
mov ah,2 call [print],offset texte2
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 mov bp,255
xor edx,edx xor edx,edx
go4: go4:
mov ah,30 call [xchgpages]
int 47h call [waitretrace]
mov ah,33
int 47h
inc edx inc edx
push edx push edx
push offset texte3 push offset texte3
call [print] call [print]
mov ah,30 call [xchgpages]
int 47h call [waitretrace]
mov ah,33
int 47h
dec bp dec bp
jnz go4 jnz go4
push offset texte4 push offset texte4
call [print] call [print]
mov ax,0 mov ax,0
int 16h int 16h
mov ah,29h call [restorestate]
int 47h
retf retf
put: put:
call random call [cs:random]
mov di,dx mov di,ax
and di,4096-2 and di,4096-2
mov si,offset fond mov si,offset fond
call showstring2 call showstring2
ret ret
Random:
push ax
MOV AX,cs:[RandSeed]
MOV DX,8405h
MUL DX
INC AX
MOV cs:[RandSeed],AX
pop ax
ret
randseed dw 1234h
Randomize:
push ax cx dx
mov ah,0
int 1ah
mov cs:randseed,dx
pop dx cx ax
ret
zero db 'Chaine a zro terminal',0 zero db 'Chaine a zro terminal',0
fixe db 20,'Chaine a taille fixe' fixe db 20,'Chaine a taille fixe'
message db "\m01\e\c07\h01Dmonstration de la librairie VIDEO.LIB\l\l" message db "\s\m01\e\c07\h01Dmonstration de la librairie VIDEO.LIB\l\l"
db "\c01Nombres entiers ou signs (%%u/%%i):\l%u\l%iD\l" db "\c01Nombres entiers ou signs (%%u/%%i):\l%u\l%iD\l"
db "\c02Nombre hexadcimaux (%%h):\l%hD\l%hW\l" db "\c02Nombre hexadcimaux (%%h):\l%hD\l%hW\l"
db "\c03Nombres Binaires (%%b):\l%bD\l%bB\l" db "\c03Nombres Binaires (%%b):\l%bD\l%bB\l"
@ -176,7 +120,7 @@ texte1 db 'Echange rapide de pages Vid
texte2 db '\g04,13Routine d''affichage Ultra Rapide Agissant sur le Matriel' texte2 db '\g04,13Routine d''affichage Ultra Rapide Agissant sur le Matriel'
db '\g04,14Possibilit de raliser des effets de superposition',0 db '\g04,14Possibilit de raliser des effets de superposition',0
texte3 db '\c04%bD\l',0 texte3 db '\c04%bD\l',0
texte4 db '\g01,00Sauvegarde et restauration de l''ecran (%%s/%%r)',0 texte4 db '\g01,00Sauvegarde et restauration de l''ecran (\\s/\\r)',0
showstring2: showstring2:
push es bx cx si di push es bx cx si di
@ -188,16 +132,22 @@ showstring2:
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 MATH.LIB,randomize
use MATH.LIB,random
use VIDEO.LIB,print
use VIDEO,xchgpages
use VIDEO,setvideomode
use VIDEO,clearscreen
use VIDEO,savestate
use VIDEO,restorestate
use VIDEO,waitretrace
endi

55
programs/test2d.asm Normal file
View File

@ -0,0 +1,55 @@
model tiny,stdcall
p586N
locals
jumps
codeseg
option procalign:byte
include "..\include\mem.h"
include "..\include\fat.h"
include "..\include\divers.h"
include "..\include\3d.h"
org 0h
start:
header exe <"CE",1,0,0,,offset imports,,offset realstart>
realstart:
call [cs:randomize]
call [cs:savestate]
call [cs:setvideomode],10
call [cs:clearscreen]
mov cx,65535
show:
call [cs:random]
and ax,1111b
push ax
call [cs:random]
push ax
call [cs:random]
push ax
call [cs:random]
push ax
call [cs:random]
push ax
call [cs:line]
dec cx
jnz show
call [cs:bioswaitkey]
call [cs:restorestate]
retf
importing
use VIDEO.LIB,print
use VIDEO,savestate
use VIDEO,clearscreen
use VIDEO,setvideomode
use VIDEO,restorestate
use VIDEO,waitretrace
use GRAPHIC,line ;@x1:word,@y1:word,@x2:word,@y2:word,@color:word
use GRAPHIC,polyfill ;@pointer:word,@nbfaces:word,@color:word;
use SYSTEME,bioswaitkey
use MATH.LIB,randomize
use MATH.LIB,random
endi

245
programs/test3d.asm Normal file
View File

@ -0,0 +1,245 @@
model tiny,stdcall
p586N
locals
jumps
codeseg
option procalign:byte
include "..\include\mem.h"
include "..\include\fat.h"
include "..\include\divers.h"
include "..\include\3d.h"
org 0h
start:
header exe <"CE",1,0,0,,offset imports,,offset realstart>
data:
camera vertex3d <320.0,240.0,70.0>
zoom dd 5.0
rot1 dd 0.1
rot2 dd -0.1
vertexnbp dw 15
dd 0.0,0.0,0.0
dd 20.0,0.0,0.0
dd 24.0,0.0,0.0
dd 20.0,-2.0,0.0
dd 20.0,2.0,0.0
dd 0.0,0.0,0.0
dd 0.0,20.0,0.0
dd 0.0,24.0,0.0
dd -2.0,20.0,0.0
dd 2.0,20.0,0.0
dd 0.0,0.0,0.0
dd 0.0,0.0,20.0
dd 0.0,0.0,24.0
dd -2.0,-2.0,20.0
dd 2.0,2.0,20.0
facenbp dw 6
dw 0,1,1
dw 2,4,3
dw 5,6,6
dw 7,9,8
dw 10,11,11
dw 12,14,13
vertexnbp2 dw 15
dd 0.0,0.0,0.0
dd 20.0,0.0,0.0
dd 24.0,0.0,0.0
dd 20.0,-2.0,0.0
dd 20.0,2.0,0.0
dd 0.0,0.0,0.0
dd 0.0,20.0,0.0
dd 0.0,24.0,0.0
dd -2.0,20.0,0.0
dd 2.0,20.0,0.0
dd 0.0,0.0,0.0
dd 0.0,0.0,20.0
dd 0.0,0.0,24.0
dd -2.0,-2.0,20.0
dd 2.0,2.0,20.0
mat1 mat <?>
mat2 mat <?>
mat3 mat <?>
matrixp mat <?>
mode db 0
objectp:
vertexp equ objectp+15
facep equ vertexp+20000
screen equ facep+20000
;typep db ?
;objectp db 15 dup (?)
;vertexp db 1000*4*3+2 dup (?)
;facep db 2000*3+2 dup (?)
;screen db 1000*2*2 dup (?)
realstart:
call [cs:savestate]
call [cs:setvideomode],10
call [cs:clearscreen]
call [cs:mballoc],65535
mov es,ax
mov si,offset data
mov di,si
mov ecx,(offset realstart-offset data)
shr ecx,2
inc ecx
cld
rep movsd
call [cs:projfile],offset filename
jc errorloading
call [cs:mbfind],offset filename
jc errorloading
push es
pop ds
mov es,ax
call [cs:load3ds],es,0,offset objectp,offset vertexp,offset matrixp,offset facep
call [cs:transform],offset vertexnbp,offset matrixp
call [cs:identity],offset mat1
jmp show
rool:
mov ah,1
int 16h
jz rool
xor ax,ax
int 16h
cmp ax,011Bh
je endee
cmp ax,3B00h
jne notmode
inc [mode]
cmp [mode],3
jb notmodify
mov [mode],0
jmp notmodify
notmode:
cmp ax,4800h
jne notup
call [cs:rotationx],offset mat1,[rot2]
jmp show
notup:
cmp ax,5000h
jne notdown
call [cs:rotationx],offset mat1,[rot1]
jmp show
notdown:
cmp ax,4B00h
jne notleft
call [cs:rotationy],offset mat1,[rot1]
jmp show
notleft:
cmp ax,4D00h
jne notright
call [cs:rotationy],offset mat1,[rot2]
jmp show
notright:
cmp ax,4900h
jne notupup
call [cs:rotationz],offset mat1,[rot1]
jmp show
notupup:
cmp ax,5100h
jne notdowndown
call [cs:rotationz],offset mat1,[rot2]
jmp show
notdowndown:
cmp ax,4A2Dh
jne notminus
fld [camera.tz]
fsub [zoom]
fstp [camera.tz]
jmp show
notminus:
cmp ax,4E2Bh
jne notmaxus
fld [camera.tz]
fadd [zoom]
fstp [camera.tz]
jmp show
notmaxus:
call [cs:identity],offset mat1
jmp rool
show:
call [cs:transform],offset vertexp,offset mat1
call [cs:transform],offset vertexnbp,offset mat1
notmodify:
call [cs:clearscreen]
call [cs:print],offset objectp
call [cs:draw3d_line],3,offset facenbp,offset vertexnbp,offset screen,offset camera,3
call [cs:draw3d_line],3,offset facenbp,offset vertexnbp2,offset screen,offset camera,3
cmp [mode],0
jne line
call [cs:draw3d_point],offset vertexp,offset screen,offset camera,4
jmp retrace
line:
cmp [mode],1
jne hidden
call [cs:draw3d_line],3,offset facep,offset vertexp,offset screen,offset camera,4
jmp retrace
hidden:
call [cs:draw3d_hidden],3,offset facep,offset vertexp,offset screen,offset camera,4
retrace:
call [cs:waitretrace]
call [cs:waitretrace]
jmp rool
endee:
call [cs:restorestate]
retf
errorloading:
push cs
pop ds
call [cs:print],offset errorload
call [cs:bioswaitkey]
jmp endee
errorload db '\c02Erreur au chargement du fichier 3D\l<Appuyez sur une touche>\c07',0
filename find <"SPHERE.3DS",0,0,0,1,>
importing
use 3D.LIB,draw3d_point
use 3D.LIB,draw3d_line
use 3D.LIB,draw3d_hidden
use 3D.LIB,draw3d_hidden_fill
use 3D.LIB,load3ds
use 3D.LIB,translate
use 3D.LIB,translatex
use 3D.LIB,translatey
use 3D.LIB,translatez
use 3D.LIB,scale
use 3D.LIB,rescale
use 3D.LIB,copy
use 3D.LIB,fill
use 3D.LIB,identity
use 3D.LIB,rotationx
use 3D.LIB,rotationy
use 3D.LIB,rotationz
use 3D.LIB,rotation
use 3D.LIB,project
use 3D.LIB,transform
use 3D.LIB,multiply
use VIDEO,savestate
use VIDEO,clearscreen
use VIDEO,setvideomode
use VIDEO,restorestate
use VIDEO,waitretrace
use SYSTEME,bioswaitkey
use SYSTEME,mbfind
use SYSTEME,mballoc
use VIDEO.LIB,print
use DISQUE,projfile
endi

View File

@ -1,24 +1,26 @@
.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
call [print]
mov bp,1000h mov bp,1000h
xor di,di xor di,di
xor cx,cx xor cx,cx
xor edx,edx xor edx,edx
VerifAll: verifall:
mov ah,1 mov ah,1
int 16h int 16h
jz nokey jz nokey
@ -38,11 +40,9 @@ nokey:
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
mov ah,2 call [verifysector],cx
int 48h
jc errors jc errors
je noprob je noprob
inc di inc di
@ -53,29 +53,22 @@ noprob:
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
mov ah,29h call [restorestate]
int 47H
retf 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
noerror db '\g10,10Pas de secteurs defectueux, appuyez sur une touche pour continuer',0 noerror db '\g10,10Pas de secteurs defectueux, appuyez sur une touche pour continuer',0
@ -85,10 +78,10 @@ msg2 db '\g10,20%u %%\g10,16%u cluster testes. \h34%u cluster defectueux.
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 'Û'
@ -105,9 +98,9 @@ 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 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]
mov ah,43 adres:
int 47h call [saveparamto],offset infos
xor bp,bp call [readsector],[sect],offset buffer
push cs jnc adres2
push cs
pop es
pop ds
Adres:
mov di,offset infos
mov ah,34
int 47h
dec infos
push cs
pop es
mov cx,sect
mov di,offset buffer
mov ah,0h
int 48h
jnc noerror
errtr: errtr:
mov ah,25 call [setxy],0,[word ptr lastline]
mov bl,infos call [print],offset errordisk
xor bh,bh xor ax,ax
int 47h
push offset errordisk
call [print]
mov ax,0
int 16h int 16h
noerror:
adres2: adres2:
mov di,offset infos call [saveparamto],offset infos
mov ah,34 mov al,[infos.lines]
int 47h dec al
dec byte ptr [di] mov [lastline],al
mov al,[di+1] mov al,[infos.columns]
sub al,16 sub al,16
mov bl,al mov bl,al
shr al,2 shr al,2
mov [di+1],al mov [sizex],al
and bl,11b and bl,11b
mov [di+2],bl mov [sizex2],bl
mov al,[di+7] mov al,[infos.mode]
cmp al,oldmode cmp al,[oldmode]
je noinit je noinit
mov ah,2 call [clearscreen]
int 47h mov [oldmode],al
mov oldmode,al
noinit: noinit:
mov bx,0 call [setxy],0,0
mov ah,25 mov edi,ebp
int 47h mov bh,[lastline]
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
mov dx,[sect]
push edx push edx
push offset spaces push offset spaces
call [print] call [print]
mov al,infos+1 mov dx,di
mov si,di mov al,[sizex]
mov esi,edi
doaline: doaline:
push dword ptr [di+offset buffer] push [dword ptr di+offset buffer]
push 8 push 8
call [showhex] call [showhex]
push ' ' call [showchar],' '
call [showchar] inc edi
inc di
dec al dec al
jnz doaline jnz doaline
mov di,si mov edi,esi
push offset spaces2 push offset spaces2
call [print] call [print]
mov al,infos+1 mov al,[sizex]
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:
mov bh,0 call [setxy],0,[word ptr lastline]
mov bl,infos call [print],offset menu
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,26 +130,19 @@ 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
int 47h
push offset menu
call [print]
mov ax,0B800h mov ax,0B800h
mov es,ax mov es,ax
mov xxyy2,3 mov [xxyy2],3
mov xxyy,3 mov [xxyy],3
call calc1 call calc1
call calc2 call calc2
waitst: waitst:
@ -180,138 +150,131 @@ waitst:
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,127 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 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
@ -341,13 +304,17 @@ calc3:
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
@ -356,20 +323,24 @@ 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