refactor: Passage aux outils GNU (Cygwin, make)
BREAKING CHANGE: attention modification majeure du code
This commit is contained in:
parent
4fad0d98a3
commit
5a23656824
97
API.md
97
API.md
@ -1,97 +0,0 @@
|
|||||||
Liste exhaustive des APIs supportée par cos
|
|
||||||
78 fonctions
|
|
||||||
|
|
||||||
Drive.sys : Gestionnaires FAT,FIT et partition
|
|
||||||
Interruption 48h (Disquette uniquement)
|
|
||||||
fonctions 00h readsector
|
|
||||||
01h writesector
|
|
||||||
02h verifysector
|
|
||||||
03h loadfatway
|
|
||||||
04h loadfile
|
|
||||||
05h compressrle
|
|
||||||
06h decompressrle
|
|
||||||
lpt.sys : Gestionnaires port parallèle
|
|
||||||
Interruption 0Dh (LPT1) ou 0Fh (LPT2)
|
|
||||||
fonctions 00h getlptin
|
|
||||||
01h getlptout
|
|
||||||
02h getlptinout
|
|
||||||
03h setlptin
|
|
||||||
04h setlptout
|
|
||||||
05h setlptinout
|
|
||||||
06h getlpt
|
|
||||||
07h getfirstlpt
|
|
||||||
08h setemettor
|
|
||||||
09h setreceptor
|
|
||||||
0Ah settimeout
|
|
||||||
0Bh gettimeout
|
|
||||||
0Ch receivelpt
|
|
||||||
0Dh sendlpt
|
|
||||||
0Eh receivelptblock
|
|
||||||
0Fh sendlptblock
|
|
||||||
10h receivecommand
|
|
||||||
11h sendcommand
|
|
||||||
mouse.sys : Gestionnaires souris
|
|
||||||
Interruption 74h (PS/2)
|
|
||||||
fonctions 00h cmdmouse
|
|
||||||
01h cmdmouse2
|
|
||||||
02h detectmouse
|
|
||||||
03h getmouse
|
|
||||||
04h getmousescreen
|
|
||||||
05h configmouse
|
|
||||||
pic8259a.sys : Gestionnaires contrôleur d'interruption programmable
|
|
||||||
Interruption 50h (Maître et esclave)
|
|
||||||
fonctions 00h enableirq
|
|
||||||
01h disableirq
|
|
||||||
02h readmaskirq
|
|
||||||
03h readirr
|
|
||||||
04h readisr
|
|
||||||
05h installhandler
|
|
||||||
06h replacehandler
|
|
||||||
07h getint
|
|
||||||
08h setint
|
|
||||||
09h seteoi
|
|
||||||
video.sys : Gestionnaires de la carte video
|
|
||||||
Interruption 47h (VGA)
|
|
||||||
fonctions 00h setvideomode
|
|
||||||
01h getvideomode
|
|
||||||
02h cleartext
|
|
||||||
03h changefont
|
|
||||||
04h loadfont
|
|
||||||
05h space
|
|
||||||
06h line
|
|
||||||
07h showchar
|
|
||||||
08h showint
|
|
||||||
09h showsigned
|
|
||||||
0Ah showhex
|
|
||||||
0Bh showbin
|
|
||||||
0Ch showstring
|
|
||||||
0Dh showstring0
|
|
||||||
0Eh showcharat
|
|
||||||
0Fh showintat
|
|
||||||
10h showsignedat
|
|
||||||
11h showhexat
|
|
||||||
12h showbinat
|
|
||||||
13h showstringat
|
|
||||||
14h showstring0at
|
|
||||||
15h setcolor
|
|
||||||
16h getcolor
|
|
||||||
17h scrolldown
|
|
||||||
18h getxy
|
|
||||||
19h setxy
|
|
||||||
1Ah savescreen
|
|
||||||
1Bh restorescreen
|
|
||||||
1Ch page2to1
|
|
||||||
1Dh page1to2
|
|
||||||
1Eh xchgPages
|
|
||||||
1Fh savepage1
|
|
||||||
20h changelineattr
|
|
||||||
21h waitretrace
|
|
||||||
22h getinfos
|
|
||||||
23h loadbmp
|
|
||||||
24h showbmp
|
|
||||||
25h clearscr
|
|
||||||
26h savedac
|
|
||||||
27h restoredac
|
|
||||||
28h savestate
|
|
||||||
29h restorestate
|
|
||||||
|
|
321
INFORMATIONS.md
Executable file → Normal file
321
INFORMATIONS.md
Executable file → Normal file
@ -1,53 +1,268 @@
|
|||||||
< COS2000 the new operating system >
|

|
||||||
|
## Documentation d'origine (importée)
|
||||||
|
|
||||||
I. Présentation
|
COS 2000
|
||||||
|
Compatible Operating System
|
||||||
COS2000, par définition, est système d'exploitation. Celui-ci prend la direction des opérations à partir
|
|
||||||
du moment où le PC est mis sous tension (Après le BIOS). Il gère tous les périphériques rattachés au PC et
|
|
||||||
offre aux programmeurs les moyens de développer des applications compatibles en fournissant des APIs
|
|
||||||
(Application Programming Interface). COS2000 est basé sur un concept particulier qui est d'offrir aux
|
Présentation
|
||||||
programmeurs un maximum de fonctions intégrées pour faciliter le travail des programmeurs et réduire la
|
Comment l’installer
|
||||||
taille des programmes.
|
Mode d’emploi
|
||||||
|
Faire un programme pour COS
|
||||||
II. Comment l'installer ?
|
Liste des APIs
|
||||||
|
En cas de problème
|
||||||
Pour installer COS2000 :
|
|
||||||
|
mailto:nicolas@palon.fr
|
||||||
- Insérez une disquette 1.44 Mo vierge ou inutile dans votre lecteur.
|
|
||||||
- Lancez le programme SETUP.COM situé dans le dossier de COS2000.
|
|
||||||
- Si celui-ci ne détecte pas d'erreur, COS2000 est installé !
|
Présentation
|
||||||
|
|
||||||
Pour lancer COS2000 :
|
COS2000, par définition, est système d'exploitation. Celui-ci prend la direction des opérations à partir du moment où le PC est mis sous tension (Après le BIOS). Il gère tous les périphériques rattachés au PC et offre aux programmeurs les moyens de développer des applications compatibles en fournissant des APIs (Application Programming Interface). COS2000 est basé sur un concept particulier qui est d'offrir aux programmeurs un maximum de fonctions intégrées pour faciliter le travail des programmeurs et réduire la taille des programmes.
|
||||||
|
|
||||||
- Insérez la disquette où COS2000 est installé.
|
Comment l'installer ?
|
||||||
- Veillez que dans le BIOS vous puissiez démarrer à partir de A:.
|
|
||||||
- Redémarrer votre ordinateur et vous serez sur COS2000.
|
Pour installer COS2000 :
|
||||||
|
|
||||||
Il est possible de télécharger une version plus récente de COS2000 à :
|
Sous dos/windows
|
||||||
|
|
||||||
https://github.com/dahut87/cos2000v1
|
Insérez une disquette 1.44 Mo vierge ou inutile dans votre lecteur.
|
||||||
|
Lancez le programme SETUP.COM situé dans le dossier de COS2000.
|
||||||
III. Mode d'emploi
|
- Si celui ci ne détecte pas d'erreur, COS2000 est installé !
|
||||||
|
|
||||||
Le COS MENU LOADER est le premier logiciel qui est lancé au démarrage. A partir de celui-ci, vous pouvez
|
Sous Linux
|
||||||
visionner tout les fichiers présents sur votre disquette et éventuellement les exécuter s'ils possèdent
|
|
||||||
l'extension EXE . Pour cela, il suffit de sélectionner avec la ligne en surbrillance le programme à exécuter
|
Insérez une disquette 1.44 Mo vierge ou inutile dans votre lecteur.
|
||||||
en utilisant les flèches de direction. Pour exécuter le programmer, pressez la touche "Entrée".
|
Lancez le programme SETUP.SH situé dans le dossier de COS2000.
|
||||||
|
- Si celui ci ne détecte pas d'erreur, COS2000 est installé !
|
||||||
A partir du COS MENU LOADER on peut lancer un interpréteur de commandes . Celui-ci s'appelle PROMPT.EXE.
|
|
||||||
Une fois dans l'interpréteur de commande, vous pouvez tout aussi bien lancer des logiciels en saisissant leurs
|
Pour lancer COS2000 :
|
||||||
noms après "COS>".
|
|
||||||
|
Insérez la disquette où COS2000 est installé.
|
||||||
En plus des logiciels, l'interpréteur de commandes peut exécuter 6 commandes :
|
Veillez que dans le BIOS vous puissiez démarrer à partir de A:.
|
||||||
|
Redémarrer votre ordinateur et vous serez sur COS2000.
|
||||||
EXIT Quitte l'interpréteur
|
|
||||||
VERSION Donne la version de COS2000
|
|
||||||
CLS Efface l'écran
|
|
||||||
REBOOT Redémarre le PC
|
Mode d'emploi
|
||||||
COMMAND Donne la liste des commandes disponibles
|
|
||||||
MODE [mode] Permet de changer de mode vidéo. [mode] doit être un entier compris entre 1 et 9. les
|
L’interpréteur de commande COS est le premier logiciel qui est lancé au démarrage. A partir de celui-ci vous pouvez exécuter quelques commandes ou logiciels.
|
||||||
modes au delà de 4 sont des modes graphiques à texte émulé. Il est déconseillé de les
|
|
||||||
utiliser car il est parfois impossible de revenir aux modes texte.
|
En plus des logiciels, l'interpréteur de commandes peut exécuter 6 commandes :
|
||||||
|
|
||||||
Les possibilités de COS2000 sont aujourd'hui très limitées car il est en cours de développement.
|
QUIT
|
||||||
|
Quitte l'interpréteur.
|
||||||
|
|
||||||
|
VERS
|
||||||
|
Donne la version de COS2000.
|
||||||
|
|
||||||
|
EFFAC
|
||||||
|
Efface l'écran.
|
||||||
|
|
||||||
|
REDEM
|
||||||
|
Redémarre le PC.
|
||||||
|
|
||||||
|
CMDS
|
||||||
|
Donne la liste des commandes disponibles.
|
||||||
|
|
||||||
|
MODE [mode]
|
||||||
|
Permet de changer de mode vidéo. [mode] doit être un entier compris entre 1 et 9. les modes au delà de 4 sont des modes graphiques à texte émulé. Il est déconseillé de les utiliser car il est parfois impossible de revenir aux modes texte.
|
||||||
|
|
||||||
|
LIRE
|
||||||
|
Permet de lire un support disquette 1.44 Mo au format FAT12.
|
||||||
|
|
||||||
|
CH
|
||||||
|
Change le dossier actuel vers celui spécifié.
|
||||||
|
|
||||||
|
VOIR
|
||||||
|
Permet de lister le contenu du dossier actuel.
|
||||||
|
|
||||||
|
|
||||||
|
Faire un programme pour COS
|
||||||
|
|
||||||
|
Toute contribution à COS 2000 en terme de programme est la bienvenue, un répertoire « contribs » contiendra les programmes des différents contributeurs. Aucune modification a ceux-ci ne sera faire sans l’accord explicite de l’auteur. Pour une contribution écrivez moi a l’adresse mailto:nicolas@palon.fr.
|
||||||
|
|
||||||
|
Pour l’instant il n’y a aucun formatage particulier du code à respecter pour faire un programme pour COS 2000. Il faut pour l’instant seulement un point d’entrée en 0100h comme un .COM de dos, 64 Ko sont donc disponible au programme, la pile utilisé est celle du système d’exploitation, c’est donc le seul segment qui ne sera pas initialisé comme les autres.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Pour clore le programme il suffit de faire un retour far.
|
||||||
|
Exemple avec un Hello Word.
|
||||||
|
|
||||||
|
Avec tasm
|
||||||
|
|
||||||
|
.model tiny ;model tiny (.com)
|
||||||
|
.486 ;Pour processeur 80486
|
||||||
|
Smart ;Optimisations
|
||||||
|
.code ;Segment de code
|
||||||
|
|
||||||
|
org 0100h ;Point d’entré en 0100h
|
||||||
|
|
||||||
|
start:
|
||||||
|
mov ah,0Dh
|
||||||
|
mov si,offset msg
|
||||||
|
int 47h ;Afficher le texte pointé par DS:SI (Showstring0)
|
||||||
|
xor ax,ax
|
||||||
|
int 16h ;Attendre l’appuie sur une touche
|
||||||
|
db 0CBH ;retour far
|
||||||
|
|
||||||
|
msg db ‘Hello World’,0
|
||||||
|
end start
|
||||||
|
|
||||||
|
Avec nasm
|
||||||
|
|
||||||
|
[bits 16] ;16 bits
|
||||||
|
[org 0x0100] ;Point d’entré en 0100h
|
||||||
|
section .text ;Segment de code
|
||||||
|
|
||||||
|
start:
|
||||||
|
mov ah,0x0D
|
||||||
|
mov si,msg
|
||||||
|
int 0x47 ;Afficher le texte pointé par DS:SI (Showstring0)
|
||||||
|
xor ax,ax
|
||||||
|
int 0x16 ;Attendre l’appuie sur une touche
|
||||||
|
retf ;retour far
|
||||||
|
|
||||||
|
msg db ‘Hello World’,0
|
||||||
|
|
||||||
|
|
||||||
|
Comme vous pouvez le constater l’appel des APIs de Cos se réalise par le biais d’interruptions logiciels dont voici la liste.
|
||||||
|
|
||||||
|
Liste des APIs
|
||||||
|
|
||||||
|
disque.sys : Gestionnaires FAT12 et Disquette
|
||||||
|
Interruption 48h (Disquette uniquement)
|
||||||
|
|
||||||
|
00h readsector
|
||||||
|
01h writesector
|
||||||
|
02h verifysector
|
||||||
|
03h initdrive
|
||||||
|
04h loadfile
|
||||||
|
05h compressrle
|
||||||
|
06h decompressrle
|
||||||
|
07h findfirstfile
|
||||||
|
08h getfreespace
|
||||||
|
09h searchfile
|
||||||
|
0Ah getname
|
||||||
|
0Bh getserial
|
||||||
|
0Ch changedir
|
||||||
|
0Dh readcluster
|
||||||
|
0Eh writecluster
|
||||||
|
0Fh getdir
|
||||||
|
|
||||||
|
port.sys : Gestionnaires port parallèle
|
||||||
|
Interruption 0Dh (LPT1) ou 0Fh (LPT2)
|
||||||
|
|
||||||
|
00h getlptin
|
||||||
|
01h getlptout
|
||||||
|
02h getlptinout
|
||||||
|
03h setlptin
|
||||||
|
04h setlptout
|
||||||
|
05h setlptinout
|
||||||
|
06h getlpt
|
||||||
|
07h getfirstlpt
|
||||||
|
08h setemettor
|
||||||
|
09h setreceptor
|
||||||
|
0Ah settimeout
|
||||||
|
0Bh gettimeout
|
||||||
|
0Ch receivelpt
|
||||||
|
0Dh sendlpt
|
||||||
|
0Eh receivelptblock
|
||||||
|
0Fh sendlptblock
|
||||||
|
10h receivecommand
|
||||||
|
11h sendcommand
|
||||||
|
|
||||||
|
souris.sys : Gestionnaires souris
|
||||||
|
Interruption 74h (PS/2)
|
||||||
|
|
||||||
|
00h cmdmouse
|
||||||
|
01h cmdmouse2
|
||||||
|
02h detectmouse
|
||||||
|
03h getmouse
|
||||||
|
04h getmousescreen
|
||||||
|
05h configmouse
|
||||||
|
|
||||||
|
8259a.sys : Gestionnaires contrôleur d'interruption programmable
|
||||||
|
Interruption 50h (Maître et esclave)
|
||||||
|
|
||||||
|
00h enableirq
|
||||||
|
01h disableirq
|
||||||
|
02h readmaskirq
|
||||||
|
03h readirr
|
||||||
|
04h readisr
|
||||||
|
05h installhandler
|
||||||
|
06h replacehandler
|
||||||
|
07h getint
|
||||||
|
08h setint
|
||||||
|
09h seteoi
|
||||||
|
|
||||||
|
video.sys : Gestionnaires de la carte vidéo
|
||||||
|
Interruption 47h (VGA)
|
||||||
|
|
||||||
|
00h setvideomode
|
||||||
|
01h getvideomode
|
||||||
|
02h cleartext
|
||||||
|
03h changefont
|
||||||
|
04h loadfont
|
||||||
|
05h space
|
||||||
|
06h line
|
||||||
|
07h showchar
|
||||||
|
08h showint
|
||||||
|
09h showsigned
|
||||||
|
0Ah showhex
|
||||||
|
0Bh showbin
|
||||||
|
0Ch showstring
|
||||||
|
0Dh showstring0
|
||||||
|
0Eh showcharat
|
||||||
|
0Fh showintat
|
||||||
|
10h showsignedat
|
||||||
|
11h showhexat
|
||||||
|
12h showbinat
|
||||||
|
13h showstringat
|
||||||
|
14h showstring0at
|
||||||
|
15h setcolor
|
||||||
|
16h getcolor
|
||||||
|
17h scrolldown
|
||||||
|
18h getxy
|
||||||
|
19h setxy
|
||||||
|
1Ah savescreen
|
||||||
|
1Bh restorescreen
|
||||||
|
1Ch page2to1
|
||||||
|
1Dh page1to2
|
||||||
|
1Eh xchgPages
|
||||||
|
1Fh savepage1
|
||||||
|
20h changelineattr
|
||||||
|
21h waitretrace
|
||||||
|
22h getinfos
|
||||||
|
23h loadbmp
|
||||||
|
24h showbmp
|
||||||
|
25h clearscr
|
||||||
|
26h savedac
|
||||||
|
27h restoredac
|
||||||
|
28h savestate
|
||||||
|
29h restorestate
|
||||||
|
30h enablescroll
|
||||||
|
31h disablescroll
|
||||||
|
32h showdate
|
||||||
|
33h showtime
|
||||||
|
34h showname
|
||||||
|
35h showattr
|
||||||
|
36h showsize
|
||||||
|
|
||||||
|
Pour l’instant je n’ai pas fait de guide détaillé de l’utilisation des fonctions de COS… A venir
|
||||||
|
|
||||||
|
Les possibilités de COS2000 sont aujourd'hui très limitées car il est en cours de développement.
|
||||||
|
|
||||||
|
En cas de problèmes
|
||||||
|
|
||||||
|
Si des bugs surviennent ou si COS2000 ne veut pas s'installer, veuillez s'il vous plaît m'envoyer un E Mail à :
|
||||||
|
|
||||||
|
mailto:nicolas@palon.fr
|
||||||
|
|
||||||
|
COS2000 n'exploite pas les disques durs, il est donc impossible qu'il altère de quelque manière que ce soit vos données !!!!!!!!!!!!!
|
||||||
|
1017
LICENSE.md
Executable file → Normal file
1017
LICENSE.md
Executable file → Normal file
File diff suppressed because it is too large
Load Diff
52
MAKEFILE
Normal file
52
MAKEFILE
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
all:
|
||||||
|
cd commande
|
||||||
|
make
|
||||||
|
cd ..
|
||||||
|
|
||||||
|
cd programs
|
||||||
|
make
|
||||||
|
cd ..
|
||||||
|
|
||||||
|
cd noyau
|
||||||
|
make
|
||||||
|
cd ..
|
||||||
|
|
||||||
|
cd contribs
|
||||||
|
make
|
||||||
|
cd ..
|
||||||
|
|
||||||
|
cd install
|
||||||
|
make
|
||||||
|
cd ..
|
||||||
|
|
||||||
|
copy:
|
||||||
|
make all
|
||||||
|
copy commande\*.exe ..\data
|
||||||
|
copy programs\*.exe ..\data
|
||||||
|
copy programs\*.rip ..\data
|
||||||
|
copy noyau\*.sys ..\data
|
||||||
|
rem copy noyau\*.bin ..\data
|
||||||
|
copy contribs\*.exe ..\data
|
||||||
|
copy install\*.com ..\
|
||||||
|
make clean
|
||||||
|
|
||||||
|
clean:
|
||||||
|
cd commande
|
||||||
|
make clean
|
||||||
|
cd ..
|
||||||
|
|
||||||
|
cd programs
|
||||||
|
make clean
|
||||||
|
cd ..
|
||||||
|
|
||||||
|
cd noyau
|
||||||
|
make clean
|
||||||
|
cd ..
|
||||||
|
|
||||||
|
cd contribs
|
||||||
|
make clean
|
||||||
|
cd ..
|
||||||
|
|
||||||
|
cd install
|
||||||
|
make clean
|
||||||
|
cd ..
|
17
commande/MAKEFILE
Normal file
17
commande/MAKEFILE
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
lnk_boot = tlink /x
|
||||||
|
asm= tasm /t/m5/zi
|
||||||
|
lnk= tlink /x/t
|
||||||
|
|
||||||
|
all: commande.exe
|
||||||
|
|
||||||
|
commande.exe: commande.asm str0.asm
|
||||||
|
$(asm) commande
|
||||||
|
$(lnk) commande
|
||||||
|
ren commande.com commande.exe
|
||||||
|
|
||||||
|
clean:
|
||||||
|
del *.obj
|
||||||
|
del *.exe
|
||||||
|
del *.com
|
||||||
|
del *.sys
|
||||||
|
del *.err
|
@ -1,54 +0,0 @@
|
|||||||
@echo off
|
|
||||||
|
|
||||||
echo Assembling file %1...
|
|
||||||
..\util\tasm %1.asm /m5/x/t
|
|
||||||
if errorlevel 1 goto end
|
|
||||||
if "%1"=="boot" goto boot
|
|
||||||
echo Linking file %1...
|
|
||||||
..\util\tlink %1.obj /x/t
|
|
||||||
if errorlevel 1 goto end
|
|
||||||
echo Copying file %1...
|
|
||||||
if "%1"=="video" goto video
|
|
||||||
if "%1"=="lpt" goto system
|
|
||||||
if "%1"=="keyboard" goto system
|
|
||||||
if "%1"=="mouse" goto system
|
|
||||||
if "%1"=="pic8259a" goto system
|
|
||||||
if "%1"=="timer" goto system
|
|
||||||
if "%1"=="drive" goto system
|
|
||||||
if "%1"=="joystick" goto system
|
|
||||||
if "%1"=="system" goto system
|
|
||||||
if "%1"=="setup" goto setup
|
|
||||||
copy %1.com ..\data\%1.exe>nul
|
|
||||||
goto end
|
|
||||||
|
|
||||||
:boot
|
|
||||||
echo Linking file %1...
|
|
||||||
..\util\tlink %1.obj /x
|
|
||||||
if errorlevel 1 goto end
|
|
||||||
echo Copying file %1...
|
|
||||||
..\util\exe2boot %1.exe
|
|
||||||
copy %1.bin ..\data\%1.bin>nul
|
|
||||||
goto end
|
|
||||||
|
|
||||||
:video
|
|
||||||
type thin8x8.fnt>>%1.com
|
|
||||||
:system
|
|
||||||
copy %1.com ..\data\%1.sys>nul
|
|
||||||
goto end
|
|
||||||
:setup
|
|
||||||
copy %1.com ..\%1.com>nul
|
|
||||||
goto end
|
|
||||||
|
|
||||||
:end
|
|
||||||
if not exist *.bin goto exes
|
|
||||||
del *.bin
|
|
||||||
:exes
|
|
||||||
if not exist *.exe goto coms
|
|
||||||
del *.exe
|
|
||||||
:coms
|
|
||||||
if not exist *.com goto objs
|
|
||||||
del *.com
|
|
||||||
:objs
|
|
||||||
if not exist *.obj goto nobjs
|
|
||||||
del *.obj
|
|
||||||
:nobjs
|
|
@ -1,3 +0,0 @@
|
|||||||
@echo off
|
|
||||||
echo nettoyage en cours...
|
|
||||||
del ..\data\*.* >nul
|
|
714
commande/prompt.asm → commande/commande.asm
Executable file → Normal file
714
commande/prompt.asm → commande/commande.asm
Executable file → Normal file
@ -1,265 +1,449 @@
|
|||||||
.model tiny
|
.model tiny
|
||||||
.486
|
.486
|
||||||
smart
|
smart
|
||||||
.code
|
.code
|
||||||
|
|
||||||
org 0100h
|
org 0100h
|
||||||
|
|
||||||
start:
|
include ..\include\fat.h
|
||||||
mov ah,2
|
|
||||||
int 47h
|
start:
|
||||||
mov ah,6
|
push cs
|
||||||
int 47h
|
push cs
|
||||||
mov ah,6
|
push cs
|
||||||
int 47h
|
push cs
|
||||||
mov ah,42
|
pop ds
|
||||||
int 47h
|
pop es
|
||||||
mov ah,13
|
pop fs
|
||||||
mov si,offset msg
|
pop gs
|
||||||
int 47h
|
mov ah,21
|
||||||
xor bp,bp
|
mov cl,7
|
||||||
mov dl,' '
|
int 47h
|
||||||
call setdelimiter0
|
mov ah,3
|
||||||
replay:
|
int 48h
|
||||||
mov ah,6
|
mov ax,0002
|
||||||
int 47h
|
int 47h
|
||||||
noret:
|
mov ah,2
|
||||||
mov ah,6
|
int 47h
|
||||||
int 47h
|
mov ah,6
|
||||||
mov ah,13
|
int 47h
|
||||||
mov si,offset prompt
|
mov ah,6
|
||||||
int 47h
|
int 47h
|
||||||
mov di,offset buffer
|
mov ah,42
|
||||||
waitchar:
|
int 47h
|
||||||
mov ax,0
|
mov ah,13
|
||||||
int 16h
|
mov si,offset msg
|
||||||
cmp ah,59
|
int 47h
|
||||||
jne norr
|
xor bp,bp
|
||||||
cmp bp,0
|
mov dl,' '
|
||||||
je waitchar
|
call setdelimiter0
|
||||||
mov ah,13
|
replay:
|
||||||
mov si,cs:[bp-8]
|
mov ah,6
|
||||||
int 47h
|
int 47h
|
||||||
push cs
|
noret:
|
||||||
pop es
|
mov ah,6
|
||||||
call copy0
|
int 47h
|
||||||
call getlength0
|
mov ah,16
|
||||||
add di,cx
|
mov di,offset dir
|
||||||
jmp waitchar
|
int 48h
|
||||||
norr:
|
mov si,di
|
||||||
cmp al,0Dh
|
mov ah,13
|
||||||
je entere
|
int 47h
|
||||||
cmp di,offset buffer+256
|
mov si,offset prompt
|
||||||
je waitchar
|
int 47h
|
||||||
mov [di],al
|
mov di,offset buffer
|
||||||
inc di
|
waitchar:
|
||||||
mov dl,al
|
mov ax,0
|
||||||
mov ah,7
|
int 16h
|
||||||
int 47h
|
cmp ah,59
|
||||||
jmp waitchar
|
jne norr
|
||||||
entere:
|
cmp bp,0
|
||||||
mov byte ptr [di],0
|
je waitchar
|
||||||
mov si,offset buffer
|
mov ah,13
|
||||||
cmp si,di
|
mov si,cs:[bp-8]
|
||||||
je noret
|
int 47h
|
||||||
mov ah,6
|
push cs
|
||||||
int 47h
|
pop es
|
||||||
push cs
|
call copy0
|
||||||
pop es
|
call getlength0
|
||||||
mov di,offset buffer2
|
add di,cx
|
||||||
xor cx,cx
|
jmp waitchar
|
||||||
call getitem0
|
norr:
|
||||||
mov si,di
|
cmp al,0Dh
|
||||||
call uppercase0
|
je entere
|
||||||
mov bx,offset commands
|
cmp di,offset buffer+256
|
||||||
xor bp,bp
|
je waitchar
|
||||||
tre:
|
mov [di],al
|
||||||
mov di,[bx]
|
inc di
|
||||||
add bx,8
|
mov dl,al
|
||||||
cmp di,0
|
mov ah,7
|
||||||
je error
|
int 47h
|
||||||
push cs
|
jmp waitchar
|
||||||
pop es
|
entere:
|
||||||
call evalue0
|
mov byte ptr [di],0
|
||||||
cmp dx,bp
|
mov si,offset buffer
|
||||||
jb noadd
|
cmp si,di
|
||||||
mov bp,dx
|
je noret
|
||||||
mov ax,bx
|
mov ah,6
|
||||||
noadd:
|
int 47h
|
||||||
call cmpstr0
|
push cs
|
||||||
jne tre
|
pop es
|
||||||
mov si,offset buffer
|
mov di,offset buffer2
|
||||||
mov di,offset buffer2
|
xor cx,cx
|
||||||
call copy0
|
call getitem0
|
||||||
mov si,di
|
mov si,di
|
||||||
call uppercase0
|
call uppercase0
|
||||||
xor cx,cx
|
mov bx,offset commands
|
||||||
inc cx
|
xor bp,bp
|
||||||
call getpointeritem0
|
tre:
|
||||||
cmp byte ptr [di-1],0
|
mov di,[bx]
|
||||||
jne nopod
|
add bx,8
|
||||||
mov byte ptr [di],0
|
cmp di,0
|
||||||
nopod:
|
je error
|
||||||
mov si,di
|
push cs
|
||||||
mov di,[bx-4]
|
pop es
|
||||||
call checksyntax0
|
call evalue0
|
||||||
jc errorprec
|
cmp dx,bp
|
||||||
mov bx,[bx-6]
|
jb noadd
|
||||||
call bx
|
mov bp,dx
|
||||||
jmp replay
|
mov ax,bx
|
||||||
error:
|
noadd:
|
||||||
mov bp,ax
|
call cmpstr0
|
||||||
push cs
|
jne tre
|
||||||
pop es
|
mov si,offset buffer
|
||||||
mov dl,'.'
|
mov di,offset buffer2
|
||||||
call searchchar0
|
call copy0
|
||||||
je noaddext
|
mov si,di
|
||||||
mov di,offset buffer
|
call uppercase0
|
||||||
mov si,offset extcom
|
xor cx,cx
|
||||||
call concat0
|
inc cx
|
||||||
noaddext:
|
call getpointeritem0
|
||||||
mov si,offset buffer
|
cmp byte ptr [di-1],0
|
||||||
push cs
|
jne nopod
|
||||||
mov ax,offset arrive
|
mov byte ptr [di],0
|
||||||
push ax
|
nopod:
|
||||||
mov di,offset vga
|
mov si,di
|
||||||
mov ah,40
|
mov di,[bx-4]
|
||||||
int 47h
|
call checksyntax0
|
||||||
mov ax,6000h
|
jc errorprec
|
||||||
mov es,ax
|
mov bx,[bx-6]
|
||||||
push ax
|
call bx
|
||||||
mov di,0100h
|
jmp replay
|
||||||
push di
|
error:
|
||||||
mov ah,4
|
mov bp,ax
|
||||||
int 48h
|
push cs
|
||||||
jc reallyerror
|
pop es
|
||||||
push es
|
mov dl,'.'
|
||||||
push es
|
call searchchar0
|
||||||
push es
|
je noaddext
|
||||||
pop ds
|
mov di,offset buffer
|
||||||
pop fs
|
mov si,offset extcom
|
||||||
pop gs
|
call concat0
|
||||||
push 7202h
|
noaddext:
|
||||||
popf
|
mov si,offset buffer
|
||||||
db 0CBh
|
push cs
|
||||||
arrive:
|
mov ax,offset arrive
|
||||||
push cs
|
push ax
|
||||||
push cs
|
mov di,offset vga
|
||||||
push cs
|
mov ah,40
|
||||||
push cs
|
int 47h
|
||||||
pop ds
|
mov ax,9000h
|
||||||
pop es
|
mov es,ax
|
||||||
pop fs
|
push ax
|
||||||
pop gs
|
mov di,0100h
|
||||||
mov si,offset vga
|
push di
|
||||||
mov ah,41
|
mov ah,4
|
||||||
int 47h
|
int 48h
|
||||||
xor bp,bp
|
jc reallyerror
|
||||||
jmp replay
|
push es
|
||||||
reallyerror:
|
push es
|
||||||
pop ax
|
push es
|
||||||
pop ax
|
pop ds
|
||||||
pop ax
|
pop fs
|
||||||
pop ax
|
pop gs
|
||||||
mov ah,13
|
push 7202h
|
||||||
mov si,offset Error_Syntax
|
popf
|
||||||
int 47h
|
db 0CBh
|
||||||
mov ah,13
|
arrive:
|
||||||
mov si,cs:[bp-8]
|
push cs
|
||||||
int 47h
|
push cs
|
||||||
jmp replay
|
push cs
|
||||||
errorprec:
|
push cs
|
||||||
mov ah,13
|
pop ds
|
||||||
mov si,offset derror
|
pop es
|
||||||
int 47h
|
pop fs
|
||||||
jmp replay
|
pop gs
|
||||||
|
mov si,offset vga
|
||||||
Code_Exit:
|
mov ah,41
|
||||||
pop ax
|
int 47h
|
||||||
db 0CBh
|
xor bp,bp
|
||||||
|
jmp replay
|
||||||
Code_Version:
|
reallyerror:
|
||||||
mov ah,13
|
pop ax
|
||||||
mov si,offset Version_Text
|
pop ax
|
||||||
int 47h
|
pop ax
|
||||||
ret
|
pop ax
|
||||||
|
mov ah,13
|
||||||
Version_Text db 'Cos 2000 version 2.0.1B by Nico',0
|
mov si,offset Error_Syntax
|
||||||
|
int 47h
|
||||||
Code_Cls:
|
mov ah,13
|
||||||
mov ah,2
|
mov si,cs:[bp-8]
|
||||||
int 47h
|
int 47h
|
||||||
ret
|
jmp replay
|
||||||
|
errorprec:
|
||||||
Code_Reboot:
|
mov ah,13
|
||||||
push 0FFFFh
|
mov si,offset derror
|
||||||
push 00000h
|
int 47h
|
||||||
db 0CBH
|
jmp replay
|
||||||
|
|
||||||
Code_Command:
|
Code_Exit:
|
||||||
mov bx,offset commands
|
pop ax
|
||||||
showalls:
|
db 0CBh
|
||||||
mov si,[bx]
|
|
||||||
add bx,8
|
Code_Version:
|
||||||
cmp si,0
|
mov ah,13
|
||||||
je endoff
|
mov si,offset Version_Text
|
||||||
mov ah,13
|
int 47h
|
||||||
int 47h
|
ret
|
||||||
mov ah,6
|
|
||||||
int 47h
|
Version_Text db 'Cos 2000 version 3.0.2Fr par Nico',0
|
||||||
jmp showalls
|
|
||||||
endoff:
|
Code_Cls:
|
||||||
ret
|
mov ah,2
|
||||||
|
int 47h
|
||||||
Code_Mode:
|
ret
|
||||||
mov cx,0
|
|
||||||
call gettypeditem0
|
Code_Reboot:
|
||||||
mov ah,0
|
push 0FFFFh
|
||||||
mov al,dl
|
push 00000h
|
||||||
and al,1111b
|
db 0CBH
|
||||||
int 47h
|
|
||||||
mov ah,2
|
Code_Command:
|
||||||
int 47h
|
mov bx,offset commands
|
||||||
ret
|
showalls:
|
||||||
|
mov si,[bx]
|
||||||
extcom db '.EXE',0
|
add bx,8
|
||||||
|
cmp si,0
|
||||||
commands dw Str_Exit ,Code_Exit ,Syn_Exit ,Help_Exit
|
je endoff
|
||||||
dw Str_Version,Code_Version,Syn_Version,Help_Version
|
mov ah,13
|
||||||
dw Str_Cls ,Code_Cls ,Syn_Cls ,Help_Cls
|
int 47h
|
||||||
dw Str_Reboot ,Code_Reboot ,Syn_Reboot ,Help_Reboot
|
mov ah,6
|
||||||
dw Str_Command,Code_Command,Syn_Command,Help_Command
|
int 47h
|
||||||
dw Str_Mode ,Code_Mode ,Syn_Mode ,Help_Mode
|
jmp showalls
|
||||||
dw 0
|
endoff:
|
||||||
|
ret
|
||||||
Str_Exit db 'EXIT',0
|
|
||||||
Str_Version db 'VERSION',0
|
Code_Mode:
|
||||||
Str_Cls db 'CLS',0
|
mov cx,0
|
||||||
Str_Reboot db 'REBOOT',0
|
call gettypeditem0
|
||||||
Str_Command db 'COMMAND',0
|
mov ah,0
|
||||||
Str_Mode db 'MODE',0
|
mov al,dl
|
||||||
Syn_Exit db 0
|
and al,1111b
|
||||||
Syn_Version db 0
|
int 47h
|
||||||
Syn_Cls db 0
|
mov ah,2
|
||||||
Syn_Reboot db 0
|
int 47h
|
||||||
Syn_Command db 0
|
ret
|
||||||
Syn_Mode db 'FFH',0
|
|
||||||
Help_Exit db 0
|
present db 'Le volume insere est nomme ',0
|
||||||
Help_Version db 0
|
present2 db ', Numero de serie : ',0
|
||||||
Help_Cls db 0
|
nomdisque db 13 dup (0)
|
||||||
Help_Reboot db 0
|
Code_Dir:
|
||||||
Help_Command db 0
|
mov si,offset present
|
||||||
Help_Mode db 0
|
mov ah,13
|
||||||
|
int 47h
|
||||||
derror db 'Syntax error',0
|
mov ah,11
|
||||||
Error_Syntax db 'Command or executable doesn''t exist ! F1 for ',0
|
mov di,offset nomdisque
|
||||||
prompt db 'COS>',0
|
int 48h
|
||||||
msg db 'Cos command interpretor V1.0',0
|
mov si,di
|
||||||
|
mov ah,13
|
||||||
include str0.asm
|
int 47h
|
||||||
|
mov si,offset present2
|
||||||
buffer equ $
|
mov ah,13
|
||||||
buffer2 equ $+256
|
int 47h
|
||||||
vga equ $+512
|
mov ah,12
|
||||||
|
int 48h
|
||||||
end start
|
mov ah,10
|
||||||
|
mov cx,32
|
||||||
|
int 47h
|
||||||
|
mov ah,6
|
||||||
|
int 47h
|
||||||
|
mov ah,6
|
||||||
|
int 47h
|
||||||
|
xor ebp,ebp
|
||||||
|
mov di,offset bufferentry
|
||||||
|
mov si,di
|
||||||
|
mov ah,7
|
||||||
|
int 48h
|
||||||
|
jc nofiles
|
||||||
|
go:
|
||||||
|
mov ah,46
|
||||||
|
int 47h
|
||||||
|
mov ah,05
|
||||||
|
int 47h
|
||||||
|
int 47h
|
||||||
|
int 47h
|
||||||
|
mov ah,44
|
||||||
|
mov dx,[si+Entries.FileDateCrea]
|
||||||
|
int 47h
|
||||||
|
mov ah,05
|
||||||
|
int 47h
|
||||||
|
int 47h
|
||||||
|
int 47h
|
||||||
|
mov ah,45
|
||||||
|
mov dx,[si+Entries.FileTimeCrea]
|
||||||
|
int 47h
|
||||||
|
mov ah,05
|
||||||
|
int 47h
|
||||||
|
int 47h
|
||||||
|
int 47h
|
||||||
|
mov ah,44
|
||||||
|
mov dx,[si+Entries.FileDate]
|
||||||
|
int 47h
|
||||||
|
mov ah,05
|
||||||
|
int 47h
|
||||||
|
int 47h
|
||||||
|
int 47h
|
||||||
|
mov ah,45
|
||||||
|
mov dx,[si+Entries.FileTime]
|
||||||
|
int 47h
|
||||||
|
mov ah,05
|
||||||
|
int 47h
|
||||||
|
int 47h
|
||||||
|
int 47h
|
||||||
|
mov ah,48
|
||||||
|
mov edx,[si+Entries.FileSize]
|
||||||
|
int 47h
|
||||||
|
mov ah,05
|
||||||
|
int 47h
|
||||||
|
int 47h
|
||||||
|
int 47h
|
||||||
|
mov ah,47
|
||||||
|
mov dl,[si+Entries.FileAttr]
|
||||||
|
int 47h
|
||||||
|
mov ah,6
|
||||||
|
int 47h
|
||||||
|
inc bp
|
||||||
|
mov ah,8
|
||||||
|
int 48h
|
||||||
|
jnc go
|
||||||
|
nofiles:
|
||||||
|
mov edx,ebp
|
||||||
|
mov ah,6
|
||||||
|
int 47h
|
||||||
|
mov ah,8
|
||||||
|
int 47h
|
||||||
|
mov si,offset filess
|
||||||
|
mov ah,13
|
||||||
|
int 47h
|
||||||
|
ret
|
||||||
|
bufferentry db 32 dup (0)
|
||||||
|
filess db ' Fichier(s) au total',0
|
||||||
|
|
||||||
|
changing db 'Changement de repertoire vers ',0
|
||||||
|
code_cd:
|
||||||
|
mov cx,0
|
||||||
|
call gettypeditem0
|
||||||
|
push si
|
||||||
|
mov si,offset changing
|
||||||
|
mov ah,13
|
||||||
|
int 47h
|
||||||
|
pop si
|
||||||
|
int 47h
|
||||||
|
mov ah,6
|
||||||
|
int 47h
|
||||||
|
mov si,di
|
||||||
|
mov ah,13
|
||||||
|
int 48h
|
||||||
|
jnc okchange
|
||||||
|
mov si,offset errorchanging
|
||||||
|
mov ah,13
|
||||||
|
int 47h
|
||||||
|
okchange:
|
||||||
|
ret
|
||||||
|
errorchanging db 'Impossible d''atteindre ce dossier',0
|
||||||
|
|
||||||
|
code_refresh:
|
||||||
|
mov ah,3
|
||||||
|
int 48h
|
||||||
|
jnc okrefresh
|
||||||
|
mov si,offset errorrefreshing
|
||||||
|
mov ah,13
|
||||||
|
int 47h
|
||||||
|
ret
|
||||||
|
okrefresh:
|
||||||
|
mov si,offset present
|
||||||
|
mov ah,13
|
||||||
|
int 47h
|
||||||
|
mov ah,11
|
||||||
|
mov di,offset nomdisque
|
||||||
|
int 48h
|
||||||
|
mov si,di
|
||||||
|
mov ah,13
|
||||||
|
int 47h
|
||||||
|
mov si,offset present2
|
||||||
|
mov ah,13
|
||||||
|
int 47h
|
||||||
|
mov ah,12
|
||||||
|
int 48h
|
||||||
|
mov ah,10
|
||||||
|
mov cx,32
|
||||||
|
int 47h
|
||||||
|
mov ah,6
|
||||||
|
int 47h
|
||||||
|
ret
|
||||||
|
errorrefreshing db 'Impossible de lire le support',0
|
||||||
|
|
||||||
|
extcom db '.EXE',0
|
||||||
|
|
||||||
|
commands dw Str_Exit ,Code_Exit ,Syn_Exit ,Help_Exit
|
||||||
|
dw Str_Version,Code_Version,Syn_Version,Help_Version
|
||||||
|
dw Str_Cls ,Code_Cls ,Syn_Cls ,Help_Cls
|
||||||
|
dw Str_Reboot ,Code_Reboot ,Syn_Reboot ,Help_Reboot
|
||||||
|
dw Str_Command,Code_Command,Syn_Command,Help_Command
|
||||||
|
dw Str_Mode ,Code_Mode ,Syn_Mode ,Help_Mode
|
||||||
|
dw Str_Dir ,Code_Dir ,Syn_Dir ,Help_Dir
|
||||||
|
dw Str_refresh ,Code_refresh ,Syn_refresh ,Help_refresh
|
||||||
|
dw Str_cd ,Code_cd ,Syn_cd ,Help_cd
|
||||||
|
dw 0
|
||||||
|
|
||||||
|
Str_Exit db 'QUIT',0
|
||||||
|
Str_Version db 'VERS',0
|
||||||
|
Str_Cls db 'EFFAC',0
|
||||||
|
Str_Reboot db 'REDEM',0
|
||||||
|
Str_Command db 'CMDS',0
|
||||||
|
Str_Mode db 'MODE',0
|
||||||
|
Str_Dir db 'VOIR',0
|
||||||
|
Str_refresh db 'LIRE',0
|
||||||
|
Str_cd db 'CH',0
|
||||||
|
Syn_Exit db 0
|
||||||
|
Syn_Version db 0
|
||||||
|
Syn_Cls db 0
|
||||||
|
Syn_Reboot db 0
|
||||||
|
Syn_Command db 0
|
||||||
|
Syn_Mode db 'FFH',0
|
||||||
|
Syn_Dir db 0
|
||||||
|
Syn_refresh db 0
|
||||||
|
Syn_cd db '@',0
|
||||||
|
Help_Exit db 0
|
||||||
|
Help_Version db 0
|
||||||
|
Help_Cls db 0
|
||||||
|
Help_Reboot db 0
|
||||||
|
Help_Command db 0
|
||||||
|
Help_Mode db 0
|
||||||
|
Help_Dir db 0
|
||||||
|
Help_refresh db 0
|
||||||
|
Help_cd db 0
|
||||||
|
derror db 'Erreur de Syntaxe !',0
|
||||||
|
Error_Syntax db 'La commande ou l''executable n''existe pas ! F1 pour ',0
|
||||||
|
prompt db '>',0
|
||||||
|
msg db 'Interpreteur de commande COS V1.1',0
|
||||||
|
|
||||||
|
include str0.asm
|
||||||
|
|
||||||
|
dir equ $
|
||||||
|
buffer equ $+128
|
||||||
|
buffer2 equ $+128+512
|
||||||
|
vga equ $+128+512+512
|
||||||
|
|
||||||
|
|
||||||
|
end start
|
@ -1,2 +0,0 @@
|
|||||||
@echo off
|
|
||||||
..\util\td %1
|
|
1702
commande/str0.asm
Executable file → Normal file
1702
commande/str0.asm
Executable file → Normal file
File diff suppressed because it is too large
Load Diff
25
commande/test.asm
Normal file
25
commande/test.asm
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
.model tiny
|
||||||
|
.486
|
||||||
|
smart
|
||||||
|
.code
|
||||||
|
|
||||||
|
org 0100h
|
||||||
|
|
||||||
|
start:
|
||||||
|
mov si,offset essai
|
||||||
|
call whatis0
|
||||||
|
|
||||||
|
|
||||||
|
mov si,offset pop1
|
||||||
|
mov di,offset pop2
|
||||||
|
call checksyntax0
|
||||||
|
ret
|
||||||
|
|
||||||
|
essai db '#',0
|
||||||
|
pop1 db 'essai 0FFh',0
|
||||||
|
pop2 db 'ESSAI 012H',0
|
||||||
|
include str0.asm
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
end start
|
@ -1,4 +0,0 @@
|
|||||||
@echo off
|
|
||||||
cd ..
|
|
||||||
setup
|
|
||||||
cd sources
|
|
20
contribs/MAKEFILE
Normal file
20
contribs/MAKEFILE
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
lnk_boot = tlink /x
|
||||||
|
asm= tasm /t/m5/zi
|
||||||
|
lnk= tlink /x/t
|
||||||
|
|
||||||
|
all: ex-tasm.exe ex-nasm.exe
|
||||||
|
|
||||||
|
ex-tasm.exe: ex-tasm.asm
|
||||||
|
$(asm) ex-tasm
|
||||||
|
$(lnk) ex-tasm
|
||||||
|
ren ex-tasm.com ex-tasm.exe
|
||||||
|
|
||||||
|
ex-nasm.exe: ex-nasm.asm
|
||||||
|
nasm ex-nasm.asm -o ex-nasm.exe
|
||||||
|
|
||||||
|
clean:
|
||||||
|
del *.obj
|
||||||
|
del *.exe
|
||||||
|
del *.com
|
||||||
|
del *.sys
|
||||||
|
del *.err
|
14
contribs/ex-nasm.asm
Normal file
14
contribs/ex-nasm.asm
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
[bits 16] ;16 bits
|
||||||
|
[org 0x0100] ;Point d'entré en 0100h
|
||||||
|
section .text ;Segment de code
|
||||||
|
|
||||||
|
start:
|
||||||
|
mov ah,0x0D
|
||||||
|
mov si,msg
|
||||||
|
int 0x47 ;Afficher le texte (Showstring0)
|
||||||
|
xor ax,ax
|
||||||
|
int 0x16 ;Attendre l'appuie sur une touche
|
||||||
|
retf ;retour far
|
||||||
|
|
||||||
|
msg db 'Hello World',0
|
||||||
|
|
19
contribs/ex-tasm.asm
Normal file
19
contribs/ex-tasm.asm
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
.model tiny ;model tiny (.com)
|
||||||
|
.486 ;Pour processeur 80486
|
||||||
|
Smart ;Optimisations
|
||||||
|
.code ;Segment de code
|
||||||
|
|
||||||
|
org 0100h ;Point d'entré en 0100h
|
||||||
|
|
||||||
|
start:
|
||||||
|
mov ah,0Dh
|
||||||
|
mov si,offset msg
|
||||||
|
int 47h ;Afficher le texte (Showstring0)
|
||||||
|
xor ax,ax
|
||||||
|
int 16h ;Attendre l'appuie sur une touche
|
||||||
|
db 0CBH ;retour far
|
||||||
|
|
||||||
|
msg db 'Hello World',0
|
||||||
|
|
||||||
|
end start
|
||||||
|
|
40
include/bmp.h
Normal file
40
include/bmp.h
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
BMP_File struc
|
||||||
|
BMP_FileType db 'BM'
|
||||||
|
BMP_FileSize dd ? ; taille du fichier
|
||||||
|
BMP_Reserved dd 0 ; toujours 0
|
||||||
|
BMP_BitMapOffset dd ? ; offset de l'image
|
||||||
|
BMP_HeaderSize dd ? ; taille de l'entete en octects
|
||||||
|
BMP_Width dd ? ; largeur en pixels de l'image
|
||||||
|
BMP_Height dd ? ; hauteur en pixels de l'image
|
||||||
|
BMP_Planes dw 1 ; nombre de plan utilisés
|
||||||
|
BMP_BitsPerPixel dw ? ; nombre de bits par pixels
|
||||||
|
BMP_Compression dd ? ; méthode de compression
|
||||||
|
BMP_SizeOfBitMap dd ? ; taille de l'image en octects
|
||||||
|
BMP_HorzResolution dd ? ; resolution horizontale 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_ColorsImportant dd ? ; nombre de couleurs importantes masques pour les modes de plus de 8 bits par pixels
|
||||||
|
BMP_RedMask dd ?
|
||||||
|
BMP_GreenMask dd ?
|
||||||
|
BMP_BlueMask dd ?
|
||||||
|
BMP_AlphaMask dd ?
|
||||||
|
BMP_ColorSpaceType dd ?
|
||||||
|
BMP_RedX dd ?
|
||||||
|
BMP_RedY dd ?
|
||||||
|
BMP_RedZ dd ?
|
||||||
|
BMP_GreenX dd ?
|
||||||
|
BMP_GreenY dd ?
|
||||||
|
BMP_GreenZ dd ?
|
||||||
|
BMP_BlueX dd ?
|
||||||
|
BMP_BlueY dd ?
|
||||||
|
BMP_BlueZ dd ?
|
||||||
|
BMP_GammaRed dd ?
|
||||||
|
BMP_GammaGreen dd ?
|
||||||
|
BMP_GammeBlue dd ?
|
||||||
|
BMP_file ends
|
||||||
|
|
||||||
|
;BMP_Compression peut prendre les valeurs suivantes:
|
||||||
|
BMP_COMP_UNCOMP equ 0 ; pas de compression
|
||||||
|
BMP_COMP_RLE8 equ 1 ; 8-bit run length encoding
|
||||||
|
BMP_COMP_RLE4 equ 2 ; 4-bit tun length encoding
|
||||||
|
BMP_COMP_BFE equ 3 ; bitfields encoding
|
After Width: | Height: | Size: 1.9 KiB |
58
include/fat.h
Normal file
58
include/fat.h
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
Free equ 0
|
||||||
|
True equ 1
|
||||||
|
False equ 0
|
||||||
|
|
||||||
|
DPT struc
|
||||||
|
StepRate&HeadUnload db 0DFh ;Vitesse de progression & mont‚e de la tˆte
|
||||||
|
DMAFlag&HeadLoad db 002h ;Etat Dma et temps de descente de la tˆte
|
||||||
|
DelayMotorOff db 025h ;Temps avant extinction moteur
|
||||||
|
BytePerSector db 002h ;Taille des secteurs
|
||||||
|
SectorPerTracks db 000h ;Nombre de secteur par piste
|
||||||
|
InterSectGapLength db 01Bh ;Taille du GAP3 en lecture/‚criture
|
||||||
|
DataLength db 0FFh ;Longueur du transfert de donn‚es
|
||||||
|
InterSectGapLengthF db 054h ;Taille du GAP3 en formatage
|
||||||
|
FormatByte db 0F6h ;Octet de formatage
|
||||||
|
HeadSettlingTime db 000h ;Temps de repos des tˆtes
|
||||||
|
DelayMotorNormSpeed db 008h ;Temps de mont‚e en vitesse du moteur
|
||||||
|
DPT ends
|
||||||
|
|
||||||
|
Entries Struc
|
||||||
|
FileName db 8 dup (0)
|
||||||
|
FilExt db 3 dup (0)
|
||||||
|
FileAttr db 0
|
||||||
|
FileReserved db 0
|
||||||
|
FileTimeCreaMs db 0 ;(*10 ms)
|
||||||
|
FileTimeCrea dw 0
|
||||||
|
FileDateCrea dw 0
|
||||||
|
FileDateAcc dw 0
|
||||||
|
FileNotused dw 0
|
||||||
|
FileTime dw 0
|
||||||
|
FileDate dw 0
|
||||||
|
FileGroup dw 0
|
||||||
|
FileSize dd 0
|
||||||
|
Entries Ends
|
||||||
|
|
||||||
|
BootSector Struc
|
||||||
|
jumper db 0,0,0
|
||||||
|
Vendor db 'COS2000A' ;Fabricant + n°série Formatage
|
||||||
|
SectorSize dw 512 ;octet/secteur
|
||||||
|
SectorsPerCluster db 1 ;secteur/cluster
|
||||||
|
ReservedSectors dw 1 ;secteur reserv‚
|
||||||
|
FatsPerDrive db 2 ;nb de copie de la FAT
|
||||||
|
DirectorySize dw 224 ;taille rep racine
|
||||||
|
SectorsPerDrive dw 2880 ;nb secteur du volume si < 32 még
|
||||||
|
MédiaDescriptor db 0F0h ;Descripteur de média
|
||||||
|
SectorsPerFat dw 9 ;secteur/FAT
|
||||||
|
SectorsPerTrack dw 18 ;secteur/piste
|
||||||
|
HeadsPerDrive dw 2 ;nb de tˆteb de lecture/écriture
|
||||||
|
HiddenSectorsH dw 0 ;nombre de secteur cach‚s
|
||||||
|
HiddenSectorsL dw 0 ;
|
||||||
|
SectorPerDisk2 dd 0 ;Nombre secteur du volume si > 32 Mo+20h ; the number of sectors
|
||||||
|
BootDrive db 0 ;Lecteur de d‚marrage
|
||||||
|
ReservedForNT db 0 ;NA
|
||||||
|
BootSign db 29h ;boot signature 29h
|
||||||
|
SerialNumber dd 01020304h ;no de serie
|
||||||
|
DriveName db 'COS2000 ' ;nom de volume
|
||||||
|
TypeOffAt db 'FAT16 ' ;FAT
|
||||||
|
bootcode db 453 dup (0)
|
||||||
|
BootSector ends
|
19
include/pci.h
Normal file
19
include/pci.h
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
pci Struc
|
||||||
|
vendor dw 0 ;vendor ID (read-only), FFFFh returned if requested device non-existent
|
||||||
|
device dw 0 ;device ID (read-only)
|
||||||
|
command dw 0 ;command register
|
||||||
|
status dw 0 ;status register
|
||||||
|
revision db 0 ;revision ID
|
||||||
|
interface db 0 ;programming interface
|
||||||
|
subclass db 0 ;sub-class
|
||||||
|
class db 0 ;class code
|
||||||
|
cache db 0 ;cache line size
|
||||||
|
timer db 0 ;latency timer
|
||||||
|
typed db 0 ;header type
|
||||||
|
;bits 6-0: header format
|
||||||
|
;00h other
|
||||||
|
;01h PCI-to-PCI bridge
|
||||||
|
;02h PCI-to-CardBus bridge
|
||||||
|
;bit 7: multi-function device
|
||||||
|
result db 0 ;Built-In Self-Test result
|
||||||
|
pci Ends
|
256
include/pol8x16.inc
Normal file
256
include/pol8x16.inc
Normal file
@ -0,0 +1,256 @@
|
|||||||
|
DB 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 07Eh, 081h, 0A5h, 081h, 081h, 0BDh, 099h, 081h, 07Eh, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 07Eh, 0FFh, 0DBh, 0FFh, 0FFh, 0C3h, 0E7h, 0FFh, 07Eh, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 000h, 036h, 07Fh, 07Fh, 07Fh, 07Fh, 03Eh, 01Ch, 008h, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 000h, 008h, 01Ch, 03Eh, 07Fh, 03Eh, 01Ch, 008h, 000h, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 018h, 03Ch, 03Ch, 0E7h, 0E7h, 0E7h, 018h, 018h, 03Ch, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 018h, 03Ch, 07Eh, 0FFh, 0FFh, 07Eh, 018h, 018h, 03Ch, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 000h, 000h, 000h, 018h, 03Ch, 03Ch, 018h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 0FFh, 0FFh, 0FFh, 0FFh, 0FFh, 0E7h, 0C3h, 0C3h, 0E7h, 0FFh, 0FFh, 0FFh, 0FFh, 0FFh, 000h, 000h
|
||||||
|
DB 000h, 000h, 000h, 000h, 03Ch, 066h, 042h, 042h, 066h, 03Ch, 000h, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 0FFh, 0FFh, 0FFh, 0FFh, 0C3h, 099h, 0BDh, 0BDh, 099h, 0C3h, 0FFh, 0FFh, 0FFh, 0FFh, 000h, 000h
|
||||||
|
DB 000h, 000h, 00Fh, 007h, 00Dh, 019h, 03Ch, 066h, 066h, 066h, 03Ch, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 03Ch, 066h, 066h, 066h, 03Ch, 018h, 07Eh, 018h, 018h, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 03Fh, 033h, 03Fh, 030h, 030h, 030h, 070h, 0F0h, 0E0h, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 07Fh, 063h, 07Fh, 063h, 063h, 063h, 067h, 0E7h, 0E6h, 0C0h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 018h, 018h, 0DBh, 03Ch, 0E7h, 03Ch, 0DBh, 018h, 018h, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 040h, 060h, 070h, 07Ch, 07Fh, 07Ch, 070h, 060h, 040h, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 001h, 003h, 007h, 01Fh, 07Fh, 01Fh, 007h, 003h, 001h, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 018h, 03Ch, 07Eh, 018h, 018h, 018h, 07Eh, 03Ch, 018h, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 033h, 033h, 033h, 033h, 033h, 033h, 000h, 033h, 033h, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 07Fh, 0DBh, 0DBh, 0DBh, 07Bh, 01Bh, 01Bh, 01Bh, 01Bh, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 03Eh, 063h, 030h, 01Ch, 036h, 063h, 063h, 036h, 01Ch, 006h, 063h, 03Eh, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 07Fh, 07Fh, 07Fh, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 018h, 03Ch, 07Eh, 018h, 018h, 018h, 07Eh, 03Ch, 018h, 07Eh, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 018h, 03Ch, 07Eh, 018h, 018h, 018h, 018h, 018h, 018h, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 018h, 018h, 018h, 018h, 018h, 018h, 07Eh, 03Ch, 018h, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 000h, 000h, 00Ch, 006h, 07Fh, 006h, 00Ch, 000h, 000h, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 000h, 000h, 018h, 030h, 07Fh, 030h, 018h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 000h, 000h, 000h, 060h, 060h, 060h, 07Fh, 000h, 000h, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 000h, 000h, 024h, 066h, 0FFh, 066h, 024h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 000h, 008h, 01Ch, 01Ch, 03Eh, 03Eh, 07Fh, 07Fh, 000h, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 000h, 07Fh, 07Fh, 03Eh, 03Eh, 01Ch, 01Ch, 008h, 000h, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 010h, 010h, 010h, 010h, 010h, 010h, 010h, 000h, 000h, 010h, 010h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 024h, 024h, 024h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 042h, 042h, 042h, 0FFh, 042h, 042h, 042h, 0FFh, 042h, 042h, 042h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 010h, 07Eh, 090h, 090h, 090h, 07Ch, 012h, 012h, 012h, 0FCh, 010h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 061h, 091h, 092h, 064h, 008h, 010h, 026h, 049h, 089h, 086h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 070h, 088h, 088h, 088h, 050h, 060h, 091h, 08Ah, 084h, 04Ah, 031h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 018h, 018h, 010h, 020h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 006h, 018h, 020h, 040h, 040h, 040h, 040h, 040h, 020h, 018h, 006h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 060h, 018h, 004h, 002h, 002h, 002h, 002h, 002h, 004h, 018h, 060h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 010h, 092h, 054h, 038h, 0FEh, 038h, 054h, 092h, 010h, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 000h, 010h, 010h, 010h, 0FEh, 010h, 010h, 010h, 000h, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 018h, 018h, 010h, 020h, 000h, 000h
|
||||||
|
DB 000h, 000h, 000h, 000h, 000h, 000h, 0FEh, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 018h, 018h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 001h, 001h, 002h, 004h, 008h, 010h, 020h, 040h, 080h, 080h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 03Ch, 042h, 083h, 085h, 089h, 091h, 0A1h, 0C1h, 081h, 042h, 03Ch, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 010h, 030h, 050h, 010h, 010h, 010h, 010h, 010h, 010h, 010h, 07Ch, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 03Ch, 042h, 081h, 001h, 002h, 03Ch, 040h, 080h, 080h, 080h, 0FFh, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 03Ch, 042h, 081h, 001h, 002h, 03Ch, 002h, 001h, 081h, 042h, 03Ch, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 002h, 006h, 00Ah, 012h, 022h, 042h, 082h, 0FFh, 002h, 002h, 002h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 0FFh, 080h, 080h, 080h, 0FCh, 002h, 001h, 001h, 081h, 042h, 03Ch, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 03Ch, 042h, 081h, 080h, 0BCh, 0C2h, 081h, 081h, 081h, 042h, 03Ch, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 0FFh, 081h, 001h, 002h, 004h, 008h, 010h, 010h, 010h, 010h, 010h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 03Ch, 042h, 081h, 081h, 042h, 03Ch, 042h, 081h, 081h, 042h, 03Ch, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 03Ch, 042h, 081h, 081h, 043h, 03Dh, 001h, 001h, 081h, 042h, 03Ch, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 000h, 000h, 000h, 018h, 018h, 000h, 000h, 000h, 018h, 018h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 000h, 000h, 000h, 018h, 018h, 000h, 000h, 000h, 018h, 018h, 010h, 020h, 000h, 000h
|
||||||
|
DB 000h, 002h, 004h, 008h, 010h, 020h, 040h, 020h, 010h, 008h, 004h, 002h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 000h, 000h, 0FEh, 000h, 000h, 000h, 0FEh, 000h, 000h, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 040h, 020h, 010h, 008h, 004h, 002h, 004h, 008h, 010h, 020h, 040h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 038h, 044h, 082h, 082h, 004h, 008h, 010h, 010h, 000h, 010h, 010h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 03Ch, 042h, 081h, 099h, 0A5h, 0A5h, 0A5h, 09Eh, 080h, 041h, 03Eh, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 018h, 024h, 042h, 081h, 081h, 0FFh, 081h, 081h, 081h, 081h, 081h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 0FCh, 042h, 041h, 041h, 042h, 07Ch, 042h, 041h, 041h, 042h, 0FCh, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 03Ch, 042h, 081h, 081h, 080h, 080h, 080h, 080h, 081h, 042h, 03Ch, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 0FCh, 042h, 041h, 041h, 041h, 041h, 041h, 041h, 041h, 042h, 0FCh, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 0FFh, 080h, 080h, 080h, 080h, 0FCh, 080h, 080h, 080h, 080h, 0FFh, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 0FFh, 080h, 080h, 080h, 080h, 0FCh, 080h, 080h, 080h, 080h, 080h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 03Ch, 042h, 081h, 081h, 080h, 09Fh, 081h, 081h, 081h, 042h, 03Ch, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 081h, 081h, 081h, 081h, 081h, 0FFh, 081h, 081h, 081h, 081h, 081h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 038h, 010h, 010h, 010h, 010h, 010h, 010h, 010h, 010h, 010h, 038h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 007h, 002h, 002h, 002h, 002h, 002h, 002h, 082h, 082h, 044h, 038h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 081h, 082h, 084h, 088h, 090h, 0E0h, 090h, 088h, 084h, 082h, 081h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 080h, 080h, 080h, 080h, 080h, 080h, 080h, 080h, 080h, 080h, 0FFh, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 081h, 0C3h, 0A5h, 099h, 099h, 081h, 081h, 081h, 081h, 081h, 081h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 081h, 0C1h, 0A1h, 091h, 089h, 085h, 083h, 081h, 081h, 081h, 081h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 03Ch, 042h, 081h, 081h, 081h, 081h, 081h, 081h, 081h, 042h, 03Ch, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 0FCh, 082h, 081h, 081h, 082h, 0FCh, 080h, 080h, 080h, 080h, 080h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 03Ch, 042h, 081h, 081h, 081h, 081h, 081h, 089h, 085h, 042h, 03Dh, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 0FCh, 082h, 081h, 081h, 082h, 0FCh, 090h, 088h, 084h, 082h, 081h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 03Ch, 042h, 081h, 080h, 040h, 03Ch, 002h, 001h, 081h, 042h, 03Ch, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 0FEh, 092h, 010h, 010h, 010h, 010h, 010h, 010h, 010h, 010h, 010h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 081h, 081h, 081h, 081h, 081h, 081h, 081h, 081h, 081h, 042h, 03Ch, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 081h, 081h, 081h, 081h, 081h, 042h, 042h, 024h, 024h, 018h, 018h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 081h, 081h, 081h, 081h, 081h, 081h, 099h, 099h, 0A5h, 0A5h, 042h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 081h, 081h, 081h, 042h, 024h, 018h, 024h, 042h, 081h, 081h, 081h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 082h, 082h, 082h, 082h, 044h, 028h, 010h, 010h, 010h, 010h, 010h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 0FFh, 001h, 001h, 002h, 004h, 018h, 020h, 040h, 080h, 080h, 0FFh, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 07Eh, 040h, 040h, 040h, 040h, 040h, 040h, 040h, 040h, 040h, 07Eh, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 080h, 080h, 040h, 020h, 010h, 008h, 004h, 002h, 001h, 001h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 07Eh, 002h, 002h, 002h, 002h, 002h, 002h, 002h, 002h, 002h, 07Eh, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 018h, 024h, 042h, 081h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 0FFh, 000h, 000h, 000h
|
||||||
|
DB 000h, 008h, 004h, 002h, 001h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 000h, 000h, 000h, 07Ch, 002h, 002h, 07Eh, 082h, 082h, 07Dh, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 080h, 080h, 080h, 080h, 0BCh, 0C2h, 081h, 081h, 081h, 0C2h, 0BCh, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 000h, 000h, 000h, 03Ch, 042h, 080h, 080h, 080h, 042h, 03Ch, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 001h, 001h, 001h, 001h, 03Dh, 043h, 081h, 081h, 081h, 043h, 03Dh, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 000h, 000h, 000h, 03Ch, 042h, 081h, 0FFh, 080h, 040h, 03Eh, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 00Eh, 011h, 010h, 010h, 0FEh, 010h, 010h, 010h, 010h, 010h, 010h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 000h, 000h, 000h, 03Dh, 043h, 081h, 081h, 043h, 03Dh, 001h, 002h, 07Ch, 000h, 000h
|
||||||
|
DB 000h, 080h, 080h, 080h, 080h, 0BCh, 0C2h, 081h, 081h, 081h, 081h, 081h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 008h, 008h, 000h, 038h, 008h, 008h, 008h, 008h, 008h, 03Eh, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 002h, 002h, 000h, 006h, 002h, 002h, 002h, 002h, 002h, 082h, 044h, 038h, 000h, 000h
|
||||||
|
DB 000h, 080h, 080h, 080h, 080h, 082h, 084h, 088h, 090h, 0A8h, 0C4h, 082h, 000h, 000h, 000h, 000h
|
||||||
|
DB 038h, 008h, 008h, 008h, 008h, 008h, 008h, 008h, 008h, 008h, 008h, 03Eh, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 000h, 000h, 000h, 0ECh, 092h, 092h, 092h, 092h, 092h, 092h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 000h, 000h, 000h, 0B8h, 0C4h, 082h, 082h, 082h, 082h, 082h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 000h, 000h, 000h, 03Ch, 042h, 081h, 081h, 081h, 042h, 03Ch, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 000h, 000h, 000h, 0BCh, 0C2h, 081h, 081h, 081h, 0C2h, 0BCh, 080h, 080h, 000h, 000h
|
||||||
|
DB 000h, 000h, 000h, 000h, 000h, 03Dh, 043h, 081h, 081h, 081h, 043h, 03Dh, 001h, 001h, 000h, 000h
|
||||||
|
DB 000h, 000h, 000h, 000h, 000h, 0BEh, 0C1h, 080h, 080h, 080h, 080h, 080h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 000h, 000h, 000h, 07Eh, 081h, 080h, 07Eh, 001h, 081h, 07Eh, 000h, 000h, 000h, 000h
|
||||||
|
DB 010h, 010h, 010h, 010h, 010h, 0FEh, 010h, 010h, 010h, 010h, 011h, 00Eh, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 000h, 000h, 000h, 081h, 081h, 081h, 081h, 081h, 043h, 03Dh, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 000h, 000h, 000h, 081h, 081h, 081h, 081h, 042h, 024h, 018h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 000h, 000h, 000h, 082h, 082h, 092h, 092h, 092h, 0AAh, 044h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 000h, 000h, 000h, 081h, 042h, 024h, 018h, 024h, 042h, 081h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 000h, 000h, 000h, 081h, 081h, 081h, 081h, 043h, 03Dh, 001h, 002h, 07Ch, 000h, 000h
|
||||||
|
DB 000h, 000h, 000h, 000h, 000h, 0FFh, 002h, 004h, 018h, 020h, 040h, 0FFh, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 004h, 008h, 010h, 010h, 010h, 020h, 010h, 010h, 010h, 008h, 004h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 010h, 010h, 010h, 010h, 000h, 000h, 010h, 010h, 010h, 010h, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 040h, 020h, 010h, 010h, 010h, 008h, 010h, 010h, 010h, 020h, 040h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 070h, 099h, 00Eh, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 000h, 000h, 008h, 01Ch, 036h, 063h, 063h, 07Fh, 000h, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 01Eh, 033h, 061h, 060h, 060h, 061h, 033h, 01Eh, 006h, 003h, 03Eh, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 066h, 066h, 000h, 066h, 066h, 066h, 066h, 066h, 03Bh, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 006h, 00Ch, 018h, 000h, 03Eh, 063h, 07Fh, 060h, 063h, 03Eh, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 008h, 01Ch, 036h, 000h, 03Ch, 006h, 03Eh, 066h, 066h, 03Bh, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 066h, 066h, 000h, 03Ch, 006h, 03Eh, 066h, 066h, 03Bh, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 030h, 018h, 00Ch, 000h, 03Ch, 006h, 03Eh, 066h, 066h, 03Bh, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 01Ch, 036h, 01Ch, 000h, 03Ch, 006h, 03Eh, 066h, 066h, 03Bh, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 000h, 000h, 03Ch, 066h, 060h, 066h, 03Ch, 00Ch, 006h, 03Ch, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 008h, 01Ch, 036h, 000h, 03Eh, 063h, 07Fh, 060h, 063h, 03Eh, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 066h, 066h, 000h, 03Eh, 063h, 07Fh, 060h, 063h, 03Eh, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 030h, 018h, 00Ch, 000h, 03Eh, 063h, 07Fh, 060h, 063h, 03Eh, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 066h, 066h, 000h, 038h, 018h, 018h, 018h, 018h, 03Ch, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 018h, 03Ch, 066h, 000h, 038h, 018h, 018h, 018h, 018h, 03Ch, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 060h, 030h, 018h, 000h, 038h, 018h, 018h, 018h, 018h, 03Ch, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 063h, 063h, 008h, 01Ch, 036h, 063h, 063h, 07Fh, 063h, 063h, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 01Ch, 036h, 01Ch, 000h, 01Ch, 036h, 063h, 063h, 07Fh, 063h, 063h, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 00Ch, 018h, 030h, 000h, 07Fh, 033h, 030h, 03Eh, 030h, 033h, 07Fh, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 000h, 000h, 06Eh, 03Bh, 01Bh, 07Eh, 0D8h, 0DCh, 077h, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 01Fh, 036h, 066h, 066h, 07Fh, 066h, 066h, 066h, 067h, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 008h, 01Ch, 036h, 000h, 03Eh, 063h, 063h, 063h, 063h, 03Eh, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 063h, 063h, 000h, 03Eh, 063h, 063h, 063h, 063h, 03Eh, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 030h, 018h, 00Ch, 000h, 03Eh, 063h, 063h, 063h, 063h, 03Eh, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 018h, 03Ch, 066h, 000h, 066h, 066h, 066h, 066h, 066h, 03Bh, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 030h, 018h, 00Ch, 000h, 066h, 066h, 066h, 066h, 066h, 03Bh, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 063h, 063h, 000h, 063h, 063h, 063h, 063h, 03Fh, 003h, 006h, 03Ch, 000h, 000h, 000h
|
||||||
|
DB 000h, 063h, 063h, 01Ch, 036h, 063h, 063h, 063h, 063h, 036h, 01Ch, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 063h, 063h, 000h, 063h, 063h, 063h, 063h, 063h, 063h, 03Eh, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 018h, 018h, 07Eh, 0C3h, 0C0h, 0C0h, 0C3h, 07Eh, 018h, 018h, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 01Ch, 036h, 032h, 030h, 078h, 030h, 030h, 030h, 073h, 07Eh, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 0C3h, 066h, 03Ch, 018h, 0FFh, 018h, 0FFh, 018h, 018h, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 0FCh, 066h, 066h, 07Ch, 062h, 066h, 06Fh, 066h, 066h, 0F3h, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 00Eh, 01Bh, 018h, 018h, 018h, 07Eh, 018h, 018h, 018h, 018h, 0D8h, 070h, 000h, 000h, 000h
|
||||||
|
DB 000h, 00Ch, 018h, 030h, 000h, 03Ch, 006h, 03Eh, 066h, 066h, 03Bh, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 00Ch, 018h, 030h, 000h, 038h, 018h, 018h, 018h, 018h, 03Ch, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 00Ch, 018h, 030h, 000h, 03Eh, 063h, 063h, 063h, 063h, 03Eh, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 00Ch, 018h, 030h, 000h, 066h, 066h, 066h, 066h, 066h, 03Bh, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 03Bh, 06Eh, 000h, 06Eh, 033h, 033h, 033h, 033h, 033h, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 03Bh, 06Eh, 000h, 063h, 073h, 07Bh, 07Fh, 06Fh, 067h, 063h, 063h, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 03Ch, 06Ch, 06Ch, 03Eh, 000h, 07Eh, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 038h, 06Ch, 06Ch, 038h, 000h, 07Ch, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 018h, 018h, 000h, 018h, 018h, 030h, 063h, 063h, 03Eh, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 000h, 000h, 000h, 000h, 07Fh, 060h, 060h, 060h, 000h, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 000h, 000h, 000h, 000h, 07Fh, 003h, 003h, 003h, 000h, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 060h, 0E0h, 063h, 066h, 06Ch, 018h, 030h, 06Eh, 0C3h, 006h, 00Ch, 01Fh, 000h, 000h, 000h
|
||||||
|
DB 000h, 060h, 0E0h, 063h, 066h, 06Ch, 018h, 033h, 067h, 0CFh, 01Fh, 003h, 003h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 018h, 018h, 000h, 018h, 018h, 03Ch, 03Ch, 03Ch, 018h, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 000h, 000h, 01Bh, 036h, 06Ch, 036h, 01Bh, 000h, 000h, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 000h, 000h, 06Ch, 036h, 01Bh, 036h, 06Ch, 000h, 000h, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 011h, 044h, 011h, 044h, 011h, 044h, 011h, 044h, 011h, 044h, 011h, 044h, 011h, 044h, 000h, 000h
|
||||||
|
DB 055h, 0AAh, 055h, 0AAh, 055h, 0AAh, 055h, 0AAh, 055h, 0AAh, 055h, 0AAh, 055h, 0AAh, 000h, 000h
|
||||||
|
DB 0DDh, 077h, 0DDh, 077h, 0DDh, 077h, 0DDh, 077h, 0DDh, 077h, 0DDh, 077h, 0DDh, 077h, 000h, 000h
|
||||||
|
DB 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 000h, 000h
|
||||||
|
DB 018h, 018h, 018h, 018h, 018h, 018h, 018h, 0F8h, 018h, 018h, 018h, 018h, 018h, 018h, 000h, 000h
|
||||||
|
DB 018h, 018h, 018h, 018h, 018h, 0F8h, 018h, 0F8h, 018h, 018h, 018h, 018h, 018h, 018h, 000h, 000h
|
||||||
|
DB 036h, 036h, 036h, 036h, 036h, 036h, 036h, 0F6h, 036h, 036h, 036h, 036h, 036h, 036h, 000h, 000h
|
||||||
|
DB 000h, 000h, 000h, 000h, 000h, 000h, 000h, 0FEh, 036h, 036h, 036h, 036h, 036h, 036h, 000h, 000h
|
||||||
|
DB 000h, 000h, 000h, 000h, 000h, 0F8h, 018h, 0F8h, 018h, 018h, 018h, 018h, 018h, 018h, 000h, 000h
|
||||||
|
DB 036h, 036h, 036h, 036h, 036h, 0F6h, 006h, 0F6h, 036h, 036h, 036h, 036h, 036h, 036h, 000h, 000h
|
||||||
|
DB 036h, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 000h, 000h
|
||||||
|
DB 000h, 000h, 000h, 000h, 000h, 0FEh, 006h, 0F6h, 036h, 036h, 036h, 036h, 036h, 036h, 000h, 000h
|
||||||
|
DB 036h, 036h, 036h, 036h, 036h, 0F6h, 006h, 0FEh, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 036h, 036h, 036h, 036h, 036h, 036h, 036h, 0FEh, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 018h, 018h, 018h, 018h, 018h, 0F8h, 018h, 0F8h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 000h, 000h, 000h, 000h, 000h, 0F8h, 018h, 018h, 018h, 018h, 018h, 018h, 000h, 000h
|
||||||
|
DB 018h, 018h, 018h, 018h, 018h, 018h, 018h, 01Fh, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 018h, 018h, 018h, 018h, 018h, 018h, 018h, 0FFh, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 000h, 000h, 000h, 000h, 000h, 0FFh, 018h, 018h, 018h, 018h, 018h, 018h, 000h, 000h
|
||||||
|
DB 018h, 018h, 018h, 018h, 018h, 018h, 018h, 01Fh, 018h, 018h, 018h, 018h, 018h, 018h, 000h, 000h
|
||||||
|
DB 000h, 000h, 000h, 000h, 000h, 000h, 000h, 0FFh, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 018h, 018h, 018h, 018h, 018h, 018h, 018h, 0FFh, 018h, 018h, 018h, 018h, 018h, 018h, 000h, 000h
|
||||||
|
DB 018h, 018h, 018h, 018h, 018h, 01Fh, 018h, 01Fh, 018h, 018h, 018h, 018h, 018h, 018h, 000h, 000h
|
||||||
|
DB 036h, 036h, 036h, 036h, 036h, 036h, 036h, 037h, 036h, 036h, 036h, 036h, 036h, 036h, 000h, 000h
|
||||||
|
DB 036h, 036h, 036h, 036h, 036h, 037h, 030h, 03Fh, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 000h, 000h, 000h, 03Fh, 030h, 037h, 036h, 036h, 036h, 036h, 036h, 036h, 000h, 000h
|
||||||
|
DB 036h, 036h, 036h, 036h, 036h, 0F7h, 000h, 0FFh, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 000h, 000h, 000h, 0FFh, 000h, 0F7h, 036h, 036h, 036h, 036h, 036h, 036h, 000h, 000h
|
||||||
|
DB 036h, 036h, 036h, 036h, 036h, 037h, 030h, 037h, 036h, 036h, 036h, 036h, 036h, 036h, 000h, 000h
|
||||||
|
DB 000h, 000h, 000h, 000h, 000h, 0FFh, 000h, 0FFh, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 036h, 036h, 036h, 036h, 036h, 0F7h, 000h, 0F7h, 036h, 036h, 036h, 036h, 036h, 036h, 000h, 000h
|
||||||
|
DB 018h, 018h, 018h, 018h, 018h, 0FFh, 000h, 0FFh, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 036h, 036h, 036h, 036h, 036h, 036h, 036h, 0FFh, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 000h, 000h, 000h, 0FFh, 000h, 0FFh, 018h, 018h, 018h, 018h, 018h, 018h, 000h, 000h
|
||||||
|
DB 000h, 000h, 000h, 000h, 000h, 000h, 000h, 0FFh, 036h, 036h, 036h, 036h, 036h, 036h, 000h, 000h
|
||||||
|
DB 036h, 036h, 036h, 036h, 036h, 036h, 036h, 03Fh, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 018h, 018h, 018h, 018h, 018h, 01Fh, 018h, 01Fh, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 000h, 000h, 000h, 01Fh, 018h, 01Fh, 018h, 018h, 018h, 018h, 018h, 018h, 000h, 000h
|
||||||
|
DB 000h, 000h, 000h, 000h, 000h, 000h, 000h, 03Fh, 036h, 036h, 036h, 036h, 036h, 036h, 000h, 000h
|
||||||
|
DB 036h, 036h, 036h, 036h, 036h, 036h, 036h, 0FFh, 036h, 036h, 036h, 036h, 036h, 036h, 000h, 000h
|
||||||
|
DB 018h, 018h, 018h, 018h, 018h, 0FFh, 018h, 0FFh, 018h, 018h, 018h, 018h, 018h, 018h, 000h, 000h
|
||||||
|
DB 018h, 018h, 018h, 018h, 018h, 018h, 018h, 0F8h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 000h, 000h, 000h, 000h, 000h, 01Fh, 018h, 018h, 018h, 018h, 018h, 018h, 000h, 000h
|
||||||
|
DB 0FFh, 0FFh, 0FFh, 0FFh, 0FFh, 0FFh, 0FFh, 0FFh, 0FFh, 0FFh, 0FFh, 0FFh, 0FFh, 0FFh, 000h, 000h
|
||||||
|
DB 000h, 000h, 000h, 000h, 000h, 000h, 000h, 0FFh, 0FFh, 0FFh, 0FFh, 0FFh, 0FFh, 0FFh, 000h, 000h
|
||||||
|
DB 0F0h, 0F0h, 0F0h, 0F0h, 0F0h, 0F0h, 0F0h, 0F0h, 0F0h, 0F0h, 0F0h, 0F0h, 0F0h, 0F0h, 000h, 000h
|
||||||
|
DB 00Fh, 00Fh, 00Fh, 00Fh, 00Fh, 00Fh, 00Fh, 00Fh, 00Fh, 00Fh, 00Fh, 00Fh, 00Fh, 00Fh, 000h, 000h
|
||||||
|
DB 0FFh, 0FFh, 0FFh, 0FFh, 0FFh, 0FFh, 0FFh, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 000h, 000h, 000h, 03Bh, 06Eh, 06Ch, 06Ch, 06Eh, 03Bh, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 000h, 000h, 03Eh, 063h, 07Eh, 063h, 063h, 07Eh, 060h, 060h, 020h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 07Fh, 063h, 063h, 060h, 060h, 060h, 060h, 060h, 060h, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 000h, 000h, 07Fh, 036h, 036h, 036h, 036h, 036h, 036h, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 07Fh, 063h, 030h, 018h, 00Ch, 018h, 030h, 063h, 07Fh, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 000h, 000h, 000h, 03Fh, 06Ch, 06Ch, 06Ch, 06Ch, 038h, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 000h, 000h, 033h, 033h, 033h, 033h, 03Eh, 030h, 030h, 060h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 000h, 000h, 03Bh, 06Eh, 00Ch, 00Ch, 00Ch, 00Ch, 00Ch, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 07Eh, 018h, 03Ch, 066h, 066h, 066h, 03Ch, 018h, 07Eh, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 01Ch, 036h, 063h, 063h, 07Fh, 063h, 063h, 036h, 01Ch, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 01Ch, 036h, 063h, 063h, 063h, 036h, 036h, 036h, 077h, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 01Eh, 030h, 018h, 00Ch, 03Eh, 066h, 066h, 066h, 03Ch, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 000h, 000h, 000h, 07Eh, 0DBh, 0DBh, 07Eh, 000h, 000h, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 003h, 006h, 07Eh, 0DBh, 0DBh, 0F3h, 07Eh, 060h, 0C0h, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 01Ch, 030h, 060h, 060h, 07Ch, 060h, 060h, 030h, 01Ch, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 000h, 03Eh, 063h, 063h, 063h, 063h, 063h, 063h, 063h, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 000h, 07Fh, 000h, 000h, 07Fh, 000h, 000h, 07Fh, 000h, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 018h, 018h, 018h, 0FFh, 018h, 018h, 018h, 000h, 0FFh, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 030h, 018h, 00Ch, 006h, 00Ch, 018h, 030h, 000h, 07Eh, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 00Ch, 018h, 030h, 060h, 030h, 018h, 00Ch, 000h, 07Eh, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 00Eh, 01Bh, 01Bh, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 000h, 000h
|
||||||
|
DB 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 0D8h, 0D8h, 070h, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 018h, 018h, 000h, 000h, 0FFh, 000h, 000h, 018h, 018h, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 000h, 000h, 03Bh, 06Eh, 000h, 03Bh, 06Eh, 000h, 000h, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 038h, 06Ch, 06Ch, 038h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 000h, 000h, 000h, 000h, 018h, 018h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 000h, 000h, 000h, 000h, 000h, 018h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 00Fh, 00Ch, 00Ch, 00Ch, 00Ch, 00Ch, 0ECh, 06Ch, 03Ch, 01Ch, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 0D8h, 06Ch, 06Ch, 06Ch, 06Ch, 06Ch, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 070h, 0D8h, 030h, 060h, 0C8h, 0F8h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 000h, 000h, 03Eh, 03Eh, 03Eh, 03Eh, 03Eh, 03Eh, 000h, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
|
128
include/pol8x8.inc
Normal file
128
include/pol8x8.inc
Normal file
@ -0,0 +1,128 @@
|
|||||||
|
DB 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 07Eh, 081h, 0A5h, 081h, 0BDh, 099h, 081h, 07Eh
|
||||||
|
DB 07Eh, 0FFh, 0DBh, 0FFh, 0C3h, 0E7h, 0FFh, 07Eh, 06Ch, 0FEh, 0FEh, 0FEh, 07Ch, 038h, 010h, 000h
|
||||||
|
DB 010h, 038h, 07Ch, 0FEh, 07Ch, 038h, 010h, 000h, 038h, 07Ch, 038h, 0FEh, 0FEh, 07Ch, 038h, 07Ch
|
||||||
|
DB 010h, 010h, 038h, 07Ch, 0FEh, 07Ch, 038h, 07Ch, 000h, 000h, 018h, 03Ch, 03Ch, 018h, 000h, 000h
|
||||||
|
DB 0FFh, 0FFh, 0E7h, 0C3h, 0C3h, 0E7h, 0FFh, 0FFh, 000h, 03Ch, 066h, 042h, 042h, 066h, 03Ch, 000h
|
||||||
|
DB 0FFh, 0C3h, 099h, 0BDh, 0BDh, 099h, 0C3h, 0FFh, 00Fh, 007h, 00Fh, 07Dh, 0CCh, 0CCh, 0CCh, 078h
|
||||||
|
DB 03Ch, 066h, 066h, 066h, 03Ch, 018h, 07Eh, 018h, 03Fh, 033h, 03Fh, 030h, 030h, 070h, 0F0h, 0E0h
|
||||||
|
DB 07Fh, 063h, 07Fh, 063h, 063h, 067h, 0E6h, 0C0h, 099h, 05Ah, 03Ch, 0E7h, 0E7h, 03Ch, 05Ah, 099h
|
||||||
|
DB 080h, 0E0h, 0F8h, 0FEh, 0F8h, 0E0h, 080h, 000h, 002h, 00Eh, 03Eh, 0FEh, 03Eh, 00Eh, 002h, 000h
|
||||||
|
DB 018h, 03Ch, 07Eh, 018h, 018h, 07Eh, 03Ch, 018h, 066h, 066h, 066h, 066h, 066h, 000h, 066h, 000h
|
||||||
|
DB 07Fh, 0DBh, 0DBh, 07Bh, 01Bh, 01Bh, 01Bh, 000h, 03Eh, 063h, 038h, 06Ch, 06Ch, 038h, 0CCh, 078h
|
||||||
|
DB 000h, 000h, 000h, 000h, 07Eh, 07Eh, 07Eh, 000h, 018h, 03Ch, 07Eh, 018h, 07Eh, 03Ch, 018h, 0FFh
|
||||||
|
DB 018h, 03Ch, 07Eh, 018h, 018h, 018h, 018h, 000h, 018h, 018h, 018h, 018h, 07Eh, 03Ch, 018h, 000h
|
||||||
|
DB 000h, 018h, 00Ch, 0FEh, 00Ch, 018h, 000h, 000h, 000h, 030h, 060h, 0FEh, 060h, 030h, 000h, 000h
|
||||||
|
DB 000h, 000h, 0C0h, 0C0h, 0C0h, 0FEh, 000h, 000h, 000h, 024h, 066h, 0FFh, 066h, 024h, 000h, 000h
|
||||||
|
DB 000h, 018h, 03Ch, 07Eh, 0FFh, 0FFh, 000h, 000h, 000h, 0FFh, 0FFh, 07Eh, 03Ch, 018h, 000h, 000h
|
||||||
|
DB 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 040h, 040h, 040h, 040h, 040h, 000h, 040h, 000h
|
||||||
|
DB 090h, 090h, 000h, 000h, 000h, 000h, 000h, 000h, 050h, 050h, 0F8h, 050h, 0F8h, 050h, 050h, 000h
|
||||||
|
DB 020h, 078h, 0A0h, 070h, 028h, 0F0h, 020h, 000h, 0C8h, 0C8h, 010h, 020h, 040h, 098h, 098h, 000h
|
||||||
|
DB 070h, 088h, 050h, 020h, 054h, 088h, 074h, 000h, 060h, 020h, 040h, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 020h, 040h, 080h, 080h, 080h, 040h, 020h, 000h, 020h, 010h, 008h, 008h, 008h, 010h, 020h, 000h
|
||||||
|
DB 000h, 020h, 0A8h, 070h, 070h, 0A8h, 020h, 000h, 000h, 000h, 020h, 020h, 0F8h, 020h, 020h, 000h
|
||||||
|
DB 000h, 000h, 000h, 000h, 000h, 060h, 020h, 040h, 000h, 000h, 000h, 000h, 0F8h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 000h, 000h, 000h, 060h, 060h, 000h, 002h, 004h, 008h, 010h, 020h, 040h, 080h, 000h
|
||||||
|
DB 070h, 088h, 098h, 0A8h, 0C8h, 088h, 070h, 000h, 040h, 0C0h, 040h, 040h, 040h, 040h, 0E0h, 000h
|
||||||
|
DB 070h, 088h, 008h, 010h, 020h, 040h, 0F8h, 000h, 070h, 088h, 008h, 010h, 008h, 088h, 070h, 000h
|
||||||
|
DB 008h, 018h, 028h, 048h, 0FCh, 008h, 008h, 000h, 0F8h, 080h, 080h, 0F0h, 008h, 088h, 070h, 000h
|
||||||
|
DB 020h, 040h, 080h, 0F0h, 088h, 088h, 070h, 000h, 0F8h, 008h, 010h, 020h, 040h, 040h, 040h, 000h
|
||||||
|
DB 070h, 088h, 088h, 070h, 088h, 088h, 070h, 000h, 070h, 088h, 088h, 078h, 008h, 008h, 070h, 000h
|
||||||
|
DB 000h, 000h, 060h, 060h, 000h, 060h, 060h, 000h, 000h, 000h, 060h, 060h, 000h, 060h, 060h, 020h
|
||||||
|
DB 010h, 020h, 040h, 080h, 040h, 020h, 010h, 000h, 000h, 000h, 0F8h, 000h, 0F8h, 000h, 000h, 000h
|
||||||
|
DB 080h, 040h, 020h, 010h, 020h, 040h, 080h, 000h, 078h, 084h, 004h, 008h, 010h, 000h, 010h, 000h
|
||||||
|
DB 070h, 088h, 088h, 0A8h, 0B8h, 080h, 078h, 000h, 020h, 050h, 088h, 088h, 0F8h, 088h, 088h, 000h
|
||||||
|
DB 0F0h, 088h, 088h, 0F0h, 088h, 088h, 0F0h, 000h, 070h, 088h, 080h, 080h, 080h, 088h, 070h, 000h
|
||||||
|
DB 0F0h, 088h, 088h, 088h, 088h, 088h, 0F0h, 000h, 0F8h, 080h, 080h, 0E0h, 080h, 080h, 0F8h, 000h
|
||||||
|
DB 0F8h, 080h, 080h, 0E0h, 080h, 080h, 080h, 000h, 070h, 088h, 080h, 080h, 098h, 088h, 078h, 000h
|
||||||
|
DB 088h, 088h, 088h, 0F8h, 088h, 088h, 088h, 000h, 0E0h, 040h, 040h, 040h, 040h, 040h, 0E0h, 000h
|
||||||
|
DB 038h, 010h, 010h, 010h, 010h, 090h, 060h, 000h, 088h, 090h, 0A0h, 0C0h, 0A0h, 090h, 088h, 000h
|
||||||
|
DB 080h, 080h, 080h, 080h, 080h, 080h, 0F8h, 000h, 082h, 0C6h, 0AAh, 092h, 082h, 082h, 082h, 000h
|
||||||
|
DB 084h, 0C4h, 0A4h, 094h, 08Ch, 084h, 084h, 000h, 070h, 088h, 088h, 088h, 088h, 088h, 070h, 000h
|
||||||
|
DB 0F0h, 088h, 088h, 0F0h, 080h, 080h, 080h, 000h, 070h, 088h, 088h, 088h, 0A8h, 090h, 068h, 000h
|
||||||
|
DB 0F0h, 088h, 088h, 0F0h, 0A0h, 090h, 088h, 000h, 070h, 088h, 080h, 070h, 008h, 088h, 070h, 000h
|
||||||
|
DB 0F8h, 020h, 020h, 020h, 020h, 020h, 020h, 000h, 088h, 088h, 088h, 088h, 088h, 088h, 070h, 000h
|
||||||
|
DB 088h, 088h, 088h, 050h, 050h, 020h, 020h, 000h, 082h, 082h, 082h, 082h, 092h, 092h, 06Ch, 000h
|
||||||
|
DB 088h, 088h, 050h, 020h, 050h, 088h, 088h, 000h, 088h, 088h, 088h, 050h, 020h, 020h, 020h, 000h
|
||||||
|
DB 0F8h, 008h, 010h, 020h, 040h, 080h, 0F8h, 000h, 0E0h, 080h, 080h, 080h, 080h, 080h, 0E0h, 000h
|
||||||
|
DB 080h, 040h, 020h, 010h, 008h, 004h, 002h, 000h, 0E0h, 020h, 020h, 020h, 020h, 020h, 0E0h, 000h
|
||||||
|
DB 020h, 050h, 088h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 0F8h, 000h
|
||||||
|
DB 040h, 020h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 070h, 008h, 078h, 088h, 074h, 000h
|
||||||
|
DB 080h, 080h, 0B0h, 0C8h, 088h, 0C8h, 0B0h, 000h, 000h, 000h, 070h, 088h, 080h, 088h, 070h, 000h
|
||||||
|
DB 008h, 008h, 068h, 098h, 088h, 098h, 068h, 000h, 000h, 000h, 070h, 088h, 0F8h, 080h, 070h, 000h
|
||||||
|
DB 030h, 048h, 040h, 0E0h, 040h, 040h, 040h, 000h, 000h, 000h, 034h, 048h, 048h, 038h, 008h, 030h
|
||||||
|
DB 080h, 080h, 0B0h, 0C8h, 088h, 088h, 088h, 000h, 020h, 000h, 060h, 020h, 020h, 020h, 070h, 000h
|
||||||
|
DB 010h, 000h, 030h, 010h, 010h, 010h, 090h, 060h, 080h, 080h, 088h, 090h, 0A0h, 0D0h, 088h, 000h
|
||||||
|
DB 0C0h, 040h, 040h, 040h, 040h, 040h, 0E0h, 000h, 000h, 000h, 0ECh, 092h, 092h, 092h, 092h, 000h
|
||||||
|
DB 000h, 000h, 0B0h, 0C8h, 088h, 088h, 088h, 000h, 000h, 000h, 070h, 088h, 088h, 088h, 070h, 000h
|
||||||
|
DB 000h, 000h, 0B0h, 0C8h, 0C8h, 0B0h, 080h, 080h, 000h, 000h, 068h, 098h, 098h, 068h, 008h, 008h
|
||||||
|
DB 000h, 000h, 0B0h, 0C8h, 080h, 080h, 080h, 000h, 000h, 000h, 078h, 080h, 070h, 008h, 0F0h, 000h
|
||||||
|
DB 040h, 040h, 0E0h, 040h, 040h, 050h, 020h, 000h, 000h, 000h, 088h, 088h, 088h, 098h, 068h, 000h
|
||||||
|
DB 000h, 000h, 088h, 088h, 088h, 050h, 020h, 000h, 000h, 000h, 082h, 082h, 092h, 092h, 06Ch, 000h
|
||||||
|
DB 000h, 000h, 088h, 050h, 020h, 050h, 088h, 000h, 000h, 000h, 088h, 088h, 098h, 068h, 008h, 070h
|
||||||
|
DB 000h, 000h, 0F8h, 010h, 020h, 040h, 0F8h, 000h, 010h, 020h, 020h, 040h, 020h, 020h, 010h, 000h
|
||||||
|
DB 040h, 040h, 040h, 000h, 040h, 040h, 040h, 000h, 040h, 020h, 020h, 010h, 020h, 020h, 040h, 000h
|
||||||
|
DB 076h, 0DCh, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 010h, 038h, 06Ch, 0C6h, 0C6h, 0FEh, 000h
|
||||||
|
DB 03Eh, 060h, 0C0h, 060h, 03Eh, 008h, 004h, 018h, 000h, 048h, 000h, 0CCh, 0CCh, 0CCh, 0CCh, 076h
|
||||||
|
DB 018h, 020h, 000h, 078h, 0CCh, 0FCh, 0C0h, 078h, 010h, 028h, 000h, 078h, 00Ch, 07Ch, 0CCh, 076h
|
||||||
|
DB 000h, 048h, 000h, 078h, 00Ch, 07Ch, 0CCh, 076h, 030h, 008h, 000h, 078h, 00Ch, 07Ch, 0CCh, 076h
|
||||||
|
DB 048h, 030h, 000h, 078h, 00Ch, 07Ch, 0CCh, 076h, 078h, 0CCh, 0C0h, 0CCh, 078h, 010h, 008h, 030h
|
||||||
|
DB 030h, 048h, 084h, 078h, 0CCh, 0FCh, 0C0h, 078h, 000h, 048h, 000h, 078h, 0CCh, 0FCh, 0C0h, 078h
|
||||||
|
DB 030h, 008h, 000h, 078h, 0CCh, 0FCh, 0C0h, 078h, 000h, 048h, 000h, 030h, 030h, 030h, 030h, 030h
|
||||||
|
DB 030h, 048h, 000h, 030h, 030h, 030h, 030h, 030h, 060h, 010h, 000h, 030h, 030h, 030h, 030h, 030h
|
||||||
|
DB 048h, 000h, 030h, 078h, 0CCh, 0CCh, 0FCh, 0CCh, 030h, 048h, 030h, 048h, 084h, 0FCh, 084h, 084h
|
||||||
|
DB 018h, 020h, 000h, 0F8h, 080h, 0F0h, 080h, 0F8h, 000h, 000h, 000h, 066h, 019h, 077h, 088h, 077h
|
||||||
|
DB 000h, 000h, 000h, 00Fh, 014h, 03Eh, 044h, 087h, 030h, 048h, 084h, 078h, 0CCh, 0CCh, 0CCh, 078h
|
||||||
|
DB 000h, 048h, 000h, 078h, 0CCh, 0CCh, 0CCh, 078h, 060h, 010h, 000h, 078h, 0CCh, 0CCh, 0CCh, 078h
|
||||||
|
DB 030h, 048h, 084h, 000h, 0CCh, 0CCh, 0CCh, 076h, 060h, 010h, 000h, 0CCh, 0CCh, 0CCh, 0CCh, 076h
|
||||||
|
DB 048h, 000h, 0CCh, 0CCh, 0CCh, 07Ch, 00Ch, 0F8h, 044h, 000h, 038h, 06Ch, 0C6h, 0C6h, 06Ch, 038h
|
||||||
|
DB 024h, 000h, 066h, 066h, 066h, 066h, 066h, 03Ch, 000h, 008h, 01Ch, 028h, 028h, 01Ch, 008h, 000h
|
||||||
|
DB 01Ch, 022h, 020h, 070h, 020h, 022h, 05Ch, 000h, 044h, 028h, 010h, 010h, 038h, 010h, 038h, 010h
|
||||||
|
DB 0F0h, 088h, 08Ah, 0F7h, 082h, 082h, 083h, 000h, 006h, 008h, 008h, 03Ch, 010h, 010h, 060h, 000h
|
||||||
|
DB 018h, 020h, 000h, 078h, 00Ch, 07Ch, 0CCh, 076h, 018h, 020h, 000h, 030h, 030h, 030h, 030h, 030h
|
||||||
|
DB 018h, 020h, 000h, 078h, 0CCh, 0CCh, 0CCh, 078h, 018h, 020h, 000h, 0CCh, 0CCh, 0CCh, 0CCh, 076h
|
||||||
|
DB 080h, 078h, 004h, 0F8h, 0CCh, 0CCh, 0CCh, 0CCh, 080h, 07Eh, 001h, 0C6h, 0E6h, 0D6h, 0CEh, 0C6h
|
||||||
|
DB 000h, 078h, 00Ch, 07Ch, 0CCh, 076h, 000h, 0FEh, 000h, 078h, 0CCh, 0CCh, 0CCh, 078h, 000h, 0FCh
|
||||||
|
DB 000h, 000h, 018h, 018h, 030h, 060h, 066h, 03Ch, 0FFh, 080h, 080h, 080h, 000h, 000h, 000h, 000h
|
||||||
|
DB 0FFh, 001h, 001h, 001h, 000h, 000h, 000h, 000h, 040h, 0C4h, 048h, 050h, 026h, 049h, 082h, 007h
|
||||||
|
DB 040h, 0C4h, 048h, 050h, 026h, 04Ah, 09Fh, 002h, 000h, 030h, 000h, 030h, 030h, 030h, 030h, 030h
|
||||||
|
DB 000h, 012h, 024h, 048h, 090h, 048h, 024h, 012h, 000h, 048h, 024h, 012h, 009h, 012h, 024h, 048h
|
||||||
|
DB 049h, 000h, 092h, 000h, 049h, 000h, 092h, 000h, 06Dh, 000h, 0B6h, 000h, 06Dh, 000h, 0B6h, 000h
|
||||||
|
DB 0AAh, 055h, 0AAh, 055h, 0AAh, 055h, 0AAh, 055h, 010h, 010h, 010h, 010h, 010h, 010h, 010h, 010h
|
||||||
|
DB 010h, 010h, 010h, 010h, 0F0h, 010h, 010h, 010h, 010h, 010h, 010h, 0F0h, 010h, 0F0h, 010h, 010h
|
||||||
|
DB 028h, 028h, 028h, 028h, 0E8h, 028h, 028h, 028h, 000h, 000h, 000h, 000h, 0F8h, 028h, 028h, 028h
|
||||||
|
DB 000h, 000h, 000h, 0F0h, 010h, 0F0h, 010h, 010h, 028h, 028h, 028h, 0E8h, 008h, 0E8h, 028h, 028h
|
||||||
|
DB 028h, 028h, 028h, 028h, 028h, 028h, 028h, 028h, 000h, 000h, 000h, 0F8h, 008h, 0E8h, 028h, 028h
|
||||||
|
DB 028h, 028h, 028h, 0E8h, 008h, 0F8h, 000h, 000h, 028h, 028h, 028h, 028h, 0F8h, 000h, 000h, 000h
|
||||||
|
DB 010h, 010h, 010h, 0F0h, 010h, 0F0h, 000h, 000h, 000h, 000h, 000h, 000h, 0F0h, 010h, 010h, 010h
|
||||||
|
DB 010h, 010h, 010h, 010h, 01Fh, 000h, 000h, 000h, 010h, 010h, 010h, 010h, 0FFh, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 000h, 000h, 0FFh, 010h, 010h, 010h, 010h, 010h, 010h, 010h, 01Fh, 010h, 010h, 010h
|
||||||
|
DB 000h, 000h, 000h, 000h, 0FFh, 000h, 000h, 000h, 010h, 010h, 010h, 010h, 0FFh, 010h, 010h, 010h
|
||||||
|
DB 010h, 010h, 010h, 01Fh, 010h, 01Fh, 010h, 010h, 028h, 028h, 028h, 028h, 03Fh, 028h, 028h, 028h
|
||||||
|
DB 028h, 028h, 028h, 02Fh, 020h, 03Fh, 000h, 000h, 000h, 000h, 000h, 03Fh, 020h, 02Fh, 028h, 028h
|
||||||
|
DB 028h, 028h, 028h, 0EFh, 000h, 0FFh, 000h, 000h, 000h, 000h, 000h, 0FFh, 000h, 0EFh, 028h, 028h
|
||||||
|
DB 028h, 028h, 028h, 02Fh, 020h, 02Fh, 028h, 028h, 000h, 000h, 000h, 0FFh, 000h, 0FFh, 000h, 000h
|
||||||
|
DB 028h, 028h, 028h, 0EFh, 000h, 0EFh, 028h, 028h, 010h, 010h, 010h, 0FFh, 000h, 0FFh, 000h, 000h
|
||||||
|
DB 028h, 028h, 028h, 028h, 0FFh, 000h, 000h, 000h, 000h, 000h, 000h, 0FFh, 000h, 0FFh, 010h, 010h
|
||||||
|
DB 000h, 000h, 000h, 000h, 0FFh, 028h, 028h, 028h, 028h, 028h, 028h, 028h, 03Fh, 000h, 000h, 000h
|
||||||
|
DB 010h, 010h, 010h, 01Fh, 010h, 01Fh, 000h, 000h, 000h, 000h, 000h, 01Fh, 010h, 01Fh, 010h, 010h
|
||||||
|
DB 000h, 000h, 000h, 000h, 03Fh, 028h, 028h, 028h, 028h, 028h, 028h, 028h, 0FFh, 028h, 028h, 028h
|
||||||
|
DB 010h, 010h, 010h, 0FFh, 010h, 0FFh, 010h, 010h, 010h, 010h, 010h, 010h, 0F0h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 000h, 000h, 01Fh, 010h, 010h, 010h, 0FFh, 0FFh, 0FFh, 0FFh, 0FFh, 0FFh, 0FFh, 0FFh
|
||||||
|
DB 000h, 000h, 000h, 000h, 0FFh, 0FFh, 0FFh, 000h, 0E0h, 0E0h, 0E0h, 0E0h, 0E0h, 0E0h, 0E0h, 0E0h
|
||||||
|
DB 007h, 007h, 007h, 007h, 007h, 007h, 007h, 007h, 0FFh, 0FFh, 0FFh, 0FFh, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 000h, 002h, 034h, 04Ch, 04Ch, 032h, 000h, 05Ch, 022h, 022h, 03Ch, 044h, 044h, 078h
|
||||||
|
DB 07Eh, 042h, 042h, 040h, 040h, 040h, 040h, 040h, 000h, 000h, 002h, 07Ch, 0A8h, 028h, 028h, 044h
|
||||||
|
DB 000h, 07Eh, 061h, 030h, 018h, 008h, 010h, 020h, 000h, 000h, 008h, 07Fh, 088h, 088h, 088h, 070h
|
||||||
|
DB 000h, 000h, 000h, 022h, 044h, 044h, 07Ah, 080h, 000h, 000h, 000h, 07Ch, 010h, 010h, 010h, 010h
|
||||||
|
DB 000h, 01Ch, 008h, 03Eh, 041h, 041h, 041h, 03Eh, 000h, 000h, 038h, 044h, 044h, 07Ch, 044h, 044h
|
||||||
|
DB 03Ch, 066h, 0C3h, 0C3h, 0C3h, 066h, 024h, 066h, 00Ch, 010h, 008h, 01Ch, 022h, 022h, 022h, 01Ch
|
||||||
|
DB 000h, 000h, 000h, 000h, 06Ch, 092h, 092h, 06Ch, 000h, 001h, 01Ah, 026h, 02Ah, 032h, 02Ch, 040h
|
||||||
|
DB 000h, 018h, 020h, 020h, 030h, 020h, 020h, 018h, 000h, 03Ch, 042h, 042h, 042h, 042h, 042h, 042h
|
||||||
|
DB 000h, 000h, 07Eh, 000h, 07Eh, 000h, 07Eh, 000h, 000h, 008h, 008h, 03Eh, 008h, 008h, 000h, 03Eh
|
||||||
|
DB 000h, 010h, 008h, 004h, 008h, 010h, 000h, 03Eh, 000h, 004h, 008h, 010h, 008h, 004h, 000h, 03Eh
|
||||||
|
DB 000h, 006h, 009h, 009h, 008h, 008h, 008h, 000h, 000h, 000h, 008h, 008h, 008h, 048h, 048h, 030h
|
||||||
|
DB 000h, 000h, 008h, 000h, 03Eh, 000h, 008h, 000h, 000h, 060h, 092h, 00Ch, 060h, 092h, 00Ch, 000h
|
||||||
|
DB 060h, 090h, 060h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 030h, 078h, 030h, 000h, 000h
|
||||||
|
DB 000h, 000h, 000h, 000h, 020h, 000h, 000h, 000h, 000h, 003h, 004h, 004h, 0C8h, 028h, 010h, 000h
|
||||||
|
DB 000h, 000h, 000h, 07Ch, 042h, 042h, 042h, 000h, 018h, 024h, 008h, 010h, 03Ch, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h, 000h, 03Eh, 03Eh, 03Eh, 03Eh, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
|
16
install/MAKEFILE
Normal file
16
install/MAKEFILE
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
lnk_boot = tlink /x
|
||||||
|
asm= tasm /t/m5/zi
|
||||||
|
lnk= tlink /x/t
|
||||||
|
|
||||||
|
all: setup.com
|
||||||
|
|
||||||
|
setup.com: setup.asm
|
||||||
|
$(asm) setup
|
||||||
|
$(lnk) setup
|
||||||
|
|
||||||
|
clean:
|
||||||
|
del *.obj
|
||||||
|
del *.exe
|
||||||
|
del *.com
|
||||||
|
del *.sys
|
||||||
|
del *.err
|
620
install/setup.asm
Executable file → Normal file
620
install/setup.asm
Executable file → Normal file
@ -1,456 +1,164 @@
|
|||||||
.model tiny
|
.model tiny
|
||||||
.486
|
.486
|
||||||
smart
|
smart
|
||||||
.code
|
.code
|
||||||
|
|
||||||
org 0100h
|
org 0100h
|
||||||
|
|
||||||
ent equ 32h
|
ent equ 32h
|
||||||
|
|
||||||
start:
|
start:
|
||||||
jmp CopyCOS
|
jmp CopyCOS
|
||||||
|
|
||||||
DiskSectorsPerTrack dw 18
|
Message db 0Dh,0Ah,'COS 2000 V3.02Fr 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,'$'
|
||||||
DiskTracksPerHead dw 80
|
Message2 db 0Dh,0AH,'Creation du secteur de demarrage...',0Dh,0Ah,'$'
|
||||||
DiskHeads dw 2
|
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,'$'
|
||||||
Message db 0Dh,0Ah,'COS 2000b installation program (Celyn Operating System) !!',0Dh,0Ah,'Written By Nico',0Ah,0Dh,'Site online HTTP://WWW.MULTIMANIA.COM/COS2000',0Dh,0AH,'Copyright 2000',0Dh,0AH,'Please insert a floppy disk and press a key...',0Dh,0AH,'Be careful! All the disk is going to be deleted',0Dh,0AH,'$'
|
Ok db 0Dh,0AH,'COS2000 a été correctement installé, veuillez redemarrer votre PC',0Dh,0AH,'$'
|
||||||
Message2 db 0Dh,0AH,'Create boot sector$'
|
files db '*.*',0
|
||||||
systfile db 0Dh,0AH,'Creating file allocation table 16 bits$'
|
boot db 'boot.bin',0
|
||||||
systfile2 db 0Dh,0AH,'Creating file information table 32 bytes$'
|
dat db 'data',0
|
||||||
systfile3 db 0Dh,0AH,'Creating operating system files',0Dh,0Ah,'$'
|
retu db 0Dh,0AH,'$'
|
||||||
systfile4 db 0D,0Ah,'Creating system tools',0Dh,0Ah,'$'
|
dta db 43 dup (0)
|
||||||
Errormsg db 0Dh,0AH,0Dh,0AH,'Installing error, please contact me at COS2000@MULTIMANIA.COM !',0Dh,0AH,'$'
|
|
||||||
Ok db 0Dh,0AH,0Dh,0AH,'The boot sector and the system files had been succefully copied.',0Dh,0AH, 'To try COS reboot with this system disk',0Dh,0AH,'$'
|
copycos:
|
||||||
files db '*.*',0
|
mov ah,9
|
||||||
tools db '*.exe',0
|
mov dx,offset message
|
||||||
allboot db 0dh,0ah
|
int 21h
|
||||||
boot db 'boot.bin',0,' $'
|
xor ax,ax
|
||||||
retu db 0Dh,0AH,'$'
|
int 16h
|
||||||
dat db 'data',0
|
mov ah,4ah
|
||||||
dat2 db '..',0
|
mov bx,1000h
|
||||||
dta db 43 dup (0)
|
int 21h
|
||||||
|
jc error
|
||||||
copycos:
|
mov ah,48h
|
||||||
mov ah,4ah
|
mov bx,65536/16
|
||||||
mov bx,1000h
|
int 21h
|
||||||
int 21h
|
jc error
|
||||||
jc error
|
mov fs,ax
|
||||||
mov ah,48h
|
mov ah,3Bh
|
||||||
mov bx,65536/16
|
mov dx,offset dat
|
||||||
int 21h
|
int 21h
|
||||||
jc error
|
jc error
|
||||||
mov fs,ax
|
mov ah,1Ah
|
||||||
mov ah,3Bh
|
mov dx,offset dta
|
||||||
mov dx,offset dat
|
int 21h
|
||||||
int 21h
|
jc error
|
||||||
mov ah,9
|
mov ah,4eh
|
||||||
mov dx,offset message
|
xor cx,cx
|
||||||
int 21h
|
mov dx,offset files
|
||||||
jc error
|
int 21h
|
||||||
mov ax,0
|
jc error
|
||||||
int 16h
|
mov ah,09
|
||||||
mov ah,9
|
mov dx,offset message3
|
||||||
mov dx,offset systfile
|
int 21h
|
||||||
int 21h
|
allfile:
|
||||||
jc error
|
mov byte ptr [offset dta+43],'$'
|
||||||
mov cx,12
|
mov ah,9
|
||||||
mov bx,offset fat
|
mov dx,offset dta+30
|
||||||
erase:
|
int 21h
|
||||||
call writesector
|
push dx
|
||||||
jc error
|
mov ah,09
|
||||||
dec cx
|
mov dx,offset retu
|
||||||
jnz erase
|
int 21h
|
||||||
mov ah,9
|
pop dx
|
||||||
mov dx,offset message2
|
mov ax,3D00h
|
||||||
int 21h
|
int 21h
|
||||||
jc error
|
jc error
|
||||||
mov dx,Offset allboot
|
mov bx,ax
|
||||||
int 21h
|
mov ax,4202h
|
||||||
jc error
|
xor cx,cx
|
||||||
mov dx,offset boot
|
xor dx,dx
|
||||||
call addfile
|
int 21h
|
||||||
jc error
|
jc error
|
||||||
mov ax,0F0FFh
|
cmp dx,0
|
||||||
mov cx,14
|
jne error
|
||||||
mov di,offset fat
|
cmp ax,0
|
||||||
cld
|
je error
|
||||||
rep stosw
|
mov bp,ax
|
||||||
mov bx,offset fat
|
mov ax,4200h
|
||||||
mov cx,1
|
xor cx,cx
|
||||||
call writesector
|
xor dx,dx
|
||||||
jc error
|
int 21h
|
||||||
mov ah,9
|
jc error
|
||||||
mov dx,offset systfile2
|
push fs
|
||||||
int 21h
|
pop ds
|
||||||
jc error
|
mov ah,3fh
|
||||||
mov eax,0
|
mov cx,0FFFFh
|
||||||
mov cx,512/4
|
xor dx,dx
|
||||||
mov di,offset fat
|
int 21h
|
||||||
cld
|
push cs
|
||||||
rep stosd
|
pop ds
|
||||||
mov bx,offset fat
|
jc error
|
||||||
mov cx,13
|
mov ah,3eh
|
||||||
call writesector
|
int 21h
|
||||||
jc error
|
jc error
|
||||||
mov ah,1Ah
|
mov ah,3ch
|
||||||
mov dx,offset dta
|
push cs
|
||||||
int 21h
|
pop es
|
||||||
jc error
|
mov di,offset dta+30-3
|
||||||
mov ah,4eh
|
mov word ptr [di],":a"
|
||||||
xor cx,cx
|
mov byte ptr [di+2],"\"
|
||||||
mov dx,offset files
|
xor cx,cx
|
||||||
int 21h
|
mov dx,di
|
||||||
mov ah,9
|
int 21h
|
||||||
mov dx,offset systfile3
|
jc error
|
||||||
int 21h
|
mov bx,ax
|
||||||
jc error
|
push fs
|
||||||
allfile:
|
pop ds
|
||||||
mov di,offset dta+43
|
xor dx,dx
|
||||||
mov byte ptr [di],'$'
|
mov ah,40h
|
||||||
mov ah,9
|
mov cx,bp
|
||||||
mov si,offset dta+30
|
int 21h
|
||||||
mov cl,13
|
push cs
|
||||||
call uppercasemem
|
pop ds
|
||||||
mov dx,si
|
jc error
|
||||||
cmp dword ptr [si],'toob'
|
mov ah,3eh
|
||||||
clc
|
int 21h
|
||||||
je allfilesend
|
jc error
|
||||||
int 21h
|
mov ah,4fh
|
||||||
jc error
|
int 21h
|
||||||
call addfile
|
jnc allfile
|
||||||
jc error
|
mov ah,09
|
||||||
call makefit
|
mov dx,offset message2
|
||||||
jc error
|
int 21h
|
||||||
mov ah,9
|
mov ax,3D00h
|
||||||
mov dx,offset retu
|
mov dx,offset boot
|
||||||
int 21h
|
int 21h
|
||||||
jc error
|
jc error
|
||||||
mov di,offset dta+30
|
push fs
|
||||||
mov al,0
|
pop ds
|
||||||
mov cl,13
|
mov ah,3fh
|
||||||
cld
|
mov cx,000FFh
|
||||||
rep stosb
|
xor dx,dx
|
||||||
allfilesend:
|
int 21h
|
||||||
mov ah,4fh
|
push cs
|
||||||
int 21h
|
pop ds
|
||||||
jnc allfile
|
jc error
|
||||||
mov ah,9
|
mov ah,3eh
|
||||||
mov dx,Offset ok
|
int 21h
|
||||||
int 21h
|
jc error
|
||||||
mov ah,3Bh
|
push fs
|
||||||
mov dx,offset dat2
|
pop es
|
||||||
int 21h
|
mov ax,0301h
|
||||||
ret
|
mov dx,0
|
||||||
|
mov cx,0001h
|
||||||
error:
|
xor bx,bx
|
||||||
mov ah,3Bh
|
int 13h
|
||||||
mov dx,offset dat2
|
mov ah,09
|
||||||
int 21h
|
mov dx,offset Ok
|
||||||
mov ah,9
|
int 21h
|
||||||
mov dx,offset errormsg
|
xor ax,ax
|
||||||
int 21h
|
int 16h
|
||||||
ret
|
ret
|
||||||
|
|
||||||
addfile:
|
|
||||||
push ax bx dx si di bp ds es
|
error:
|
||||||
mov cx,1
|
mov ah,09
|
||||||
mov bx,offset fat
|
mov dx,offset errormsg
|
||||||
call readsector
|
int 21h
|
||||||
jc error2
|
xor ax,ax
|
||||||
mov ax,3D00h
|
int 16h
|
||||||
int 21h
|
ret
|
||||||
jc error2
|
|
||||||
mov cs:temp,ax
|
end start
|
||||||
mov bx,ax
|
|
||||||
mov ax,4202h
|
|
||||||
xor cx,cx
|
|
||||||
xor dx,dx
|
|
||||||
int 21h
|
|
||||||
jc error2
|
|
||||||
cmp dx,0
|
|
||||||
jne error2
|
|
||||||
cmp ax,0
|
|
||||||
je error2
|
|
||||||
sub ax,1
|
|
||||||
shr ax,9
|
|
||||||
inc ax
|
|
||||||
mov bp,ax
|
|
||||||
mov ax,4200h
|
|
||||||
xor cx,cx
|
|
||||||
xor dx,dx
|
|
||||||
int 21h
|
|
||||||
jc error2
|
|
||||||
push fs
|
|
||||||
pop ds
|
|
||||||
push fs
|
|
||||||
pop es
|
|
||||||
mov ah,3fh
|
|
||||||
mov cx,0FFFFh
|
|
||||||
xor dx,dx
|
|
||||||
int 21h
|
|
||||||
push cs
|
|
||||||
pop ds
|
|
||||||
jc error2
|
|
||||||
mov si,-2
|
|
||||||
mov di,0
|
|
||||||
xor bx,bx
|
|
||||||
fats:
|
|
||||||
add si,2
|
|
||||||
cmp si,512
|
|
||||||
jz error2
|
|
||||||
cmp WORD PTR [si+offset fat],0h
|
|
||||||
jne fats
|
|
||||||
mov ax,si
|
|
||||||
shr ax,1
|
|
||||||
cmp di,0
|
|
||||||
jne nonew
|
|
||||||
mov entrie,ax
|
|
||||||
jmp new
|
|
||||||
nonew:
|
|
||||||
mov [offset fat+di],ax
|
|
||||||
new:
|
|
||||||
mov di,si
|
|
||||||
mov cx,ax
|
|
||||||
call writesector
|
|
||||||
jc error2
|
|
||||||
add bx,512
|
|
||||||
dec bp
|
|
||||||
jnz fats
|
|
||||||
mov word ptr [offset fat+di],0FFFFh
|
|
||||||
mov bx,offset fat
|
|
||||||
mov cx,1
|
|
||||||
push cs
|
|
||||||
pop es
|
|
||||||
call writesector
|
|
||||||
mov cx,entrie
|
|
||||||
end1:
|
|
||||||
mov ah,3eh
|
|
||||||
mov bx,cs:temp
|
|
||||||
int 21h
|
|
||||||
errorend:
|
|
||||||
pop es ds bp di si dx bx ax
|
|
||||||
ret
|
|
||||||
entrie dw 0
|
|
||||||
error2:
|
|
||||||
mov ah,3eh
|
|
||||||
mov bx,cs:temp
|
|
||||||
int 21h
|
|
||||||
stc
|
|
||||||
jmp errorend
|
|
||||||
temp dw 0
|
|
||||||
|
|
||||||
makefit:
|
|
||||||
push bx cx si di bp
|
|
||||||
mov ax,cx
|
|
||||||
mov bx,offset fat
|
|
||||||
mov cx,13
|
|
||||||
retry:
|
|
||||||
call readsector
|
|
||||||
jc error3
|
|
||||||
xor si,si
|
|
||||||
findfit:
|
|
||||||
cmp byte ptr [si+bx],0
|
|
||||||
je finishfit
|
|
||||||
add si,32
|
|
||||||
cmp si,512
|
|
||||||
jb findfit
|
|
||||||
inc cx
|
|
||||||
jmp retry
|
|
||||||
finishfit:
|
|
||||||
mov di,si
|
|
||||||
add di,bx
|
|
||||||
mov si,dx
|
|
||||||
call asciiztofit
|
|
||||||
jc error3
|
|
||||||
mov [di+26],ax
|
|
||||||
call writesector
|
|
||||||
jc error3
|
|
||||||
end3:
|
|
||||||
pop bp di si cx bx
|
|
||||||
ret
|
|
||||||
error3:
|
|
||||||
stc
|
|
||||||
jmp end3
|
|
||||||
|
|
||||||
WriteSector:
|
|
||||||
push cx dx si
|
|
||||||
mov AX, CX
|
|
||||||
xor DX, DX
|
|
||||||
div DiskSectorsPerTrack
|
|
||||||
mov CL, DL ;{ Set the sector }
|
|
||||||
and CL, 63 ;{ Top two bits are bits 8&9 of the cylinder }
|
|
||||||
xor DX, DX
|
|
||||||
div DiskTracksPerHead
|
|
||||||
mov CH, DL ;{ Set the track bits 0-7 }
|
|
||||||
mov AL, DH
|
|
||||||
ror AL, 1
|
|
||||||
ror AL, 1
|
|
||||||
and AL, 11000000b
|
|
||||||
or CL, AL ;{ Set bits 8&9 of track }
|
|
||||||
xor DX, DX
|
|
||||||
div DiskHeads
|
|
||||||
mov DH, DL ;{ Set the head }
|
|
||||||
inc CL
|
|
||||||
mov SI, 4
|
|
||||||
TryAgain:
|
|
||||||
mov AL, 1
|
|
||||||
mov DL, 0
|
|
||||||
mov AH, 3
|
|
||||||
int 13h
|
|
||||||
jnc Done
|
|
||||||
dec SI
|
|
||||||
jnz TryAgain
|
|
||||||
Done:
|
|
||||||
jc enddd
|
|
||||||
mov cl, AH
|
|
||||||
mov ah,9
|
|
||||||
mov dx,offset sign
|
|
||||||
int 21h
|
|
||||||
cmp cl,0
|
|
||||||
enddd:
|
|
||||||
pop si dx cx
|
|
||||||
ret
|
|
||||||
|
|
||||||
ReadSector:
|
|
||||||
push ax cx dx si
|
|
||||||
mov AX, CX
|
|
||||||
xor DX, DX
|
|
||||||
div cs:DiskSectorsPerTrack
|
|
||||||
mov CL, DL ;{ Set the sector }
|
|
||||||
and CL, 63 ;{ Top two bits are bits 8&9 of the cylinder }
|
|
||||||
xor DX, DX
|
|
||||||
div cs:DiskTracksPerHead
|
|
||||||
mov CH, DL ;{ Set the track bits 0-7 }
|
|
||||||
mov AL, DH
|
|
||||||
ror AL, 1
|
|
||||||
ror AL, 1
|
|
||||||
and AL, 11000000b
|
|
||||||
or CL, AL ;{ Set bits 8&9 of track }
|
|
||||||
xor dX, DX
|
|
||||||
div cs:DiskHeads
|
|
||||||
mov DH, DL ;{ Set the head }
|
|
||||||
inc CL
|
|
||||||
mov SI, 4
|
|
||||||
TryAgain2:
|
|
||||||
mov AL, 1
|
|
||||||
mov DL, 0
|
|
||||||
mov AH, 2
|
|
||||||
int 13h
|
|
||||||
jnc Done2
|
|
||||||
dec SI
|
|
||||||
jnz TryAgain2
|
|
||||||
Done2:
|
|
||||||
pop si dx cx ax
|
|
||||||
ret
|
|
||||||
|
|
||||||
;->name ds:si ->es:di
|
|
||||||
AsciiZtoFit:
|
|
||||||
push ax bx cx dx si di ds es
|
|
||||||
xor bx,bx
|
|
||||||
mov dx,di
|
|
||||||
noextens:
|
|
||||||
mov al,[si+bx]
|
|
||||||
cmp al,'.'
|
|
||||||
je extens
|
|
||||||
call Issystchar
|
|
||||||
jc errortranslate
|
|
||||||
mov es:[di],al
|
|
||||||
inc di
|
|
||||||
inc bx
|
|
||||||
cmp bx,namesize ;(.)
|
|
||||||
jne noextens
|
|
||||||
erro:
|
|
||||||
stc
|
|
||||||
jmp errortranslate
|
|
||||||
extens:
|
|
||||||
add si,bx
|
|
||||||
inc si
|
|
||||||
sub bx,namesize
|
|
||||||
neg bx
|
|
||||||
mov al,0
|
|
||||||
mov cx,bx
|
|
||||||
cld
|
|
||||||
rep stosb
|
|
||||||
xor bx,bx
|
|
||||||
wasextens:
|
|
||||||
mov al,[si+bx]
|
|
||||||
cmp al,0
|
|
||||||
je endextens
|
|
||||||
call Issystchar
|
|
||||||
jc errortranslate
|
|
||||||
mov es:[di],al
|
|
||||||
inc di
|
|
||||||
inc bx
|
|
||||||
cmp bx,extsize
|
|
||||||
jne wasextens
|
|
||||||
jmp erro
|
|
||||||
endextens:
|
|
||||||
sub bx,extsize
|
|
||||||
neg bx
|
|
||||||
mov al,0
|
|
||||||
mov cx,bx
|
|
||||||
cld
|
|
||||||
rep stosb
|
|
||||||
mov si,dx
|
|
||||||
mov di,dx
|
|
||||||
push es
|
|
||||||
pop ds
|
|
||||||
mov cx,extsize+namesize
|
|
||||||
call uppercaseMEM
|
|
||||||
clc
|
|
||||||
endtranslate:
|
|
||||||
pop es ds di si dx cx bx ax
|
|
||||||
ret
|
|
||||||
errortranslate:
|
|
||||||
stc
|
|
||||||
jmp endtranslate
|
|
||||||
|
|
||||||
;Carry si al = caractŠre systŠme
|
|
||||||
isSystchar:
|
|
||||||
push di
|
|
||||||
mov di,offset exeptchar
|
|
||||||
isexcept:
|
|
||||||
cmp al,cs:[di]
|
|
||||||
je nogood
|
|
||||||
inc di
|
|
||||||
cmp byte ptr cs:[di],0
|
|
||||||
jne isexcept
|
|
||||||
endanal:
|
|
||||||
pop di
|
|
||||||
ret
|
|
||||||
exeptchar db '/\<>:|.',01,0,0
|
|
||||||
nogood:
|
|
||||||
stc
|
|
||||||
jmp endanal
|
|
||||||
|
|
||||||
;Transforme les x caractŠres de la mem en ds:si en maj
|
|
||||||
uppercaseMEM:
|
|
||||||
push si di cx ax
|
|
||||||
mov di,si
|
|
||||||
uppercaser:
|
|
||||||
mov al,ds:[si]
|
|
||||||
inc si
|
|
||||||
cmp al,'A'
|
|
||||||
jb nonmaj
|
|
||||||
cmp al,'Z'
|
|
||||||
ja nonmaj
|
|
||||||
add al,'a'-'A'
|
|
||||||
nonmaj:
|
|
||||||
mov es:[di],al
|
|
||||||
inc di
|
|
||||||
dec cx
|
|
||||||
jnz uppercaser
|
|
||||||
enduppercase:
|
|
||||||
clc
|
|
||||||
pop ax cx di si
|
|
||||||
ret
|
|
||||||
|
|
||||||
namesize equ 12
|
|
||||||
extsize equ 5
|
|
||||||
|
|
||||||
sign db '.$'
|
|
||||||
fat DB 512 dup (0)
|
|
||||||
buffer db 0
|
|
||||||
|
|
||||||
end start
|
|
||||||
|
266
noyau/8237.asm
Normal file
266
noyau/8237.asm
Normal file
@ -0,0 +1,266 @@
|
|||||||
|
;****************************************************************
|
||||||
|
; *
|
||||||
|
; Periph‚rique : DMA *
|
||||||
|
; Plages Entr‚es-Sorties : 0000-000F *
|
||||||
|
; 00C0-00DF *
|
||||||
|
; 0080-0090 *
|
||||||
|
; (0094-009F) *
|
||||||
|
; Plages M‚moires : AUCUNES *
|
||||||
|
; *
|
||||||
|
DmaRead equ 044h ;I/O to memory, no autoinit, increment, single mode
|
||||||
|
DmaWrite equ 048h ;Memory to I/O, no autoinit, increment, single mode
|
||||||
|
|
||||||
|
;Lecture des bits du registre d'‚tat (08, D0 )
|
||||||
|
STATUS_REQ3 = 80h ;Bit actif: le canal DMA concern‚
|
||||||
|
STATUS_REQ2 = 40h ;re‡oit une requˆte DMA
|
||||||
|
STATUS_REQ1 = 20h ;Request
|
||||||
|
STATUS_REQ0 = 10h
|
||||||
|
STATUS_TC3 = 08h ;Bit actif: Un transfert DMA a ‚t‚
|
||||||
|
STATUS_TC2 = 04h ;ex‚cut‚ depuis la derniŠre lecture
|
||||||
|
STATUS_TC1 = 02h ;du registre d'‚tat.
|
||||||
|
STATUS_TC0 = 01h ;Terminal Count
|
||||||
|
|
||||||
|
;Ecriture des bits du registre de commande (08, D0)
|
||||||
|
COMMAND_DACKLEVEL = 80h ;Bit 7 actif: ligne DMA Acknowledge HIGH active
|
||||||
|
COMMAND_DREQLEVEL = 40h ;Bit 6 actif: ligne REQ Acknowledge LOW active
|
||||||
|
COMMAND_EXTWRITE = 20h ;Bit 5 actif: EXTENDED Write,sinon LATE Write
|
||||||
|
COMMAND_FIXEDPRI = 10h ;Bit 4 actif: priorit‚ constante
|
||||||
|
COMMAND_COMPRESS = 08h ;Bit 3 actif: compression
|
||||||
|
COMMAND_INACTIVE = 04h ;Bit 2 actif: contr“leur d‚sactiv‚
|
||||||
|
COMMAND_ADH0 = 02h ;Bit 1 actif: Adress Hold pour canal 0/4 d‚sactiv‚
|
||||||
|
COMMAND_MEM2MEM = 01h ;Bit 0 actif: m‚moire/m‚moire, sinon m‚moire/p‚riph‚rie
|
||||||
|
|
||||||
|
;Ecriture des bits du registre de requˆte ( 09, D2 )
|
||||||
|
REQUEST_RESERVED = 0F8h ;R‚glage des bits r‚serv‚s =0
|
||||||
|
REQUEST_SET = 04h ;D‚finir requˆte DMA
|
||||||
|
REQUEST_CLR = 00h ;Supprimer requˆte DMA
|
||||||
|
REQUEST_MSK = 03h ;Indiquer le canal dans les deux bits du bas
|
||||||
|
|
||||||
|
;Ecriture des bits du registre de masquage de canal ( 0A, D4 )
|
||||||
|
CHANNEL_RESERVED = 0F8h ;R‚glage des bits r‚serv‚s =0
|
||||||
|
CHANNEL_SET = 04h ;Masquer/verrouiller canal DMA
|
||||||
|
CHANNEL_CLR = 00h ;Lib‚rer canal DMA
|
||||||
|
CHANNEL_MSK = 03h ;Indiquer le canal dans les deux bits du bas
|
||||||
|
|
||||||
|
;Ecriture des bits du registre de mode (0B,D6)
|
||||||
|
MODE_DEMAND = 00h ;Transf‚rer … la demande
|
||||||
|
MODE_SINGLE = 40h ;Transf‚rer valeurs uniques
|
||||||
|
MODE_BLOCK = 80h ;Transf‚rer en bloc
|
||||||
|
MODE_CASCADE = 0C0h ;Transf‚rer en cascade
|
||||||
|
MODE_DECREMENT = 20h ;D‚cr‚menter
|
||||||
|
MODE_AUTOINIT = 10h ;Autoinitialisation vers la fin
|
||||||
|
MODE_VERIFY = 00h ;V‚rifier
|
||||||
|
MODE_WRITE = 04h ;Ecrire dans la m‚moire
|
||||||
|
MODE_READ = 08h ;Lire depuis la m‚moire
|
||||||
|
MODE_INVALID = 0Ch ;Incorrect
|
||||||
|
MODE_CHANNELMSK = 03h ;Indiquer le canal dans les deux bits du bas
|
||||||
|
|
||||||
|
;Ports du DMA esclave
|
||||||
|
|
||||||
|
DmaStatusS dw 08h ;R SLAVE Registre d'‚tat
|
||||||
|
DmaCommandS dw 08h ;W SLAVE Registre de commande
|
||||||
|
DmaRequestS dw 09h ;W SLAVE Ex‚cuter requˆte DMA
|
||||||
|
DmachMaskS dw 0ah ;W SLAVE Masquer canaux
|
||||||
|
DmaModeS dw 0bh ;W SLAVE Mode de transfert
|
||||||
|
DmaFlipFlopS dw 0ch ;W SLAVE Flipflop adr/compteur
|
||||||
|
DmaTempS dw 0dh ;R SLAVE Reset du contr“leur
|
||||||
|
DmaClearS dw 0dh ;R SLAVE Registre temporaire
|
||||||
|
DmaMaskClrS dw 0eh ;R SLAVE Lib‚rer canaux
|
||||||
|
DmaMaskS dw 0fh ;R SLAVE Masquer canaux
|
||||||
|
|
||||||
|
;Ports du DMA esclave
|
||||||
|
|
||||||
|
DmaStatusM dw 0D0h ;R MASTER Registre d'‚tat
|
||||||
|
DmaCommandM dw 0D0h ;W MASTER Registre de commande
|
||||||
|
DmaRequestM dw 0D2h ;W MASTER Ex‚cuter requˆte DMA
|
||||||
|
DmaMaskM dw 0D4h ;W MASTER Masquer canaux
|
||||||
|
DmaModeM dw 0D6h ;W MASTER Mode de transfert
|
||||||
|
DmaFlipFlopM dw 0D8h ;W MASTER Flipflop adr/compteur
|
||||||
|
DmaTempM dw 0DAh ;R MASTER Reset du contr“leur
|
||||||
|
DmaClearM dw 0DAh ;R MASTER Registre temporaire
|
||||||
|
DmaMaskClrM dw 0DCh ;R MASTER Lib‚rer canaux
|
||||||
|
DmaMaskM2 dw 0DEh ;R MASTER Masquer canaux
|
||||||
|
|
||||||
|
DmaAdress db 00h ;DMA address register 0
|
||||||
|
db 002h ;DMA address register 1
|
||||||
|
db 004h ;DMA address register 2
|
||||||
|
db 006h ;DMA address register 3
|
||||||
|
db 0c0h ;DMA address register 4
|
||||||
|
db 0c4h ;DMA address register 5
|
||||||
|
db 0c8h ;DMA address register 6
|
||||||
|
db 0cch ;DMA address register 7
|
||||||
|
|
||||||
|
DmaCount db 001h ;DMA count registers 0
|
||||||
|
db 003h ;DMA count registers 1
|
||||||
|
db 005h ;DMA count registers 2
|
||||||
|
db 007h ;DMA count registers 3
|
||||||
|
db 0c2h ;DMA count registers 4
|
||||||
|
db 0c6h ;DMA count registers 5
|
||||||
|
db 0cah ;DMA count registers 6
|
||||||
|
db 0ceh ;DMA count registers 7
|
||||||
|
|
||||||
|
DmaPage db 087h ;DMA page registers 0
|
||||||
|
db 083h ;DMA page registers 1
|
||||||
|
db 081h ;DMA page registers 2
|
||||||
|
db 082h ;DMA page registers 3
|
||||||
|
db 08fh ;DMA page registers 4
|
||||||
|
db 08bh ;DMA page registers 5
|
||||||
|
db 089h ;DMA page registers 6
|
||||||
|
db 08ah ;DMA page registers 7
|
||||||
|
|
||||||
|
;verouille le canal AL
|
||||||
|
DisableDma:
|
||||||
|
push ax dx
|
||||||
|
cmp al, 4
|
||||||
|
jae MasterDisableDma
|
||||||
|
mov dx, DmaMaskS
|
||||||
|
or al, 00000100b
|
||||||
|
out dx, al
|
||||||
|
jmp EndDisableDma
|
||||||
|
MasterDisableDma:
|
||||||
|
mov dx, DmaMaskS
|
||||||
|
and al, 00000011b
|
||||||
|
or al, 00000100b
|
||||||
|
out dx, al
|
||||||
|
EndDisableDma:
|
||||||
|
pop dx ax
|
||||||
|
ret
|
||||||
|
|
||||||
|
;déverouille le canal AL
|
||||||
|
EnableDma:
|
||||||
|
push ax dx
|
||||||
|
cmp al, 4
|
||||||
|
jae MasterDisableDma
|
||||||
|
mov dx, DmaMaskS
|
||||||
|
out dx, al
|
||||||
|
jmp EndEnableDma
|
||||||
|
MasterEnableDma:
|
||||||
|
mov dx, DmaMaskS
|
||||||
|
and al, 00000011b
|
||||||
|
out dx, al
|
||||||
|
EndEnableDma:
|
||||||
|
pop dx ax
|
||||||
|
ret
|
||||||
|
|
||||||
|
;Efface le FlipFlop canal AL
|
||||||
|
ClrDmaFlipFlop:
|
||||||
|
push ax dx
|
||||||
|
cmp al, 4
|
||||||
|
jae MasterClrFlipFlopDma
|
||||||
|
mov dx,DmaFlipFlopS
|
||||||
|
xor ax, ax
|
||||||
|
out dx, al
|
||||||
|
jmp EndClrFlipFlopDma
|
||||||
|
MasterClrFlipFlopDma:
|
||||||
|
mov dx,DmaFlipFlopM
|
||||||
|
xor ax, ax
|
||||||
|
out dx, al
|
||||||
|
EndClrFlipFlopDma:
|
||||||
|
pop dx ax
|
||||||
|
ret
|
||||||
|
|
||||||
|
;Met le mode du canal al à ah
|
||||||
|
SetDmaMode:
|
||||||
|
push ax dx
|
||||||
|
cmp al, 4
|
||||||
|
jae MasterSetDmaMode
|
||||||
|
mov dx,DmaModeS
|
||||||
|
or al, ah
|
||||||
|
out dx, al
|
||||||
|
jmp EndSetDmaMode
|
||||||
|
MasterSetDmaMode:
|
||||||
|
mov dx,DmaModeM
|
||||||
|
and al, 00000011b
|
||||||
|
or al, ah
|
||||||
|
out dx, al
|
||||||
|
EndSetDmaMode:
|
||||||
|
pop dx ax
|
||||||
|
ret
|
||||||
|
|
||||||
|
|
||||||
|
;Met le page du canal al a ah
|
||||||
|
SetDmaPage:
|
||||||
|
push ax bx dx si
|
||||||
|
cmp al, 4
|
||||||
|
jae MasterSetDmaPage
|
||||||
|
mov si, offset DmaPage
|
||||||
|
xor dh, dh
|
||||||
|
xor bh, bh
|
||||||
|
mov bl, al
|
||||||
|
mov dl, cs:[si+bx]
|
||||||
|
xchg al, ah
|
||||||
|
out dx, al
|
||||||
|
jmp EndSetDmaPage
|
||||||
|
MasterSetDmaPage:
|
||||||
|
EndSetDmaPage:
|
||||||
|
pop si dx bx ax
|
||||||
|
ret
|
||||||
|
|
||||||
|
;Met l'adresse du canal al a DS:BX
|
||||||
|
SetDmaAdress:
|
||||||
|
push ax bx cx dx si
|
||||||
|
push ax
|
||||||
|
mov ax, ds
|
||||||
|
and ax, 0000111111111111b
|
||||||
|
shl ax,4
|
||||||
|
add bx, ax
|
||||||
|
mov ax, ds
|
||||||
|
and ax, 1111000000000000b
|
||||||
|
shr ax, 4
|
||||||
|
mov cx,ax
|
||||||
|
pop ax
|
||||||
|
push ax
|
||||||
|
add ax,cx
|
||||||
|
call SetDmaPage
|
||||||
|
pop ax
|
||||||
|
call ClrDmaFlipFlop
|
||||||
|
mov si, offset DmaAdress
|
||||||
|
xor dh, dh
|
||||||
|
push bx
|
||||||
|
xor bh, bh
|
||||||
|
mov bl, al
|
||||||
|
mov dl, byte ptr cs:[si+bx]
|
||||||
|
pop bx
|
||||||
|
cmp al, 4
|
||||||
|
jae MasterSetDmaAddress
|
||||||
|
mov al, bh
|
||||||
|
out dx, al
|
||||||
|
mov al, bl
|
||||||
|
out dx, al
|
||||||
|
jmp EndSetDmaAddress
|
||||||
|
MasterSetDmaAddress:
|
||||||
|
mov al, bh
|
||||||
|
out dx, al
|
||||||
|
call ClrDmaFlipFlop
|
||||||
|
mov al, bl
|
||||||
|
out dx, al
|
||||||
|
EndSetDmaAddress:
|
||||||
|
pop si dx cx bx ax
|
||||||
|
ret
|
||||||
|
|
||||||
|
;Spécifie au controleur DMA le nombre d'octets à transférer dans CX
|
||||||
|
SetDmaCount:
|
||||||
|
push ax bx dx si
|
||||||
|
call ClrDmaFlipFlop
|
||||||
|
mov si, offset DmaCount
|
||||||
|
xor dh, dh
|
||||||
|
xor bh, bh
|
||||||
|
mov bl, al
|
||||||
|
mov dl, byte ptr cs:[si+bx]
|
||||||
|
cmp al, 4
|
||||||
|
jae MasterSetDmaCount
|
||||||
|
mov al, ch
|
||||||
|
out dx, al
|
||||||
|
mov al, cl
|
||||||
|
out dx, al
|
||||||
|
jmp EndSetDmaCount
|
||||||
|
MasterSetDmaCount:
|
||||||
|
mov al, ch
|
||||||
|
out dx, al
|
||||||
|
call ClrDmaFlipFlop
|
||||||
|
mov al, cl
|
||||||
|
out dx, al
|
||||||
|
EndSetDmaCount:
|
||||||
|
pop si dx bx ax
|
||||||
|
ret
|
||||||
|
|
482
noyau/pic8259a.asm → noyau/8259a.asm
Executable file → Normal file
482
noyau/pic8259a.asm → noyau/8259a.asm
Executable file → Normal file
@ -1,241 +1,241 @@
|
|||||||
.model tiny
|
.model tiny
|
||||||
.486
|
.486
|
||||||
smart
|
smart
|
||||||
.code
|
.code
|
||||||
org 0100h
|
org 0100h
|
||||||
start:
|
start:
|
||||||
jmp tsr
|
jmp tsr
|
||||||
db 'PIC8259A'
|
db 'PIC8259A'
|
||||||
Tsr:
|
Tsr:
|
||||||
cli
|
cli
|
||||||
cmp ax,1234h
|
cmp ax,1234h
|
||||||
jne nomore
|
jne nomore
|
||||||
mov ax,4321h
|
mov ax,4321h
|
||||||
jmp itsok
|
jmp itsok
|
||||||
nomore:
|
nomore:
|
||||||
push bx
|
push bx
|
||||||
mov bl,ah
|
mov bl,ah
|
||||||
xor bh,bh
|
xor bh,bh
|
||||||
shl bx,1
|
shl bx,1
|
||||||
mov bx,cs:[bx].tables
|
mov bx,cs:[bx].tables
|
||||||
mov cs:current,bx
|
mov cs:current,bx
|
||||||
pop bx
|
pop bx
|
||||||
call cs:current
|
call cs:current
|
||||||
itsok:
|
itsok:
|
||||||
jnc noerror
|
jnc noerror
|
||||||
push bp
|
push bp
|
||||||
mov bp,sp
|
mov bp,sp
|
||||||
or byte ptr [bp+6],1b
|
or byte ptr [bp+6],1b
|
||||||
pop bp
|
pop bp
|
||||||
mov ax,cs
|
mov ax,cs
|
||||||
shl eax,16
|
shl eax,16
|
||||||
mov ax,cs:current
|
mov ax,cs:current
|
||||||
jmp endofint
|
jmp endofint
|
||||||
noerror:
|
noerror:
|
||||||
push bp
|
push bp
|
||||||
mov bp,sp
|
mov bp,sp
|
||||||
and byte ptr [bp+6],0FEh
|
and byte ptr [bp+6],0FEh
|
||||||
pop bp
|
pop bp
|
||||||
endofint:
|
endofint:
|
||||||
sti
|
sti
|
||||||
iret
|
iret
|
||||||
current dw 0
|
current dw 0
|
||||||
tables dw enableirq
|
tables dw enableirq
|
||||||
dw disableirq
|
dw disableirq
|
||||||
dw readmaskirq
|
dw readmaskirq
|
||||||
dw readirr
|
dw readirr
|
||||||
dw readisr
|
dw readisr
|
||||||
dw installhandler
|
dw installhandler
|
||||||
dw replacehandler
|
dw replacehandler
|
||||||
dw getint
|
dw getint
|
||||||
dw setint
|
dw setint
|
||||||
dw seteoi
|
dw seteoi
|
||||||
|
|
||||||
;Adresses de port du contr“leur IRQ
|
;Adresses de port du contr“leur IRQ
|
||||||
MASTERPIC = 020h ;Adresse de base du PIC maŒtre
|
MASTERPIC = 020h ;Adresse de base du PIC maŒtre
|
||||||
SLAVEPIC = 0A0h ;Adresse de base du PIC esclave
|
SLAVEPIC = 0A0h ;Adresse de base du PIC esclave
|
||||||
IRQMASK = 001h ;Offset sur port de masquage
|
IRQMASK = 001h ;Offset sur port de masquage
|
||||||
|
|
||||||
;Commandes IRQ OCW2
|
;Commandes IRQ OCW2
|
||||||
DISABLEROTATION = 000h ;Desactiver la rotation de priorités en mode EOI automatique
|
DISABLEROTATION = 000h ;Desactiver la rotation de priorités en mode EOI automatique
|
||||||
EOI = 020h ;End of Interrupt non sp‚cifi‚
|
EOI = 020h ;End of Interrupt non sp‚cifi‚
|
||||||
COMMANDEOI = 060h ;Commande EOI particulière
|
COMMANDEOI = 060h ;Commande EOI particulière
|
||||||
ENABLEROTATION = 080h ;Activer la rotation de priorités en mode EOI automatique
|
ENABLEROTATION = 080h ;Activer la rotation de priorités en mode EOI automatique
|
||||||
ROTATIONNOSPEC = 0A0h ;Rotation des priorités en mode EOI automatique
|
ROTATIONNOSPEC = 0A0h ;Rotation des priorités en mode EOI automatique
|
||||||
SETPRIORITY = 0C0h ;Definir la priorité
|
SETPRIORITY = 0C0h ;Definir la priorité
|
||||||
ROTATIONSPEC = 0E0h ;Rotation des priorités en mode EOI spécifié
|
ROTATIONSPEC = 0E0h ;Rotation des priorités en mode EOI spécifié
|
||||||
|
|
||||||
;Position des vecteurs d'interruptions
|
;Position des vecteurs d'interruptions
|
||||||
MASTERFIRSTVECTOR = 008h ;Vecteurs logiciels des interruptions
|
MASTERFIRSTVECTOR = 008h ;Vecteurs logiciels des interruptions
|
||||||
SLAVEFIRSTVECTOR = 070h ;‚lectroniques
|
SLAVEFIRSTVECTOR = 070h ;‚lectroniques
|
||||||
|
|
||||||
;OCW3 codes registres
|
;OCW3 codes registres
|
||||||
IRR = 002h ;Interrupt Request Register
|
IRR = 002h ;Interrupt Request Register
|
||||||
ISR = 003h ;In Service Register
|
ISR = 003h ;In Service Register
|
||||||
;OCW3 et modes
|
;OCW3 et modes
|
||||||
OCW3 = 008h ;OCW3
|
OCW3 = 008h ;OCW3
|
||||||
POLLING = 004h ;Polling bit
|
POLLING = 004h ;Polling bit
|
||||||
|
|
||||||
|
|
||||||
ISR = 0Bh ; Pas d'op‚ration, pas de Poll, lire ISR OCW3
|
ISR = 0Bh ; Pas d'op‚ration, pas de Poll, lire ISR OCW3
|
||||||
IRR = 0Ah ; Pas d'op‚ration, pas de Poll, lire IRR
|
IRR = 0Ah ; Pas d'op‚ration, pas de Poll, lire IRR
|
||||||
|
|
||||||
|
|
||||||
;Autorise une interruption ‚lectronique
|
;Autorise une interruption ‚lectronique
|
||||||
;Entr‚e : AL - Num‚ro de l'interruption (0-15) … autoriser 0-7 = MASTERPIC , 8-15 = SLAVEPIC
|
;Entr‚e : AL - Num‚ro de l'interruption (0-15) … autoriser 0-7 = MASTERPIC , 8-15 = SLAVEPIC
|
||||||
EnableIRQ:
|
EnableIRQ:
|
||||||
push ax cx dx
|
push ax cx dx
|
||||||
mov dx,MASTERPIC+IRQMASK
|
mov dx,MASTERPIC+IRQMASK
|
||||||
cmp al,7
|
cmp al,7
|
||||||
jbe master
|
jbe master
|
||||||
mov dx,SLAVEPIC+IRQMASK
|
mov dx,SLAVEPIC+IRQMASK
|
||||||
master:
|
master:
|
||||||
mov cl,al
|
mov cl,al
|
||||||
and cl,7
|
and cl,7
|
||||||
mov al,1
|
mov al,1
|
||||||
shl al,cl
|
shl al,cl
|
||||||
not al
|
not al
|
||||||
mov ah,al
|
mov ah,al
|
||||||
in al,dx
|
in al,dx
|
||||||
and al,ah
|
and al,ah
|
||||||
out dx,al
|
out dx,al
|
||||||
pop dx cx ax
|
pop dx cx ax
|
||||||
ret
|
ret
|
||||||
|
|
||||||
;Desactive une interruption ‚lectronique
|
;Desactive une interruption ‚lectronique
|
||||||
;Entr‚e : AL - Num‚ro de l'interruption (0-15) … desactiver 0-7 = MASTERPIC , 8-15 = SLAVEPIC
|
;Entr‚e : AL - Num‚ro de l'interruption (0-15) … desactiver 0-7 = MASTERPIC , 8-15 = SLAVEPIC
|
||||||
DisableIRQ:
|
DisableIRQ:
|
||||||
push ax cx dx
|
push ax cx dx
|
||||||
mov dx,MASTERPIC+IRQMASK
|
mov dx,MASTERPIC+IRQMASK
|
||||||
cmp al,7
|
cmp al,7
|
||||||
jbe master2
|
jbe master2
|
||||||
mov dx,SLAVEPIC+IRQMASK
|
mov dx,SLAVEPIC+IRQMASK
|
||||||
master2:
|
master2:
|
||||||
mov cl,al
|
mov cl,al
|
||||||
and cl,7
|
and cl,7
|
||||||
mov al,1
|
mov al,1
|
||||||
shl al,cl
|
shl al,cl
|
||||||
mov ah,al
|
mov ah,al
|
||||||
in al,dx
|
in al,dx
|
||||||
or al,ah
|
or al,ah
|
||||||
out dx,al
|
out dx,al
|
||||||
pop dx cx ax
|
pop dx cx ax
|
||||||
ret
|
ret
|
||||||
|
|
||||||
;Signale "End Of Interrupt" de l'interruption al
|
;Signale "End Of Interrupt" de l'interruption al
|
||||||
SetEOI:
|
SetEOI:
|
||||||
push ax dx
|
push ax dx
|
||||||
cmp al,7
|
cmp al,7
|
||||||
jbe master3
|
jbe master3
|
||||||
mov al,EOI
|
mov al,EOI
|
||||||
out SLAVEPIC,al
|
out SLAVEPIC,al
|
||||||
master3:
|
master3:
|
||||||
mov al,EOI
|
mov al,EOI
|
||||||
out MASTERPIC,al
|
out MASTERPIC,al
|
||||||
pop dx ax
|
pop dx ax
|
||||||
ret
|
ret
|
||||||
|
|
||||||
;Lit les masques d'un contr“leur IRQ dans al, 0 master ou slave 1 ds bh
|
;Lit les masques d'un contr“leur IRQ dans al, 0 master ou slave 1 ds bh
|
||||||
ReadmaskIrq:
|
ReadmaskIrq:
|
||||||
push dx
|
push dx
|
||||||
mov dx,MASTERPIC+ IRQMASK
|
mov dx,MASTERPIC+ IRQMASK
|
||||||
cmp bh,0
|
cmp bh,0
|
||||||
jne Master5
|
jne Master5
|
||||||
mov dx,SLAVEPIC+ IRQMASK
|
mov dx,SLAVEPIC+ IRQMASK
|
||||||
master5:
|
master5:
|
||||||
in al,dx
|
in al,dx
|
||||||
pop dx
|
pop dx
|
||||||
ret
|
ret
|
||||||
|
|
||||||
;Lit le registre d'‚tat d'un contr“leur IRQ dans al, 0 master ou slave 1 ds bh
|
;Lit le registre d'‚tat d'un contr“leur IRQ dans al, 0 master ou slave 1 ds bh
|
||||||
ReadISR:
|
ReadISR:
|
||||||
push dx
|
push dx
|
||||||
mov dx,MASTERPIC
|
mov dx,MASTERPIC
|
||||||
cmp bh,0
|
cmp bh,0
|
||||||
jne Master6
|
jne Master6
|
||||||
mov dx,SLAVEPIC
|
mov dx,SLAVEPIC
|
||||||
master6:
|
master6:
|
||||||
mov al,isr
|
mov al,isr
|
||||||
out dx,al
|
out dx,al
|
||||||
in al,dx
|
in al,dx
|
||||||
pop dx
|
pop dx
|
||||||
ret
|
ret
|
||||||
|
|
||||||
;Lit le registre d'‚tat d'un contr“leur IRQ dans al, 0 master ou slave 1 ds bh
|
;Lit le registre d'‚tat d'un contr“leur IRQ dans al, 0 master ou slave 1 ds bh
|
||||||
ReadIRR:
|
ReadIRR:
|
||||||
push dx
|
push dx
|
||||||
mov dx,MASTERPIC
|
mov dx,MASTERPIC
|
||||||
cmp bh,0
|
cmp bh,0
|
||||||
jne Master7
|
jne Master7
|
||||||
mov dx,SLAVEPIC
|
mov dx,SLAVEPIC
|
||||||
master7:
|
master7:
|
||||||
mov al,irr
|
mov al,irr
|
||||||
out dx,al
|
out dx,al
|
||||||
in al,dx
|
in al,dx
|
||||||
pop dx
|
pop dx
|
||||||
ret
|
ret
|
||||||
|
|
||||||
;remplace le handler pointer par ds:si en bx:100h interruption ax
|
;remplace le handler pointer par ds:si en bx:100h interruption ax
|
||||||
replacehandler:
|
replacehandler:
|
||||||
push ax bx cx si di ds es
|
push ax bx cx si di ds es
|
||||||
mov es,bx
|
mov es,bx
|
||||||
mov di,0100h
|
mov di,0100h
|
||||||
mov ah,4
|
mov ah,4
|
||||||
int 48h
|
int 48h
|
||||||
jc reph
|
jc reph
|
||||||
mov bx,ax
|
mov bx,ax
|
||||||
call getint
|
call getint
|
||||||
mov es:[102h],si
|
mov es:[102h],si
|
||||||
mov es:[104h],ds
|
mov es:[104h],ds
|
||||||
call setint
|
call setint
|
||||||
reph:
|
reph:
|
||||||
pop es ds di si cx bx ax
|
pop es ds di si cx bx ax
|
||||||
ret
|
ret
|
||||||
|
|
||||||
;install le handler pointer par ds:si en bx:100h interruption ax
|
;install le handler pointer par ds:si en bx:100h interruption ax
|
||||||
installhandler:
|
installhandler:
|
||||||
push bx cx di es
|
push bx cx di es
|
||||||
mov es,bx
|
mov es,bx
|
||||||
mov di,100h
|
mov di,100h
|
||||||
mov ah,4
|
mov ah,4
|
||||||
int 48h
|
int 48h
|
||||||
jc inh
|
jc inh
|
||||||
mov bx,ax
|
mov bx,ax
|
||||||
call setint
|
call setint
|
||||||
inh:
|
inh:
|
||||||
pop es di cx bx
|
pop es di cx bx
|
||||||
ret
|
ret
|
||||||
|
|
||||||
;met es:di le handle de l'int al
|
;met es:di le handle de l'int al
|
||||||
setint:
|
setint:
|
||||||
push ax bx ds
|
push ax bx ds
|
||||||
call disableirq
|
call disableirq
|
||||||
cli
|
cli
|
||||||
xor ah,ah
|
xor ah,ah
|
||||||
mov bx,ax
|
mov bx,ax
|
||||||
shl bx,2
|
shl bx,2
|
||||||
xor ax,ax
|
xor ax,ax
|
||||||
mov ds,ax
|
mov ds,ax
|
||||||
mov ds:[bx],di
|
mov ds:[bx],di
|
||||||
mov ds:[bx+2],es
|
mov ds:[bx+2],es
|
||||||
pop ds bx ax
|
pop ds bx ax
|
||||||
sti
|
sti
|
||||||
call enableirq
|
call enableirq
|
||||||
ret
|
ret
|
||||||
|
|
||||||
;met ds:si le handle de l'int al
|
;met ds:si le handle de l'int al
|
||||||
getint:
|
getint:
|
||||||
push ax bx es
|
push ax bx es
|
||||||
xor ah,ah
|
xor ah,ah
|
||||||
mov bx,ax
|
mov bx,ax
|
||||||
shl bx,2
|
shl bx,2
|
||||||
xor ax,ax
|
xor ax,ax
|
||||||
mov es,ax
|
mov es,ax
|
||||||
mov si,es:[bx]
|
mov si,es:[bx]
|
||||||
mov ds,es:[bx+2]
|
mov ds,es:[bx+2]
|
||||||
pop es bx ax
|
pop es bx ax
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
|
||||||
end start
|
end start
|
||||||
|
|
67
noyau/MAKEFILE
Normal file
67
noyau/MAKEFILE
Normal file
@ -0,0 +1,67 @@
|
|||||||
|
lnk_boot = tlink /x
|
||||||
|
asm= tasm /t/m5/zi
|
||||||
|
lnk= tlink /x/t
|
||||||
|
|
||||||
|
all: boot.bin clavier.sys 8259a.sys disque.sys heure.sys horloge.sys manette.sys port.sys souris.sys systeme.sys video.sys
|
||||||
|
|
||||||
|
boot.bin: boot.asm
|
||||||
|
$(asm) boot
|
||||||
|
$(lnk_boot) boot
|
||||||
|
exe2boot boot.exe boot.bin
|
||||||
|
|
||||||
|
clavier.sys: clavier.asm
|
||||||
|
$(asm) clavier
|
||||||
|
$(lnk) clavier
|
||||||
|
ren clavier.com clavier.sys
|
||||||
|
|
||||||
|
8259a.sys: 8259a.asm
|
||||||
|
$(asm) 8259a
|
||||||
|
$(lnk) 8259a
|
||||||
|
ren 8259a.com 8259a.sys
|
||||||
|
|
||||||
|
disque.sys: disque.asm
|
||||||
|
$(asm) disque
|
||||||
|
$(lnk) disque
|
||||||
|
ren disque.com disque.sys
|
||||||
|
|
||||||
|
heure.sys: heure.asm
|
||||||
|
$(asm) heure
|
||||||
|
$(lnk) heure
|
||||||
|
ren heure.com heure.sys
|
||||||
|
|
||||||
|
horloge.sys: horloge.asm
|
||||||
|
$(asm) horloge
|
||||||
|
$(lnk) horloge
|
||||||
|
ren horloge.com horloge.sys
|
||||||
|
|
||||||
|
manette.sys: manette.asm
|
||||||
|
$(asm) manette
|
||||||
|
$(lnk) manette
|
||||||
|
ren manette.com manette.sys
|
||||||
|
|
||||||
|
port.sys: port.asm
|
||||||
|
$(asm) port
|
||||||
|
$(lnk) port
|
||||||
|
ren port.com port.sys
|
||||||
|
|
||||||
|
souris.sys: souris.asm
|
||||||
|
$(asm) souris
|
||||||
|
$(lnk) souris
|
||||||
|
ren souris.com souris.sys
|
||||||
|
|
||||||
|
systeme.sys: systeme.asm
|
||||||
|
$(asm) systeme
|
||||||
|
$(lnk) systeme
|
||||||
|
ren systeme.com systeme.sys
|
||||||
|
|
||||||
|
video.sys: video.asm
|
||||||
|
$(asm) video
|
||||||
|
$(lnk) video
|
||||||
|
ren video.com video.sys
|
||||||
|
|
||||||
|
clean:
|
||||||
|
del *.obj
|
||||||
|
del *.exe
|
||||||
|
del *.com
|
||||||
|
del *.sys
|
||||||
|
del *.err
|
@ -1,55 +0,0 @@
|
|||||||
@echo off
|
|
||||||
|
|
||||||
echo Assembling file %1...
|
|
||||||
..\util\tasm %1.asm /m5/x/t
|
|
||||||
if errorlevel 1 goto end
|
|
||||||
if "%1"=="boot" goto boot
|
|
||||||
echo Linking file %1...
|
|
||||||
..\util\tlink %1.obj /x/t
|
|
||||||
if errorlevel 1 goto end
|
|
||||||
echo Copying file %1...
|
|
||||||
if "%1"=="video" goto video
|
|
||||||
if "%1"=="lpt" goto system
|
|
||||||
if "%1"=="keyboard" goto system
|
|
||||||
if "%1"=="mouse" goto system
|
|
||||||
if "%1"=="pic8259a" goto system
|
|
||||||
if "%1"=="timer" goto system
|
|
||||||
if "%1"=="drive" goto system
|
|
||||||
if "%1"=="joystick" goto system
|
|
||||||
if "%1"=="system" goto system
|
|
||||||
if "%1"=="setup" goto setup
|
|
||||||
if "%1"=="hours" goto system
|
|
||||||
copy %1.com ..\data\%1.exe>nul
|
|
||||||
goto end
|
|
||||||
|
|
||||||
:boot
|
|
||||||
echo Linking file %1...
|
|
||||||
..\util\tlink %1.obj /x
|
|
||||||
if errorlevel 1 goto end
|
|
||||||
echo Copying file %1...
|
|
||||||
..\util\exe2boot %1.exe
|
|
||||||
copy %1.bin ..\data\%1.bin>nul
|
|
||||||
goto end
|
|
||||||
|
|
||||||
:video
|
|
||||||
type thin8x8.fnt>>%1.com
|
|
||||||
:system
|
|
||||||
copy %1.com ..\data\%1.sys>nul
|
|
||||||
goto end
|
|
||||||
:setup
|
|
||||||
copy %1.com ..\%1.com>nul
|
|
||||||
goto end
|
|
||||||
|
|
||||||
:end
|
|
||||||
if not exist *.bin goto exes
|
|
||||||
del *.bin
|
|
||||||
:exes
|
|
||||||
if not exist *.exe goto coms
|
|
||||||
del *.exe
|
|
||||||
:coms
|
|
||||||
if not exist *.com goto objs
|
|
||||||
del *.com
|
|
||||||
:objs
|
|
||||||
if not exist *.obj goto nobjs
|
|
||||||
del *.obj
|
|
||||||
:nobjs
|
|
@ -1,11 +0,0 @@
|
|||||||
@echo off
|
|
||||||
call asm video
|
|
||||||
call asm system
|
|
||||||
call asm lpt
|
|
||||||
call asm keyboard
|
|
||||||
call asm pic8259a
|
|
||||||
call asm timer
|
|
||||||
call asm drive
|
|
||||||
call asm mouse
|
|
||||||
call asm joystick
|
|
||||||
call asm boot
|
|
440
noyau/boot.asm
Executable file → Normal file
440
noyau/boot.asm
Executable file → Normal file
@ -1,219 +1,221 @@
|
|||||||
boots segment
|
boots segment
|
||||||
.386
|
.386
|
||||||
org 7C00h
|
org 7C00h
|
||||||
;org 100h
|
;org 100h
|
||||||
assume cs:boots,ds:boots
|
assume cs:boots,ds:boots
|
||||||
|
|
||||||
start:
|
start:
|
||||||
jmp boot
|
jmp boot
|
||||||
|
|
||||||
|
bootdb db 'COS2000A' ;Fabricant + n°série Formatage
|
||||||
bootdb db 'COS2000A' ;Fabricant + n°série Formatage
|
sizec dw 512 ;octet/secteur
|
||||||
sizec dw 512 ;octet/secteur
|
db 1 ;secteur/cluster
|
||||||
db 1 ;secteur/cluster
|
reserv dw 1 ;secteur reserv‚
|
||||||
reserv dw 1 ;secteur reserv‚
|
nbfat db 2 ;nb de copie de la FAT
|
||||||
nbfat db 1 ;nb de copie de la FAT
|
nbfit dw 224 ;taille rep racine
|
||||||
nbfit dw 25 ;taille rep racine
|
allclu dw 2880 ;nb secteur du volume si < 32 még
|
||||||
allclu dw 2880 ;nb secteur du volume si < 32 még
|
db 0F0h ;Descripteur de média
|
||||||
db 0F0h ;Descripteur de média
|
fatsize dw 9 ;secteur/FAT
|
||||||
fatsize dw 12 ;secteur/FAT
|
nbtrack dw 18 ;secteur/piste
|
||||||
nbtrack dw 18 ;secteur/piste
|
head dw 2 ;nb de tˆteb de lecture/écriture
|
||||||
head dw 2 ;nb de tˆteb de lecture/écriture
|
hidden dd 0 ;nombre de secteur cach‚s
|
||||||
hidden dd 0 ;nombre de secteur cach‚s
|
dd 0 ;si nbsecteur = 0 nbsect ; the number of sectors
|
||||||
dd 0 ;si nbsecteur = 0 nbsect ; the number of sectors
|
bootdrv db 0 ;Lecteur de d‚marrage
|
||||||
bootdrv db 0 ;Lecteur de d‚marrage
|
bootsig db 0 ;NA
|
||||||
db 0 ;NA
|
db 29h ;boot signature 29h
|
||||||
bootsig db 29h ;boot signature 29h
|
bootsig2 dd 01020304h ;no de serie
|
||||||
dd 01020304h ;no de serie
|
pope db 'COS2000 ' ;nom de volume
|
||||||
pope db 'COS2000 ' ;nom de volume
|
db 'FAT12 ' ;FAT
|
||||||
db 'FAT16 ' ;FAT
|
specialboot:
|
||||||
specialboot:
|
|
||||||
|
errorloading db ' Erreur !!',0dh,0ah,0
|
||||||
errorloading db 'It''s not a COS disk!',0dh,0ah,0
|
okloading db 'Recherche noyau',0Dh,0ah,' - system.sys',0
|
||||||
okloading db 'COS search system',0Dh,0ah,0
|
syst db ' Ok',0dh,0ah,'Chargement',0
|
||||||
syst db 'Ok',0dh,0ah,0
|
dot db '.',0
|
||||||
dot db '.',0
|
Sys db 'SYSTEME SYS'
|
||||||
carry db 0dh,0ah,0
|
|
||||||
Sys db 'system',0,0,0,0,0,0
|
errorboot:
|
||||||
sys2 db 'sys',0
|
mov si,offset errorloading
|
||||||
|
call showstr
|
||||||
errorboot:
|
mov ah,0
|
||||||
mov si,offset errorloading
|
int 16h
|
||||||
call showstr
|
int 19h
|
||||||
mov ah,0
|
boot:
|
||||||
int 16h
|
mov Bootdrv,dl
|
||||||
int 19h
|
cli
|
||||||
boot:
|
mov ax,09000h
|
||||||
mov Bootdrv,dl
|
mov ss,ax
|
||||||
cli
|
mov sp,0FFFFh
|
||||||
mov ax,09000h
|
sti
|
||||||
mov ss,ax
|
|
||||||
mov sp,0FFFFh
|
boot2:
|
||||||
sti
|
push cs
|
||||||
p:
|
push cs
|
||||||
push cs
|
pop es
|
||||||
pop ds
|
pop ds
|
||||||
xor ax,ax
|
xor ax,ax
|
||||||
int 13h
|
int 13h
|
||||||
jc errorboot
|
jc errorboot
|
||||||
mov si,offset okloading
|
mov si,offset okloading
|
||||||
call showstr
|
call showstr
|
||||||
mov cx,nbtrack
|
mov cx,Reserv
|
||||||
les si,ds:[1Eh*4]
|
add cx,word ptr [offset Hidden]
|
||||||
mov byte ptr es:[si+4], cl
|
adc cx,word ptr [offset Hidden+2]
|
||||||
mov byte ptr es:[si+9], 0Fh
|
push cx
|
||||||
xor ax,ax
|
mov bx,fatsize
|
||||||
mov al,NbFat
|
mov di,offset bufferfat
|
||||||
mov bx,FatSize
|
readfat:
|
||||||
mul bx
|
call readsector
|
||||||
mov cx,ax
|
inc cx
|
||||||
add cx,word ptr [offset Hidden]
|
add di,sizec
|
||||||
adc cx,word ptr [offset Hidden+2]
|
dec bx
|
||||||
add cx,Reserv
|
jnz readfat
|
||||||
mov word ptr [offset BootSig],cx
|
pop cx
|
||||||
xor dx,dx
|
xor ax,ax
|
||||||
mov ax,allclu
|
mov al,NbFat
|
||||||
div nbtrack
|
mov bx,FatSize
|
||||||
xor dx,dx
|
mul bx
|
||||||
div head
|
add cx,ax
|
||||||
mov word ptr [offset pope],ax
|
mov ax,32
|
||||||
push cs
|
mul nbfit
|
||||||
pop es
|
div sizec
|
||||||
mov bx,offset buffer
|
add ax,cx
|
||||||
mov si,bx
|
sub ax,2
|
||||||
xor dx,dx
|
mov word ptr [offset bootsig],ax
|
||||||
CheckRoot:
|
xor dx,dx
|
||||||
call readsector
|
CheckRoot:
|
||||||
jc errorboot
|
mov di,offset buffer
|
||||||
xor di,di
|
call readsector
|
||||||
findnext:
|
jc errorboot
|
||||||
cmp byte ptr [bx+di],0
|
xor bx,bx
|
||||||
je errorboot
|
findnext:
|
||||||
push si di cx
|
cmp byte ptr [di],0
|
||||||
mov si,di
|
je errorboot
|
||||||
add si,bx
|
cmp byte ptr [di],0E5h
|
||||||
call showstr
|
je no
|
||||||
mov ax,si
|
cmp byte ptr [di],041h
|
||||||
mov si,offset dot
|
je no
|
||||||
call showstr
|
mov si,offset dot
|
||||||
mov si,ax
|
call showstr
|
||||||
add si,12
|
push di cx
|
||||||
call showstr
|
mov si,offset sys
|
||||||
mov si,offset carry
|
mov cx,11
|
||||||
call showstr
|
rep cmpsb
|
||||||
mov si,ax
|
pop cx di
|
||||||
mov di,offset sys
|
je oksystem
|
||||||
mov cx,12+4
|
no:
|
||||||
rep cmpsb
|
add di,32
|
||||||
pop cx di si
|
add bx,32
|
||||||
je oksystem
|
inc dx
|
||||||
add di,32
|
cmp dx,nbfit
|
||||||
inc dx
|
ja errorboot
|
||||||
cmp dx,nbfit
|
cmp bx,sizec
|
||||||
ja errorboot
|
jb findnext
|
||||||
cmp di,sizec
|
inc cx
|
||||||
jb findnext
|
jmp Checkroot
|
||||||
inc cx
|
oksystem:
|
||||||
jmp Checkroot
|
mov si,offset syst
|
||||||
oksystem:
|
call showstr
|
||||||
mov si,offset syst
|
mov cx,[di+26]
|
||||||
call showstr
|
mov ax,0900h
|
||||||
mov cx,[di+BX+26]
|
mov es,ax
|
||||||
mov bx,200h
|
push es
|
||||||
mov es,bx
|
mov di,100h
|
||||||
push bx
|
push di
|
||||||
mov bx,0100h
|
mov si,offset dot
|
||||||
push bx
|
xor ax,ax
|
||||||
mov si,offset dot
|
fatagain:
|
||||||
fatagain:
|
cmp cx,0FF0h
|
||||||
cmp cx,0FFF0h
|
jae finishload
|
||||||
jae finishload
|
push cx
|
||||||
call readsector
|
add cx,word ptr [offset bootsig]
|
||||||
jc errorboot
|
call readsector
|
||||||
call showstr
|
pop cx
|
||||||
add bx,sizec
|
jc errorboot
|
||||||
call getfat
|
inc ax
|
||||||
jnc fatagain
|
call showstr
|
||||||
finishload:
|
add di,sizec
|
||||||
push es
|
call getfat
|
||||||
push es
|
jnc fatagain
|
||||||
push es
|
finishload:
|
||||||
pop ds
|
db 0CBh
|
||||||
pop fs
|
|
||||||
pop gs
|
;=============READSECTOR (Fonction 01H)===============
|
||||||
push 7202h
|
;Lit le secteur CX et le met en es:di
|
||||||
popf
|
;-> AH=1
|
||||||
db 0CBh
|
;<- Flag Carry si erreur
|
||||||
|
;=====================================================
|
||||||
|
ReadSector:
|
||||||
|
push ax bx cx dx si
|
||||||
;<-cx nøsecteur ->cx code FAT
|
mov ax,cx
|
||||||
getfat:
|
xor dx,dx
|
||||||
push es bx
|
div nbtrack
|
||||||
mov ax,cx
|
inc dl
|
||||||
xor dx,dx
|
mov bl,dl
|
||||||
div sizec
|
xor dx,dx
|
||||||
mov cx,ax
|
div head
|
||||||
add cx,reserv
|
mov dh, 0
|
||||||
mov bx,offset buffer
|
xchg dl,dh
|
||||||
push cs
|
mov cx,ax
|
||||||
pop es
|
xchg cl,ch
|
||||||
call readsector
|
shl cl,6
|
||||||
jc errorgetfat
|
or cl, bl
|
||||||
shl dx,1
|
mov bx,di
|
||||||
add bx,dx
|
mov SI, 4
|
||||||
mov cx,[bx]
|
mov AL, 1
|
||||||
errorgetfat:
|
TryAgain:
|
||||||
pop bx es
|
mov AH, 2
|
||||||
ret
|
int 13h
|
||||||
|
jnc Done
|
||||||
ReadSector:
|
dec SI
|
||||||
push ax cx dx si
|
jnz TryAgain
|
||||||
mov AX, CX
|
Done:
|
||||||
xor DX, DX
|
pop si dx cx bx ax
|
||||||
div nbtrack
|
ret
|
||||||
mov CL, DL ;{ Set the sector }
|
|
||||||
and CL, 63 ;{ Top two bits are bits 8&9 of the cylinder }
|
getfat:
|
||||||
xor DX, DX
|
push ax bx dx di
|
||||||
div word ptr pope
|
mov di,offset bufferfat
|
||||||
mov CH, DL ;{ Set the track bits 0-7 }
|
mov ax,cx
|
||||||
mov AL, DH
|
mov bx,ax
|
||||||
ror AL, 1
|
and bx,0000000000000001b
|
||||||
ror AL, 1
|
shr ax,1
|
||||||
and AL, 11000000b
|
mov cx,3
|
||||||
or CL, AL ;{ Set bits 8&9 of track }
|
mul cx
|
||||||
xor dX, DX
|
add di,ax
|
||||||
div head
|
cmp bx,0h
|
||||||
mov DH, DL ;{ Set the head }
|
jnz evenfat
|
||||||
inc CL
|
oddfat:
|
||||||
mov SI, 4
|
mov dx,[di]
|
||||||
TryAgain:
|
and dx,0FFFh
|
||||||
mov AX,0201h
|
mov cx,dx
|
||||||
mov DL, bootdrv
|
jmp endfat
|
||||||
int 13h
|
evenfat:
|
||||||
jnc Done
|
mov dx,[di+1]
|
||||||
dec SI
|
and dx,0FFF0h
|
||||||
jnz TryAgain
|
shr dx,4
|
||||||
Done:
|
mov cx,dx
|
||||||
pop si dx cx ax
|
endfat:
|
||||||
ret
|
pop di dx bx ax
|
||||||
|
ret
|
||||||
showstr:
|
|
||||||
push ax bx si
|
showstr:
|
||||||
again:
|
push ax bx si
|
||||||
lodsb
|
again:
|
||||||
or al,al
|
lodsb
|
||||||
jz fin
|
or al,al
|
||||||
mov ah,0Eh
|
jz fin
|
||||||
mov bx,07h
|
mov ah,0Eh
|
||||||
int 10h
|
mov bx,07h
|
||||||
jmp again
|
int 10h
|
||||||
fin:
|
jmp again
|
||||||
pop si bx ax
|
fin:
|
||||||
ret
|
pop si bx ax
|
||||||
|
ret
|
||||||
|
|
||||||
Buffer equ $
|
Buffer equ $
|
||||||
boots ends
|
BufferFat equ $+2048
|
||||||
end start
|
|
||||||
|
boots ends
|
||||||
|
end start
|
||||||
|
|
||||||
|
426
noyau/keyboard.asm → noyau/clavier.asm
Executable file → Normal file
426
noyau/keyboard.asm → noyau/clavier.asm
Executable file → Normal file
@ -1,208 +1,218 @@
|
|||||||
.model tiny
|
.model tiny
|
||||||
.486
|
.486
|
||||||
smart
|
smart
|
||||||
.code
|
.code
|
||||||
|
|
||||||
org 0100h
|
org 0100h
|
||||||
|
|
||||||
start:
|
start:
|
||||||
|
|
||||||
jmp tsr
|
jmp tsr
|
||||||
offsets dd 0
|
offsets dd 0
|
||||||
db 'KEYBOARD'
|
db 'KEYBOARD'
|
||||||
tsr:
|
tsr:
|
||||||
pushf
|
pushf
|
||||||
db 2eh,0ffh,1eh
|
db 2eh,0ffh,1eh
|
||||||
dw offsets
|
dw offsets
|
||||||
cli
|
cli
|
||||||
mov cs:feax,eax
|
mov cs:feax,eax
|
||||||
in al,60h
|
in al,60h
|
||||||
cmp cs:isstate,1
|
cmp cs:isstate,1
|
||||||
jne nostate
|
jne nostate
|
||||||
cmp al,57
|
cmp al,57
|
||||||
jne endof
|
jne endof
|
||||||
mov cs:isstate,0
|
mov cs:isstate,0
|
||||||
jmp endof
|
jmp endof
|
||||||
nostate:
|
nostate:
|
||||||
cmp al,87
|
cmp al,68
|
||||||
je F11
|
je F10
|
||||||
cmp al,88
|
cmp al,87
|
||||||
je F12
|
je F11
|
||||||
endof:
|
cmp al,88
|
||||||
mov eax,cs:feax
|
je F12
|
||||||
sti
|
endof:
|
||||||
iret
|
mov eax,cs:feax
|
||||||
isstate db 0
|
sti
|
||||||
infos db 40 dup (0)
|
iret
|
||||||
|
isstate db 0
|
||||||
F11:
|
infos db 40 dup (0)
|
||||||
push ax di es
|
|
||||||
push cs
|
F10:
|
||||||
pop es
|
mov ax,6000h
|
||||||
mov di,offset infos
|
push ax
|
||||||
mov ah,34
|
mov di,0100h
|
||||||
int 47h
|
push di
|
||||||
mov al,cs:[di+7]
|
sti
|
||||||
inc al
|
db 0CBh
|
||||||
cmp al,9
|
|
||||||
jbe notabove
|
F11:
|
||||||
mov al,0
|
push ax di es
|
||||||
notabove:
|
push cs
|
||||||
mov ah,0
|
pop es
|
||||||
int 47h
|
mov di,offset infos
|
||||||
pop es di ax
|
mov ah,34
|
||||||
jmp endof
|
int 47h
|
||||||
|
mov al,cs:[di+7]
|
||||||
|
inc al
|
||||||
f12:
|
cmp al,9
|
||||||
mov cs:isstate,1
|
jbe notabove
|
||||||
pop word ptr cs:fip
|
mov al,0
|
||||||
pop word ptr cs:fcs
|
notabove:
|
||||||
pop dword ptr cs:ffl
|
mov ah,0
|
||||||
mov cs:fesp,esp
|
int 47h
|
||||||
push ds es
|
pop es di ax
|
||||||
pusha
|
jmp endof
|
||||||
push word ptr cs:fip
|
|
||||||
push gs
|
|
||||||
push fs
|
f12:
|
||||||
push ss
|
mov cs:isstate,1
|
||||||
push es
|
pop word ptr cs:fip
|
||||||
push ds
|
pop word ptr cs:fcs
|
||||||
push word ptr cs:fcs
|
pop dword ptr cs:ffl
|
||||||
push dword ptr cs:fesp
|
mov cs:fesp,esp
|
||||||
push ebp
|
push ds es
|
||||||
push edi
|
pusha
|
||||||
push esi
|
push word ptr cs:fip
|
||||||
push edx
|
push gs
|
||||||
push ecx
|
push fs
|
||||||
push ebx
|
push ss
|
||||||
push eax
|
push es
|
||||||
push dword ptr cs:ffl
|
push ds
|
||||||
push cs
|
push word ptr cs:fcs
|
||||||
push cs
|
push dword ptr cs:fesp
|
||||||
pop es
|
push ebp
|
||||||
pop ds
|
push edi
|
||||||
mov ah,26
|
push esi
|
||||||
int 47h
|
push edx
|
||||||
mov ah,2
|
push ecx
|
||||||
int 47h
|
push ebx
|
||||||
mov ah,21
|
push eax
|
||||||
mov cl,4
|
push dword ptr cs:ffl
|
||||||
int 47h
|
push cs
|
||||||
mov ah,13
|
push cs
|
||||||
mov si,offset reg
|
pop es
|
||||||
int 47h
|
pop ds
|
||||||
mov ah,6
|
mov ah,26
|
||||||
int 47h
|
int 47h
|
||||||
mov ah,21
|
mov ah,2
|
||||||
mov cl,7
|
int 47h
|
||||||
int 47h
|
mov ah,21
|
||||||
mov ah,13
|
mov cl,4
|
||||||
mov si,offset fla
|
int 47h
|
||||||
int 47h
|
mov ah,13
|
||||||
pop edx
|
mov si,offset reg
|
||||||
mov cx,32
|
int 47h
|
||||||
mov ah,11
|
mov ah,6
|
||||||
int 47h
|
int 47h
|
||||||
mov ah,5
|
mov ah,21
|
||||||
int 47h
|
mov cl,7
|
||||||
mov ah,10
|
int 47h
|
||||||
int 47h
|
mov ah,13
|
||||||
mov si,offset regs
|
mov si,offset fla
|
||||||
mov bx,8+7
|
int 47h
|
||||||
mov ah,21
|
pop edx
|
||||||
mov cl,6
|
mov cx,32
|
||||||
int 47h
|
mov ah,11
|
||||||
showallREG:
|
int 47h
|
||||||
mov ah,6
|
mov ah,5
|
||||||
int 47h
|
int 47h
|
||||||
cmp bx,8
|
mov ah,10
|
||||||
jb nodr
|
int 47h
|
||||||
pop edx
|
mov si,offset regs
|
||||||
mov cx,32
|
mov bx,8+7
|
||||||
jmp popo
|
mov ah,21
|
||||||
nodr:
|
mov cl,6
|
||||||
mov ah,21
|
int 47h
|
||||||
mov cl,1
|
showallREG:
|
||||||
int 47h
|
mov ah,6
|
||||||
xor edx,edx
|
int 47h
|
||||||
pop dx
|
cmp bx,8
|
||||||
mov cx,16
|
jb nodr
|
||||||
popo:
|
pop edx
|
||||||
mov ah,13
|
mov cx,32
|
||||||
int 47h
|
jmp popo
|
||||||
mov ah,10
|
nodr:
|
||||||
int 47h
|
mov ah,21
|
||||||
mov ah,5
|
mov cl,1
|
||||||
int 47h
|
int 47h
|
||||||
push si
|
xor edx,edx
|
||||||
mov si,offset gr
|
pop dx
|
||||||
mov ah,13
|
mov cx,16
|
||||||
int 47h
|
popo:
|
||||||
mov ah,8
|
mov ah,13
|
||||||
int 47h
|
int 47h
|
||||||
mov si,offset dr
|
mov ah,10
|
||||||
mov ah,13
|
int 47h
|
||||||
int 47h
|
mov ah,5
|
||||||
pop si
|
int 47h
|
||||||
add si,5
|
push si
|
||||||
dec bx
|
mov si,offset gr
|
||||||
jnz showallreg
|
mov ah,13
|
||||||
mov ah,34
|
int 47h
|
||||||
mov di,offset infos
|
mov ah,8
|
||||||
int 47h
|
int 47h
|
||||||
mov ah,25
|
mov si,offset dr
|
||||||
mov bl,cs:infos
|
mov ah,13
|
||||||
xor bh,bh
|
int 47h
|
||||||
dec bl
|
pop si
|
||||||
int 47h
|
add si,5
|
||||||
mov si,offset app
|
dec bx
|
||||||
mov ah,13
|
jnz showallreg
|
||||||
int 47h
|
mov ah,34
|
||||||
mov ah,32
|
mov di,offset infos
|
||||||
mov bl,cs:infos
|
int 47h
|
||||||
xor bh,bh
|
mov ah,25
|
||||||
mov di,ax
|
mov bl,cs:infos
|
||||||
dec di
|
xor bh,bh
|
||||||
mov cl,116
|
dec bl
|
||||||
int 47h
|
int 47h
|
||||||
pop es ds
|
mov si,offset app
|
||||||
sti
|
mov ah,13
|
||||||
waitt:
|
int 47h
|
||||||
cmp cs:isstate,0
|
mov ah,32
|
||||||
jne waitt
|
mov bl,cs:infos
|
||||||
mov ah,27
|
xor bh,bh
|
||||||
int 47h
|
mov di,ax
|
||||||
popa
|
dec di
|
||||||
pop es ds
|
mov cl,116
|
||||||
push dword ptr cs:ffl
|
int 47h
|
||||||
push word ptr cs:fcs
|
pop es ds
|
||||||
push word ptr cs:fip
|
sti
|
||||||
jmp endof
|
waitt:
|
||||||
|
cmp cs:isstate,0
|
||||||
reg db ' State of registers',0
|
jne waitt
|
||||||
fla db 'Eflags:',0
|
mov ah,27
|
||||||
regs db 'EAX:',0
|
int 47h
|
||||||
db 'EBX:',0
|
popa
|
||||||
db 'ECX:',0
|
pop es ds
|
||||||
db 'EDX:',0
|
push dword ptr cs:ffl
|
||||||
db 'ESI:',0
|
push word ptr cs:fcs
|
||||||
db 'EDI:',0
|
push word ptr cs:fip
|
||||||
db 'EBP:',0
|
jmp endof
|
||||||
db 'ESP:',0
|
|
||||||
db ' CS:',0
|
reg db ' Etats des registres',0
|
||||||
db ' DS:',0
|
fla db 'Eflags:',0
|
||||||
db ' ES:',0
|
regs db 'EAX:',0
|
||||||
db ' FS:',0
|
db 'EBX:',0
|
||||||
db ' GS:',0
|
db 'ECX:',0
|
||||||
db ' SS:',0
|
db 'EDX:',0
|
||||||
db ' IP:',0
|
db 'ESI:',0
|
||||||
gr db '(',0
|
db 'EDI:',0
|
||||||
dr db ')',0
|
db 'EBP:',0
|
||||||
app db 'Press space to quit...',0
|
db 'ESP:',0
|
||||||
ffl dd 0
|
db ' CS:',0
|
||||||
fcs dw 0
|
db ' DS:',0
|
||||||
fip dw 0
|
db ' ES:',0
|
||||||
fesp dd 0
|
db ' FS:',0
|
||||||
feax dd 0
|
db ' GS:',0
|
||||||
end start
|
db ' SS:',0
|
||||||
|
db ' IP:',0
|
||||||
|
gr db '(',0
|
||||||
|
dr db ')',0
|
||||||
|
app db 'Appuyez sur espace pour quitter...',0
|
||||||
|
ffl dd 0
|
||||||
|
fcs dw 0
|
||||||
|
fip dw 0
|
||||||
|
fesp dd 0
|
||||||
|
feax dd 0
|
||||||
|
end start
|
@ -1,3 +0,0 @@
|
|||||||
@echo off
|
|
||||||
echo nettoyage en cours...
|
|
||||||
del ..\data\*.* >nul
|
|
@ -1,2 +0,0 @@
|
|||||||
@echo off
|
|
||||||
..\util\td %1
|
|
964
noyau/disque.asm
Normal file
964
noyau/disque.asm
Normal file
@ -0,0 +1,964 @@
|
|||||||
|
.model tiny
|
||||||
|
.486
|
||||||
|
smart
|
||||||
|
.code
|
||||||
|
|
||||||
|
org 0100h
|
||||||
|
|
||||||
|
include ..\include\fat.h
|
||||||
|
|
||||||
|
start:
|
||||||
|
jmp tsr ;Saute à la routine résidente
|
||||||
|
names db 'DRIVE' ;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 readsector
|
||||||
|
dw writesector
|
||||||
|
dw verifysector2
|
||||||
|
dw initdrive
|
||||||
|
dw loadfile
|
||||||
|
dw compressrle
|
||||||
|
dw decompressrle
|
||||||
|
dw FindFirstfile
|
||||||
|
dw Findnextfile
|
||||||
|
dw GetFreeSpace
|
||||||
|
dw Searchfile
|
||||||
|
dw Getname
|
||||||
|
dw Getserial
|
||||||
|
dw changedir
|
||||||
|
dw readcluster
|
||||||
|
dw writecluster
|
||||||
|
dw getdir
|
||||||
|
|
||||||
|
maxfunc equ 24
|
||||||
|
|
||||||
|
;DPT disquette
|
||||||
|
mydpt DPT ?
|
||||||
|
|
||||||
|
;Secteur de boot
|
||||||
|
myboot bootSector ?
|
||||||
|
|
||||||
|
;Données Calculée
|
||||||
|
clustersize dw 0
|
||||||
|
TracksPerHead dw 0
|
||||||
|
DriveSize dd 0
|
||||||
|
AdressBoot dw 0
|
||||||
|
AdressFat dw 0
|
||||||
|
AdressParent dw 0
|
||||||
|
AdressData dw 0
|
||||||
|
AddingValue dw 0
|
||||||
|
CurrentDir dw 0 ;En cluster
|
||||||
|
CurrentDirStr db 128 dup (0)
|
||||||
|
|
||||||
|
;Pour recherches
|
||||||
|
EntryPlace dw 0 ;En octet
|
||||||
|
AdressDirectory dw 0 ;En cluster
|
||||||
|
firstsearch dw 1 ;Premiere requete ?
|
||||||
|
|
||||||
|
getfat:
|
||||||
|
push ax bx dx si
|
||||||
|
mov ax,cx
|
||||||
|
mov bx,ax
|
||||||
|
and bx,0000000000000001b
|
||||||
|
shr ax,1
|
||||||
|
mov cx,3
|
||||||
|
mul cx
|
||||||
|
mov si,offset bufferfat
|
||||||
|
add si,ax
|
||||||
|
cmp bx,0h
|
||||||
|
jnz evenfat
|
||||||
|
oddfat:
|
||||||
|
mov dx,cs:[si]
|
||||||
|
and dx,0FFFh
|
||||||
|
mov cx,dx
|
||||||
|
jmp endfat
|
||||||
|
evenfat:
|
||||||
|
mov dx,cs:[si+1]
|
||||||
|
and dx,0FFF0h
|
||||||
|
shr dx,4
|
||||||
|
mov cx,dx
|
||||||
|
endfat:
|
||||||
|
cmp dx,0FF0h
|
||||||
|
jbe nocarry
|
||||||
|
stc
|
||||||
|
pop si dx bx ax
|
||||||
|
ret
|
||||||
|
nocarry:
|
||||||
|
clc
|
||||||
|
pop si dx bx ax
|
||||||
|
ret
|
||||||
|
|
||||||
|
;============loadfile (Fonction 4)===============
|
||||||
|
;Charge le fichier ds:si en es:di ->ecx taille
|
||||||
|
;-> AH=4
|
||||||
|
;<- Flag Carry si erreur
|
||||||
|
;=====================================================
|
||||||
|
loadfile:
|
||||||
|
push eax bx di
|
||||||
|
push es di
|
||||||
|
push cs
|
||||||
|
pop es
|
||||||
|
mov di,offset tempfit
|
||||||
|
call searchfile
|
||||||
|
pop di es
|
||||||
|
jne errorload
|
||||||
|
jc errorload
|
||||||
|
mov cx,cs:tempfit.FileGroup
|
||||||
|
mov eax,cs:tempfit.FileSize
|
||||||
|
call loadway
|
||||||
|
jc errorload
|
||||||
|
clc
|
||||||
|
mov ecx,eax
|
||||||
|
pop di bx eax
|
||||||
|
ret
|
||||||
|
errorload:
|
||||||
|
stc
|
||||||
|
mov ecx,0
|
||||||
|
pop di bx eax
|
||||||
|
ret
|
||||||
|
|
||||||
|
tempfit db 32 dup (0)
|
||||||
|
|
||||||
|
;=============SearchFile (Fonction 10)===============
|
||||||
|
;Renvois dans ES:DI la fit du fichier DS:SI et non equal si pas existant
|
||||||
|
;-> AH=10
|
||||||
|
;<- Flag Carry si erreur
|
||||||
|
;=====================================================
|
||||||
|
SearchFile:
|
||||||
|
push ax cx ds si di es
|
||||||
|
call uppercase
|
||||||
|
push ds si
|
||||||
|
call findfirstfilez
|
||||||
|
push ds
|
||||||
|
pop es
|
||||||
|
mov di,si
|
||||||
|
pop si ds
|
||||||
|
jc errorsearch
|
||||||
|
jmp founded
|
||||||
|
nextsearch:
|
||||||
|
push ds si
|
||||||
|
call findnextfilez
|
||||||
|
push ds
|
||||||
|
pop es
|
||||||
|
mov di,si
|
||||||
|
pop si ds
|
||||||
|
founded:
|
||||||
|
cmp byte ptr cs:[di],0
|
||||||
|
je notgood
|
||||||
|
cmp byte ptr cs:[di+FileAttr],0Fh
|
||||||
|
je nextsearch
|
||||||
|
call cmpnames
|
||||||
|
jc nextsearch
|
||||||
|
okfound:
|
||||||
|
push cs
|
||||||
|
pop ds
|
||||||
|
mov si,di
|
||||||
|
pop es di
|
||||||
|
push di es
|
||||||
|
mov cx,32
|
||||||
|
rep movsb
|
||||||
|
clc
|
||||||
|
pop es di si ds cx ax
|
||||||
|
ret
|
||||||
|
notgood:
|
||||||
|
cmp si,0FF5h
|
||||||
|
pop es di si ds cx ax
|
||||||
|
ret
|
||||||
|
errorsearch:
|
||||||
|
stc
|
||||||
|
pop es di si ds cx ax
|
||||||
|
ret
|
||||||
|
|
||||||
|
;Transforme la chaine ds:si en maj
|
||||||
|
uppercase:
|
||||||
|
push si ax
|
||||||
|
mov di,si
|
||||||
|
uppercaser:
|
||||||
|
mov al,ds:[si]
|
||||||
|
cmp al,0
|
||||||
|
je enduppercase
|
||||||
|
cmp al,'a'
|
||||||
|
jb nonmaj
|
||||||
|
cmp al,'z'
|
||||||
|
ja nonmaj
|
||||||
|
sub al,'a'-'A'
|
||||||
|
mov ds:[si],al
|
||||||
|
nonmaj:
|
||||||
|
inc si
|
||||||
|
jmp uppercaser
|
||||||
|
enduppercase:
|
||||||
|
clc
|
||||||
|
pop ax si
|
||||||
|
ret
|
||||||
|
|
||||||
|
;Compare le nom ds:si '.' avec es:di
|
||||||
|
CmpNames:
|
||||||
|
push ax cx si di
|
||||||
|
mov cx,8
|
||||||
|
repe cmpsb
|
||||||
|
jne nequal
|
||||||
|
inc si
|
||||||
|
nequal:
|
||||||
|
cmp byte ptr [si-1],'.'
|
||||||
|
jne trynoext
|
||||||
|
mov al,' '
|
||||||
|
rep scasb
|
||||||
|
mov cx,3
|
||||||
|
rep cmpsb
|
||||||
|
jne notequal
|
||||||
|
cmp byte ptr [si],0
|
||||||
|
jne notequal
|
||||||
|
cmp cx,0
|
||||||
|
jl notequal
|
||||||
|
itok:
|
||||||
|
pop di si cx ax
|
||||||
|
ret
|
||||||
|
trynoext:
|
||||||
|
cmp byte ptr [si-1],0
|
||||||
|
jne notequal
|
||||||
|
jmp itok
|
||||||
|
notequal:
|
||||||
|
stc
|
||||||
|
pop di si cx ax
|
||||||
|
ret
|
||||||
|
|
||||||
|
;charge le fichier de de groupe CX et de taille eax
|
||||||
|
LoadWay:
|
||||||
|
push eax bx dx si di ecx ds es
|
||||||
|
cmp eax,0
|
||||||
|
je Zeroload
|
||||||
|
rol eax,16
|
||||||
|
mov dx,ax
|
||||||
|
ror eax,16
|
||||||
|
div cs:clusterSize
|
||||||
|
mov bx,ax
|
||||||
|
cmp bx,1
|
||||||
|
jb adjustlast
|
||||||
|
Loadfat:
|
||||||
|
call readcluster
|
||||||
|
jc noway
|
||||||
|
add di,cs:clusterSize
|
||||||
|
call getfat
|
||||||
|
dec bx
|
||||||
|
jnz loadfat
|
||||||
|
AdjustLast:
|
||||||
|
push es di
|
||||||
|
push cs
|
||||||
|
pop es
|
||||||
|
mov di,offset bufferread
|
||||||
|
mov si,di
|
||||||
|
call Readcluster
|
||||||
|
pop di es
|
||||||
|
jc noway
|
||||||
|
mov cx,dx
|
||||||
|
push cs
|
||||||
|
pop ds
|
||||||
|
rep movsb
|
||||||
|
zeroload:
|
||||||
|
clc
|
||||||
|
pop es ds ecx di si dx bx eax
|
||||||
|
ret
|
||||||
|
noway:
|
||||||
|
stc
|
||||||
|
pop es ds ebp di si dx bx eax
|
||||||
|
ret
|
||||||
|
|
||||||
|
;=============INITDRIVE (Fonction 04H)===============
|
||||||
|
;Initialise le lecteur pour une utilisation ultérieure
|
||||||
|
;-> AH=4
|
||||||
|
;<- Flag Carry si erreur
|
||||||
|
;=====================================================
|
||||||
|
InitDrive:
|
||||||
|
push eax bx cx edx di ds es
|
||||||
|
push cs
|
||||||
|
pop ds
|
||||||
|
push cs
|
||||||
|
pop es
|
||||||
|
mov di,3
|
||||||
|
againtry:
|
||||||
|
xor ax,ax
|
||||||
|
mov dx,0000h
|
||||||
|
int 13h
|
||||||
|
mov bx,offset myboot
|
||||||
|
mov ax,0201h
|
||||||
|
mov cx,0001h
|
||||||
|
mov dx,0000h
|
||||||
|
int 13h
|
||||||
|
jnc oknoagaintry
|
||||||
|
dec di
|
||||||
|
jnz againtry
|
||||||
|
oknoagaintry:
|
||||||
|
mov cs:lastseg,0
|
||||||
|
mov cs:lastoff,0
|
||||||
|
mov cs:LastRead,0
|
||||||
|
mov ax,myboot.sectorsize
|
||||||
|
mov bl,myboot.SectorsPerCluster
|
||||||
|
xor bh,bh
|
||||||
|
mul bx
|
||||||
|
mov clustersize,ax
|
||||||
|
mov bx,myboot.HiddenSectorsL
|
||||||
|
adc bx,myboot.HiddenSectorsH
|
||||||
|
mov AdressBoot,bx
|
||||||
|
add bx,myboot.ReservedSectors
|
||||||
|
mov AdressFat,bx
|
||||||
|
xor ax,ax
|
||||||
|
mov al,myboot.FatsPerDrive
|
||||||
|
mul myboot.SectorsPerFat
|
||||||
|
add bx,ax
|
||||||
|
mov AdressParent,bx
|
||||||
|
mov AdressDirectory,bx
|
||||||
|
mov ax,32
|
||||||
|
mul myboot.DirectorySize
|
||||||
|
div myboot.SectorSize
|
||||||
|
add bx,ax
|
||||||
|
mov AdressData,bx
|
||||||
|
sub bx,2
|
||||||
|
mov AddingValue,bx
|
||||||
|
mov ax,myboot.SectorsPerDrive
|
||||||
|
div myboot.SectorsPerTrack
|
||||||
|
xor dx,dx
|
||||||
|
div myboot.HeadsPerDrive
|
||||||
|
mov TracksPerHead,ax
|
||||||
|
xor eax,eax
|
||||||
|
mov ax,myboot.SectorsPerDrive
|
||||||
|
sub ax,AdressData
|
||||||
|
mul myboot.SectorSize
|
||||||
|
shl edx,16
|
||||||
|
add edx,eax
|
||||||
|
mov DriveSize,edx
|
||||||
|
mov CurrentDir,0
|
||||||
|
mov EntryPlace,0
|
||||||
|
mov adressdirectory,0
|
||||||
|
mov firstsearch,1
|
||||||
|
mov currentdirstr,0
|
||||||
|
mov di,offset bufferfat
|
||||||
|
mov dx,myboot.SectorsPerFat
|
||||||
|
mov cx,AdressFat
|
||||||
|
SeeFat:
|
||||||
|
call readsector
|
||||||
|
jc ErrorInit
|
||||||
|
add di,myboot.SectorSize
|
||||||
|
inc cx
|
||||||
|
dec dx
|
||||||
|
jnz seefat
|
||||||
|
clc
|
||||||
|
pop es ds di edx cx bx eax
|
||||||
|
ret
|
||||||
|
ErrorInit:
|
||||||
|
stc
|
||||||
|
pop es ds di edx cx bx eax
|
||||||
|
ret
|
||||||
|
|
||||||
|
;=============FindFirstFile (Fonction 7)==============
|
||||||
|
;Renvois dans ES:DI un bloc d'info
|
||||||
|
;-> AH=7
|
||||||
|
;<- Flag Carry si erreur
|
||||||
|
;=====================================================
|
||||||
|
FindFirstFile:
|
||||||
|
push cx ds di si
|
||||||
|
call FindFirstFileZ
|
||||||
|
mov cx,32
|
||||||
|
rep movsb
|
||||||
|
pop si di ds cx
|
||||||
|
ret
|
||||||
|
|
||||||
|
FindFirstFileZ:
|
||||||
|
push cx
|
||||||
|
mov cx,cs:CurrentDir
|
||||||
|
mov cs:AdressDirectory,cx
|
||||||
|
xor cx,cx
|
||||||
|
mov cs:EntryPlace,cx
|
||||||
|
mov cs:firstsearch,1
|
||||||
|
call findnextfileZ
|
||||||
|
pop cx
|
||||||
|
ret
|
||||||
|
|
||||||
|
;=============FindnextFile (Fonction 8)==============
|
||||||
|
;Renvois dans ES:DI un bloc d'info
|
||||||
|
;-> AH=8
|
||||||
|
;<- Flag Carry si erreur
|
||||||
|
;=====================================================
|
||||||
|
;Renvois dans ES:DI un bloc d'info
|
||||||
|
FindnextFile:
|
||||||
|
push cx ds di si
|
||||||
|
call FindnextFileZ
|
||||||
|
mov cx,32
|
||||||
|
rep movsb
|
||||||
|
pop si di ds cx
|
||||||
|
ret
|
||||||
|
|
||||||
|
;fait pointer ds:si sur la prochaine entrée du repertoire courant
|
||||||
|
FindnextFileZ:
|
||||||
|
push ax bx cx es di
|
||||||
|
push cs
|
||||||
|
pop ds
|
||||||
|
mov cx,cs:AdressDirectory
|
||||||
|
mov bx,cs:Entryplace
|
||||||
|
FindnextFileagain:
|
||||||
|
cmp cs:firstsearch,1
|
||||||
|
je first
|
||||||
|
add bx,32
|
||||||
|
cmp bx,cs:clusterSize
|
||||||
|
jb nopop
|
||||||
|
first:
|
||||||
|
mov di,offset bufferentry
|
||||||
|
push cs
|
||||||
|
pop es
|
||||||
|
mov bx,0
|
||||||
|
cmp cs:currentdir,0
|
||||||
|
jne notrootdir
|
||||||
|
cmp cs:firstsearch,1
|
||||||
|
je noaddfirst1
|
||||||
|
inc cx
|
||||||
|
noaddfirst1:
|
||||||
|
add cx,cs:adressparent
|
||||||
|
mov al,myboot.sectorspercluster
|
||||||
|
readroot:
|
||||||
|
call readsector
|
||||||
|
jc notwell
|
||||||
|
add di,myboot.sectorsize
|
||||||
|
dec al
|
||||||
|
jnz readroot
|
||||||
|
sub cx,cs:adressparent
|
||||||
|
jmp nopop
|
||||||
|
notrootdir:
|
||||||
|
cmp cs:firstsearch,1
|
||||||
|
je noaddfirst2
|
||||||
|
call getfat
|
||||||
|
noaddfirst2:
|
||||||
|
jc notwell
|
||||||
|
call readcluster
|
||||||
|
jc notwell
|
||||||
|
nopop:
|
||||||
|
mov cs:firstsearch,0
|
||||||
|
mov si,offset bufferentry
|
||||||
|
add si,bx
|
||||||
|
cmp byte ptr cs:[si],0
|
||||||
|
je notwell
|
||||||
|
mov cs:entryplace,bx
|
||||||
|
mov cs:AdressDirectory,cx
|
||||||
|
cmp byte ptr cs:[si],0E5h
|
||||||
|
je findnextfileagain
|
||||||
|
cmp byte ptr cs:[si+fileattr],28h
|
||||||
|
je findnextfileagain
|
||||||
|
cmp byte ptr cs:[si+fileattr],0Fh
|
||||||
|
je findnextfileagain
|
||||||
|
clc
|
||||||
|
pop di es cx bx ax
|
||||||
|
ret
|
||||||
|
notwell:
|
||||||
|
stc
|
||||||
|
pop di es cx bx ax
|
||||||
|
ret
|
||||||
|
|
||||||
|
;=============GetFreeSpace (Fonction 09H)===============
|
||||||
|
;Renvoie en EDX l'espace disque libre du volume
|
||||||
|
;-> AH=9
|
||||||
|
;<- Flag Carry si erreur
|
||||||
|
;=====================================================
|
||||||
|
GetFreeSpace:
|
||||||
|
push eax
|
||||||
|
xor eax,eax
|
||||||
|
call getsector
|
||||||
|
mul cs:myboot.SectorSize
|
||||||
|
shl edx,16
|
||||||
|
add edx,eax
|
||||||
|
pop eax
|
||||||
|
ret
|
||||||
|
|
||||||
|
;ax=défectueux bx=libre
|
||||||
|
GetSector:
|
||||||
|
push cx dx
|
||||||
|
mov dx,cs:myboot.SectorsPerDrive
|
||||||
|
sub dx,cs:AddingValue
|
||||||
|
xor ax,ax
|
||||||
|
xor bx,bx
|
||||||
|
mov cx,0
|
||||||
|
goget:
|
||||||
|
push cx
|
||||||
|
call getfat
|
||||||
|
cmp cx,0FF7h
|
||||||
|
jne notdefect
|
||||||
|
inc bx
|
||||||
|
notdefect:
|
||||||
|
cmp cx,0
|
||||||
|
jne notfree
|
||||||
|
inc ax
|
||||||
|
notfree:
|
||||||
|
pop cx
|
||||||
|
inc cx
|
||||||
|
dec dx
|
||||||
|
jnz goget
|
||||||
|
pop dx cx
|
||||||
|
ret
|
||||||
|
errorfree:
|
||||||
|
stc
|
||||||
|
pop dx cx
|
||||||
|
ret
|
||||||
|
|
||||||
|
|
||||||
|
;=============READCLUSTER (Fonction 14)===============
|
||||||
|
;Lit le secteur CX et le met en es:di
|
||||||
|
;-> AH=14
|
||||||
|
;<- Flag Carry si erreur
|
||||||
|
;=====================================================
|
||||||
|
readcluster:
|
||||||
|
push ax bx cx dx di
|
||||||
|
mov ax,cx
|
||||||
|
mov bl,cs:myboot.sectorspercluster
|
||||||
|
xor bh,bh
|
||||||
|
mul bx
|
||||||
|
mov cx,ax
|
||||||
|
add cx,cs:addingvalue
|
||||||
|
readsectors:
|
||||||
|
call readsector
|
||||||
|
jc errorreadincluster
|
||||||
|
add di,cs:myboot.sectorsize
|
||||||
|
inc cx
|
||||||
|
dec bl
|
||||||
|
jnz readsectors
|
||||||
|
clc
|
||||||
|
pop di dx cx bx ax
|
||||||
|
ret
|
||||||
|
errorreadincluster:
|
||||||
|
stc
|
||||||
|
pop di dx cx bx ax
|
||||||
|
ret
|
||||||
|
|
||||||
|
;=============WRITECLUSTER (Fonction 15)===============
|
||||||
|
;Ecrit le cluster CX et le met en es:di
|
||||||
|
;-> AH=14
|
||||||
|
;<- Flag Carry si erreur
|
||||||
|
;=====================================================
|
||||||
|
writecluster:
|
||||||
|
push ax bx cx dx si
|
||||||
|
mov ax,cx
|
||||||
|
mov bl,cs:myboot.sectorspercluster
|
||||||
|
xor bh,bh
|
||||||
|
mul cx
|
||||||
|
mov cx,ax
|
||||||
|
add cx,cs:addingvalue
|
||||||
|
writesectors:
|
||||||
|
call writesector
|
||||||
|
jc errorwriteincluster
|
||||||
|
add si,cs:myboot.sectorsize
|
||||||
|
inc cx
|
||||||
|
dec bx
|
||||||
|
jnz writesectors
|
||||||
|
clc
|
||||||
|
pop si dx cx bx ax
|
||||||
|
ret
|
||||||
|
errorwriteincluster:
|
||||||
|
stc
|
||||||
|
pop si dx cx bx ax
|
||||||
|
ret
|
||||||
|
|
||||||
|
;=============READSECTOR (Fonction 01H)===============
|
||||||
|
;Lit le secteur CX et le met en es:di
|
||||||
|
;-> AH=1
|
||||||
|
;<- Flag Carry si erreur
|
||||||
|
;=====================================================
|
||||||
|
ReadSector:
|
||||||
|
push ax bx cx dx si
|
||||||
|
cmp cx,cs:lastread
|
||||||
|
jne gom
|
||||||
|
mov ax,es
|
||||||
|
cmp cs:lastseg,ax
|
||||||
|
jne gom
|
||||||
|
cmp di,cs:lastoff
|
||||||
|
jne gom
|
||||||
|
jmp done
|
||||||
|
gom:
|
||||||
|
mov cs:lastseg,ax
|
||||||
|
mov cs:lastoff,di
|
||||||
|
mov cs:LastRead,cx
|
||||||
|
mov ax,cx
|
||||||
|
xor dx,dx
|
||||||
|
div cs:myboot.SectorsPerTrack
|
||||||
|
inc dl
|
||||||
|
mov bl,dl
|
||||||
|
xor dx,dx
|
||||||
|
div cs:myboot.HeadsPerDrive
|
||||||
|
mov dh,cs:myboot.bootdrive
|
||||||
|
xchg dl,dh
|
||||||
|
mov cx,ax
|
||||||
|
xchg cl,ch
|
||||||
|
shl cl,6
|
||||||
|
or cl,bl
|
||||||
|
mov bx,di
|
||||||
|
mov SI,4
|
||||||
|
mov AL,1
|
||||||
|
TryAgain:
|
||||||
|
mov AH, 2
|
||||||
|
int 13h
|
||||||
|
jnc Done
|
||||||
|
dec SI
|
||||||
|
jnz TryAgain
|
||||||
|
Done:
|
||||||
|
pop si dx cx bx ax
|
||||||
|
ret
|
||||||
|
|
||||||
|
lastread dw 0
|
||||||
|
lastseg dw 0
|
||||||
|
lastoff dw 0
|
||||||
|
|
||||||
|
;=============WRITESECTOR (Fonction 02H)==============
|
||||||
|
;Ecrit le secteur CX pointé par ds:si
|
||||||
|
;-> AH=2
|
||||||
|
;<- Flag Carry si erreur
|
||||||
|
;=====================================================
|
||||||
|
WriteSector:
|
||||||
|
push ax bx cx dx si es
|
||||||
|
cmp cs:Lastread,cx
|
||||||
|
jne nodestruct
|
||||||
|
mov cs:Lastread,0ffffh
|
||||||
|
nodestruct:
|
||||||
|
push ds
|
||||||
|
pop es
|
||||||
|
mov ax,cx
|
||||||
|
xor dx,dx
|
||||||
|
div cs:myboot.SectorsPerTrack
|
||||||
|
inc dl
|
||||||
|
mov bl,dl
|
||||||
|
xor dx,dx
|
||||||
|
div cs:myboot.HeadsPerDrive
|
||||||
|
mov dh,cs:myboot.BootDrive
|
||||||
|
xchg dl,dh
|
||||||
|
mov cx,ax
|
||||||
|
xchg cl,ch
|
||||||
|
shl cl,6
|
||||||
|
or cl, bl
|
||||||
|
mov bx,si
|
||||||
|
mov SI, 4
|
||||||
|
mov AL,1
|
||||||
|
TryAgains:
|
||||||
|
mov AH, 3
|
||||||
|
int 13h
|
||||||
|
jnc Dones
|
||||||
|
dec SI
|
||||||
|
jnz TryAgains
|
||||||
|
Dones:
|
||||||
|
pop es si dx cx bx ax
|
||||||
|
ret
|
||||||
|
|
||||||
|
;=============Getname (Fonction 11)==============
|
||||||
|
;Renvoie le nom en ES:DI
|
||||||
|
;-> AH=11
|
||||||
|
;<- Flag Carry si erreur
|
||||||
|
;=====================================================
|
||||||
|
getname:
|
||||||
|
push ax cx dx si di ds es
|
||||||
|
push cs
|
||||||
|
pop ds
|
||||||
|
mov dx,di
|
||||||
|
mov si,offset myboot.DriveName
|
||||||
|
mov cx,11
|
||||||
|
rep movsb
|
||||||
|
mov al,' '
|
||||||
|
mov di,dx
|
||||||
|
mov cx,11
|
||||||
|
repne scasb
|
||||||
|
mov byte ptr es:[di],0
|
||||||
|
pop es ds di si dx cx ax
|
||||||
|
ret
|
||||||
|
|
||||||
|
;=============Getserial (Fonction 12)==============
|
||||||
|
;Renvoie le numéro de serie en EDX
|
||||||
|
;-> AH=12
|
||||||
|
;<- Flag Carry si erreur
|
||||||
|
;=====================================================
|
||||||
|
getserial:
|
||||||
|
mov edx,cs:myboot.serialnumber
|
||||||
|
ret
|
||||||
|
|
||||||
|
;=============VERIFYSECTOR (Fonction 03H)==============
|
||||||
|
;Vérifie le secteur CX
|
||||||
|
;-> AH=3
|
||||||
|
;<- Flag Carry si erreur, Flag Equal si secteurs égaux
|
||||||
|
;=====================================================
|
||||||
|
VerifySector:
|
||||||
|
push bx cx si di ds es
|
||||||
|
push cs
|
||||||
|
pop es
|
||||||
|
push cs
|
||||||
|
pop ds
|
||||||
|
mov bx,offset bufferread
|
||||||
|
call ReadSector
|
||||||
|
jc errorverify
|
||||||
|
call inverse
|
||||||
|
call WriteSector
|
||||||
|
jc errorverify
|
||||||
|
mov bx,offset bufferwrite
|
||||||
|
call ReadSector
|
||||||
|
call inverse
|
||||||
|
jc errorverify
|
||||||
|
mov bx,offset bufferread
|
||||||
|
call inverse
|
||||||
|
call WriteSector
|
||||||
|
jc errorverify
|
||||||
|
mov cx,cs:myboot.SectorSize
|
||||||
|
shr cx,2
|
||||||
|
mov si,offset bufferread
|
||||||
|
mov di,offset bufferwrite
|
||||||
|
cld
|
||||||
|
rep cmpsd
|
||||||
|
errorverify:
|
||||||
|
pop es ds di si cx bx
|
||||||
|
ret
|
||||||
|
|
||||||
|
Inverse:
|
||||||
|
mov si,cs:myboot.sectorsize
|
||||||
|
shr si,2
|
||||||
|
invert:
|
||||||
|
shl si,2
|
||||||
|
not dword ptr [bx+si-4]
|
||||||
|
shr si,2
|
||||||
|
dec si
|
||||||
|
jnz invert
|
||||||
|
ret
|
||||||
|
|
||||||
|
VerifySector2:
|
||||||
|
call verifysector
|
||||||
|
jne nook
|
||||||
|
or byte ptr [bp+6],10b
|
||||||
|
nook:
|
||||||
|
ret
|
||||||
|
|
||||||
|
;=============DecompressRle (Fonction 05H)==============
|
||||||
|
;decompress ds:si en es:di taille bp d‚compress‚ cx compress‚
|
||||||
|
;-> AH=5
|
||||||
|
;<- Flag Carry si erreur, Flag Equal si secteurs égaux
|
||||||
|
;=====================================================
|
||||||
|
DecompressRle:
|
||||||
|
push cx dx si di
|
||||||
|
mov dx,cx
|
||||||
|
mov bp,di
|
||||||
|
decompression:
|
||||||
|
mov eax,[si]
|
||||||
|
cmp al,'/'
|
||||||
|
jne nocomp
|
||||||
|
cmp si,07FFFh-6
|
||||||
|
jae thenen
|
||||||
|
mov ecx,eax
|
||||||
|
ror ecx,16
|
||||||
|
cmp cl,'*'
|
||||||
|
jne nocomp
|
||||||
|
cmp byte ptr [si+4],'/'
|
||||||
|
jne nocomp
|
||||||
|
mov al,ch
|
||||||
|
mov cl,ah
|
||||||
|
xor ah,ah
|
||||||
|
xor ch,ch
|
||||||
|
rep stosb
|
||||||
|
add si,5
|
||||||
|
sub dx,5
|
||||||
|
jnz decompression
|
||||||
|
jmp thenen
|
||||||
|
nocomp:
|
||||||
|
mov es:[di],al
|
||||||
|
inc si
|
||||||
|
inc di
|
||||||
|
dec dx
|
||||||
|
jnz decompression
|
||||||
|
thenen:
|
||||||
|
mov ax,dx
|
||||||
|
sub bp,di
|
||||||
|
neg bp
|
||||||
|
clc
|
||||||
|
pop di si dx cx
|
||||||
|
ret
|
||||||
|
|
||||||
|
;=============CompressRle (Fonction 06H)==============
|
||||||
|
;compress ds:si en es:di taille cx d‚compress‚ BP compress‚
|
||||||
|
;-> AH=6
|
||||||
|
;<- Flag Carry si erreur, Flag Equal si secteurs égaux
|
||||||
|
;=====================================================
|
||||||
|
CompressRle:
|
||||||
|
push ax bx cx dx si di ds es
|
||||||
|
mov bp,di
|
||||||
|
xchg si,di
|
||||||
|
push es
|
||||||
|
push ds
|
||||||
|
pop es
|
||||||
|
pop ds
|
||||||
|
mov dx,cx
|
||||||
|
;mov bp,cx
|
||||||
|
againcomp:
|
||||||
|
mov bx,di
|
||||||
|
mov al,es:[di]
|
||||||
|
mov cx,dx
|
||||||
|
cmp ch,0
|
||||||
|
je poo
|
||||||
|
mov cl,0ffh
|
||||||
|
;mov cx,bp
|
||||||
|
;sub cx,di
|
||||||
|
;mov ah,cl
|
||||||
|
poo:
|
||||||
|
mov ah,cl
|
||||||
|
inc di
|
||||||
|
xor ch,ch
|
||||||
|
repe scasb
|
||||||
|
sub cl,ah
|
||||||
|
neg cl
|
||||||
|
cmp cl,6
|
||||||
|
jbe nocomp2
|
||||||
|
mov dword ptr [si],' * /'
|
||||||
|
mov byte ptr [si+4],'/'
|
||||||
|
mov [si+1],cl
|
||||||
|
mov [si+3],al
|
||||||
|
add si,5
|
||||||
|
dec di
|
||||||
|
xor ch,ch
|
||||||
|
sub dx,cx
|
||||||
|
jnz againcomp
|
||||||
|
jmp fini
|
||||||
|
nocomp2:
|
||||||
|
mov [si],al
|
||||||
|
inc si
|
||||||
|
inc bx
|
||||||
|
mov di,bx
|
||||||
|
dec dx
|
||||||
|
jnz againcomp
|
||||||
|
fini:
|
||||||
|
sub bp,si
|
||||||
|
neg bp
|
||||||
|
clc
|
||||||
|
pop es ds di si dx cx bx ax
|
||||||
|
ret
|
||||||
|
|
||||||
|
;=============Changedir (Fonction 13)==============
|
||||||
|
;Change le repertoire courant a DS:SI
|
||||||
|
;-> AH=13
|
||||||
|
;<- Flag Carry si erreur, Flag Equal si secteurs égaux
|
||||||
|
;=====================================================
|
||||||
|
Changedir:
|
||||||
|
push ax cx dx si di ds es
|
||||||
|
push cs
|
||||||
|
pop es
|
||||||
|
;cmp [si],005Ch ;'\',0 (root dir)
|
||||||
|
mov di,offset tempdir
|
||||||
|
call searchfile
|
||||||
|
jc noch
|
||||||
|
mov cx,cs:tempdir.Filegroup
|
||||||
|
mov cs:CurrentDir,cx
|
||||||
|
mov cs:EntryPlace,0
|
||||||
|
mov cs:adressdirectory,cx
|
||||||
|
mov cs:firstsearch,1
|
||||||
|
cmp cs:[di],' ..'
|
||||||
|
jne notback
|
||||||
|
cmp cs:[di],' .'
|
||||||
|
je theend
|
||||||
|
mov di,offset currentdirstr
|
||||||
|
mov cx,128
|
||||||
|
mov al,0
|
||||||
|
repne scasb
|
||||||
|
mov al,'\'
|
||||||
|
std
|
||||||
|
repne scasb
|
||||||
|
cld
|
||||||
|
inc di
|
||||||
|
mov byte ptr es:[di],0
|
||||||
|
jmp theend
|
||||||
|
notback:
|
||||||
|
mov di,offset currentdirstr
|
||||||
|
mov cx,128
|
||||||
|
mov al,0
|
||||||
|
repne scasb
|
||||||
|
dec di
|
||||||
|
mov al,'\'
|
||||||
|
stosb
|
||||||
|
mov dx,di
|
||||||
|
push ds
|
||||||
|
pop es
|
||||||
|
mov di,si
|
||||||
|
mov cx,128
|
||||||
|
mov al,0
|
||||||
|
repne scasb
|
||||||
|
sub cx,128
|
||||||
|
neg cx
|
||||||
|
push cs
|
||||||
|
pop es
|
||||||
|
mov di,dx
|
||||||
|
rep movsb
|
||||||
|
theend:
|
||||||
|
pop es ds di si dx cx ax
|
||||||
|
clc
|
||||||
|
ret
|
||||||
|
noch:
|
||||||
|
pop es ds di si dx cx ax
|
||||||
|
stc
|
||||||
|
ret
|
||||||
|
|
||||||
|
tempdir db 32 dup (0)
|
||||||
|
|
||||||
|
;=============getdir (Fonction 16)==============
|
||||||
|
;Recupere le repertoire courant a ES:DI
|
||||||
|
;-> AH=16
|
||||||
|
;<- Flag Carry si erreur
|
||||||
|
;=====================================================
|
||||||
|
getdir:
|
||||||
|
push ax cx si di ds es
|
||||||
|
push es di
|
||||||
|
push cs
|
||||||
|
pop es
|
||||||
|
mov di,offset currentdirstr
|
||||||
|
mov cx,128
|
||||||
|
mov al,0
|
||||||
|
repne scasb
|
||||||
|
sub cx,128
|
||||||
|
neg cx
|
||||||
|
pop di es
|
||||||
|
push cs
|
||||||
|
pop ds
|
||||||
|
mov si,offset currentdirstr
|
||||||
|
rep movsb
|
||||||
|
pop es ds di si cx ax
|
||||||
|
clc
|
||||||
|
ret
|
||||||
|
|
||||||
|
|
||||||
|
bufferread equ $
|
||||||
|
bufferwrite equ $+2048
|
||||||
|
bufferentry equ $+2048+2048
|
||||||
|
bufferFat equ $+2048+2048+2048
|
||||||
|
|
||||||
|
end start
|
505
noyau/drive.asm
505
noyau/drive.asm
@ -1,505 +0,0 @@
|
|||||||
.model tiny
|
|
||||||
.486
|
|
||||||
smart
|
|
||||||
.code
|
|
||||||
|
|
||||||
org 0100h
|
|
||||||
|
|
||||||
|
|
||||||
start:
|
|
||||||
jmp tsr
|
|
||||||
db 'DRIVE'
|
|
||||||
Tsr:
|
|
||||||
cli
|
|
||||||
cmp ax,1234h
|
|
||||||
jne nomore
|
|
||||||
mov ax,4321h
|
|
||||||
jmp itsok
|
|
||||||
nomore:
|
|
||||||
push bx
|
|
||||||
mov bl,ah
|
|
||||||
xor bh,bh
|
|
||||||
shl bx,1
|
|
||||||
mov bx,cs:[bx].tables
|
|
||||||
mov cs:current,bx
|
|
||||||
pop bx
|
|
||||||
call cs:current
|
|
||||||
itsok:
|
|
||||||
jnc noerror
|
|
||||||
push bp
|
|
||||||
mov bp,sp
|
|
||||||
or byte ptr [bp+6],1b
|
|
||||||
pop bp
|
|
||||||
mov ax,cs
|
|
||||||
shl eax,16
|
|
||||||
mov ax,cs:current
|
|
||||||
jmp endofint
|
|
||||||
noerror:
|
|
||||||
push bp
|
|
||||||
mov bp,sp
|
|
||||||
and byte ptr [bp+6],0FEh
|
|
||||||
pop bp
|
|
||||||
endofint:
|
|
||||||
sti
|
|
||||||
iret
|
|
||||||
current dw 0
|
|
||||||
tables dw readsector
|
|
||||||
dw writesector
|
|
||||||
dw verifysector2
|
|
||||||
dw loadfatway
|
|
||||||
dw loadfile
|
|
||||||
dw compressrle
|
|
||||||
dw decompressrle
|
|
||||||
|
|
||||||
;cx entr‚e -> fatway chemin
|
|
||||||
getfatway:
|
|
||||||
push bx cx
|
|
||||||
mov bx,offset fatway
|
|
||||||
fatagain:
|
|
||||||
mov cs:[bx],cx
|
|
||||||
add bx,2
|
|
||||||
cmp cx,0FFF0h
|
|
||||||
jae finishload
|
|
||||||
call getfat
|
|
||||||
jnc fatagain
|
|
||||||
finishload:
|
|
||||||
pop cx bx
|
|
||||||
ret
|
|
||||||
|
|
||||||
;Charge le fichier de chemin cx -> taille dx
|
|
||||||
loadfatway:
|
|
||||||
push ax bx cx di
|
|
||||||
call getfatway
|
|
||||||
jc endload
|
|
||||||
mov di,offset fatway
|
|
||||||
xor dx,dx
|
|
||||||
loadagain:
|
|
||||||
mov cx,cs:[di]
|
|
||||||
cmp cx,0FFF0h
|
|
||||||
jae endload
|
|
||||||
add di,2
|
|
||||||
mov al,1
|
|
||||||
call readsector
|
|
||||||
jc endload
|
|
||||||
add bx,cs:sizec
|
|
||||||
add dx,cs:sizec
|
|
||||||
jmp loadagain
|
|
||||||
endload:
|
|
||||||
pop di cx bx ax
|
|
||||||
ret
|
|
||||||
|
|
||||||
|
|
||||||
;<-cx nøsecteur ->cx code FAT
|
|
||||||
getfat:
|
|
||||||
push es ax bx dx
|
|
||||||
push cs
|
|
||||||
pop ds
|
|
||||||
push cs
|
|
||||||
pop es
|
|
||||||
mov ax,cx
|
|
||||||
xor dx,dx
|
|
||||||
div sizec
|
|
||||||
mov cx,ax
|
|
||||||
add cx,reserv
|
|
||||||
mov bx,offset buffer
|
|
||||||
call readsector
|
|
||||||
jc errorgetfat
|
|
||||||
shl dx,1
|
|
||||||
add bx,dx
|
|
||||||
mov cx,[bx]
|
|
||||||
errorgetfat:
|
|
||||||
pop dx bx ax es
|
|
||||||
ret
|
|
||||||
|
|
||||||
ReadSector:
|
|
||||||
push ax cx dx si
|
|
||||||
cmp al,1
|
|
||||||
je pr
|
|
||||||
cmp cx,cs:lastread
|
|
||||||
je done
|
|
||||||
pr:
|
|
||||||
mov cs:LastRead,cx
|
|
||||||
mov AX, CX
|
|
||||||
xor DX, DX
|
|
||||||
div cs:DiskSectorsPerTrack
|
|
||||||
mov CL, DL ;{ Set the sector }
|
|
||||||
and CL, 63 ;{ Top two bits are bits 8&9 of the cylinder }
|
|
||||||
xor DX, DX
|
|
||||||
div cs:DiskTracksPerHead
|
|
||||||
mov CH, DL ;{ Set the track bits 0-7 }
|
|
||||||
mov AL, DH
|
|
||||||
ror AL, 1
|
|
||||||
ror AL, 1
|
|
||||||
and AL, 11000000b
|
|
||||||
or CL, AL ;{ Set bits 8&9 of track }
|
|
||||||
xor dX, DX
|
|
||||||
div cs:DiskHeads
|
|
||||||
mov DH, DL ;{ Set the head }
|
|
||||||
inc CL
|
|
||||||
mov SI, 4
|
|
||||||
TryAgain:
|
|
||||||
mov AL, 1
|
|
||||||
mov DL, 0
|
|
||||||
mov AH, 2
|
|
||||||
int 13h
|
|
||||||
jnc Done
|
|
||||||
dec SI
|
|
||||||
jnz TryAgain
|
|
||||||
mov word ptr cs:lastread,0ffffh
|
|
||||||
Done:
|
|
||||||
pop si dx cx ax
|
|
||||||
ret
|
|
||||||
|
|
||||||
WriteSector:
|
|
||||||
push ax cx dx si
|
|
||||||
cmp cs:Lastread,cx
|
|
||||||
jne nodestruct
|
|
||||||
mov cs:Lastread,0ffffh
|
|
||||||
nodestruct:
|
|
||||||
mov AX, CX
|
|
||||||
xor DX, DX
|
|
||||||
div cs:DiskSectorsPerTrack
|
|
||||||
mov CL, DL ;{ Set the sector }
|
|
||||||
and CL, 63 ;{ Top two bits are bits 8&9 of the cylinder }
|
|
||||||
xor DX, DX
|
|
||||||
div cs:DiskTracksPerHead
|
|
||||||
mov CH, DL ;{ Set the track bits 0-7 }
|
|
||||||
mov AL, DH
|
|
||||||
ror AL, 1
|
|
||||||
ror AL, 1
|
|
||||||
and AL, 11000000b
|
|
||||||
or CL, AL ;{ Set bits 8&9 of track }
|
|
||||||
xor DX, DX
|
|
||||||
div cs:DiskHeads
|
|
||||||
mov DH, DL ;{ Set the head }
|
|
||||||
inc CL
|
|
||||||
mov SI, 4
|
|
||||||
TryAgain2:
|
|
||||||
mov AL, 1
|
|
||||||
mov DL, 0
|
|
||||||
mov AH, 3
|
|
||||||
int 13h
|
|
||||||
jnc Done2
|
|
||||||
dec SI
|
|
||||||
jnz TryAgain2
|
|
||||||
Done2:
|
|
||||||
pop si dx cx ax
|
|
||||||
ret
|
|
||||||
|
|
||||||
Lastread dw 0FFFFh
|
|
||||||
|
|
||||||
Inverse:
|
|
||||||
mov si,512/4
|
|
||||||
invert:
|
|
||||||
shl si,2
|
|
||||||
not dword ptr [bx+si-4]
|
|
||||||
shr si,2
|
|
||||||
dec si
|
|
||||||
jnz invert
|
|
||||||
ret
|
|
||||||
|
|
||||||
VerifySector:
|
|
||||||
push bx cx si di ds es
|
|
||||||
push cs
|
|
||||||
pop es
|
|
||||||
push cs
|
|
||||||
pop ds
|
|
||||||
mov bx,offset buffer
|
|
||||||
call ReadSector
|
|
||||||
jc errorverify
|
|
||||||
call inverse
|
|
||||||
call WriteSector
|
|
||||||
jc errorverify
|
|
||||||
mov bx,offset buffer2
|
|
||||||
call ReadSector
|
|
||||||
call inverse
|
|
||||||
jc errorverify
|
|
||||||
mov bx,offset buffer
|
|
||||||
call inverse
|
|
||||||
call WriteSector
|
|
||||||
jc errorverify
|
|
||||||
mov cx,512/4
|
|
||||||
mov si,offset buffer
|
|
||||||
mov di,offset buffer2
|
|
||||||
cld
|
|
||||||
rep cmpsd
|
|
||||||
errorverify:
|
|
||||||
pop es ds di si cx bx
|
|
||||||
ret
|
|
||||||
|
|
||||||
VerifySector2:
|
|
||||||
call verifysector
|
|
||||||
jne nook
|
|
||||||
or byte ptr [bp+6],10b
|
|
||||||
nook:
|
|
||||||
ret
|
|
||||||
|
|
||||||
;Charge le fichier Ds:si en es:di taille-> cx
|
|
||||||
loadfile:
|
|
||||||
push bx
|
|
||||||
call searchfile
|
|
||||||
jc errorloadfile
|
|
||||||
mov bx,di
|
|
||||||
call loadfatway
|
|
||||||
jc errorloadfile
|
|
||||||
mov cx,dx
|
|
||||||
errorloadfile:
|
|
||||||
pop bx
|
|
||||||
ret
|
|
||||||
|
|
||||||
;Recherche le fichier et retourne sont path et en cx sont debut
|
|
||||||
Searchfile:
|
|
||||||
push ax bx dx si di ds es
|
|
||||||
push cs
|
|
||||||
pop es
|
|
||||||
xor dx,dx
|
|
||||||
mov di,offset temp
|
|
||||||
call asciiztofit
|
|
||||||
push cs
|
|
||||||
pop ds
|
|
||||||
mov cx,13
|
|
||||||
check:
|
|
||||||
mov al,1
|
|
||||||
mov bx,offset buffer
|
|
||||||
call readsector
|
|
||||||
jc errorboot
|
|
||||||
xor di,di
|
|
||||||
findnext:
|
|
||||||
cmp byte ptr [bx+di],0
|
|
||||||
je errorboot
|
|
||||||
push si di cx
|
|
||||||
mov si,di
|
|
||||||
add si,bx
|
|
||||||
mov di,offset temp
|
|
||||||
mov cx,12+4
|
|
||||||
cld
|
|
||||||
rep cmpsb
|
|
||||||
pop cx di si
|
|
||||||
je oksystem
|
|
||||||
add di,32
|
|
||||||
inc dx
|
|
||||||
cmp dx,nbfit
|
|
||||||
ja errorboot
|
|
||||||
cmp di,sizec
|
|
||||||
jb findnext
|
|
||||||
inc cx
|
|
||||||
jmp Check
|
|
||||||
oksystem:
|
|
||||||
mov cx,[di+BX+26]
|
|
||||||
cld
|
|
||||||
jmp goodboot
|
|
||||||
errorboot:
|
|
||||||
stc
|
|
||||||
goodboot:
|
|
||||||
pop es ds di si dx bx ax
|
|
||||||
ret
|
|
||||||
|
|
||||||
;->name ds:si ->es:di
|
|
||||||
AsciiZtoFit:
|
|
||||||
push ax bx cx dx si di ds es
|
|
||||||
xor bx,bx
|
|
||||||
mov dx,di
|
|
||||||
noextens:
|
|
||||||
mov al,[si+bx]
|
|
||||||
cmp al,'.'
|
|
||||||
je extens
|
|
||||||
call Issystchar
|
|
||||||
jc errortranslate
|
|
||||||
mov es:[di],al
|
|
||||||
inc di
|
|
||||||
inc bx
|
|
||||||
cmp bx,namesize ;(.)
|
|
||||||
jne noextens
|
|
||||||
erro:
|
|
||||||
stc
|
|
||||||
jmp errortranslate
|
|
||||||
extens:
|
|
||||||
add si,bx
|
|
||||||
inc si
|
|
||||||
sub bx,namesize
|
|
||||||
neg bx
|
|
||||||
mov al,0
|
|
||||||
mov cx,bx
|
|
||||||
cld
|
|
||||||
rep stosb
|
|
||||||
xor bx,bx
|
|
||||||
wasextens:
|
|
||||||
mov al,[si+bx]
|
|
||||||
cmp al,0
|
|
||||||
je endextens
|
|
||||||
call Issystchar
|
|
||||||
jc errortranslate
|
|
||||||
mov es:[di],al
|
|
||||||
inc di
|
|
||||||
inc bx
|
|
||||||
cmp bx,extsize
|
|
||||||
jne wasextens
|
|
||||||
jmp erro
|
|
||||||
endextens:
|
|
||||||
sub bx,extsize
|
|
||||||
neg bx
|
|
||||||
mov al,0
|
|
||||||
mov cx,bx
|
|
||||||
cld
|
|
||||||
rep stosb
|
|
||||||
mov si,dx
|
|
||||||
mov di,dx
|
|
||||||
push es
|
|
||||||
pop ds
|
|
||||||
mov cx,extsize+namesize
|
|
||||||
call uppercaseMEM
|
|
||||||
clc
|
|
||||||
endtranslate:
|
|
||||||
pop es ds di si dx cx bx ax
|
|
||||||
ret
|
|
||||||
errortranslate:
|
|
||||||
stc
|
|
||||||
jmp endtranslate
|
|
||||||
|
|
||||||
;Carry si al = caractŠre systŠme
|
|
||||||
isSystchar:
|
|
||||||
push di
|
|
||||||
mov di,offset exeptchar
|
|
||||||
isexcept:
|
|
||||||
cmp al,cs:[di]
|
|
||||||
je nogood
|
|
||||||
inc di
|
|
||||||
cmp byte ptr cs:[di],0
|
|
||||||
jne isexcept
|
|
||||||
endanal:
|
|
||||||
clc
|
|
||||||
pop di
|
|
||||||
ret
|
|
||||||
nogood:
|
|
||||||
stc
|
|
||||||
jmp endanal
|
|
||||||
|
|
||||||
;Transforme les x caractŠres de la mem en ds:si en maj
|
|
||||||
uppercaseMEM:
|
|
||||||
push si di cx ax
|
|
||||||
mov di,si
|
|
||||||
uppercaser:
|
|
||||||
mov al,ds:[si]
|
|
||||||
inc si
|
|
||||||
cmp al,'A'
|
|
||||||
jb nonmaj
|
|
||||||
cmp al,'Z'
|
|
||||||
ja nonmaj
|
|
||||||
add al,'a'-'A'
|
|
||||||
nonmaj:
|
|
||||||
mov es:[di],al
|
|
||||||
inc di
|
|
||||||
dec cx
|
|
||||||
jnz uppercaser
|
|
||||||
enduppercase:
|
|
||||||
clc
|
|
||||||
pop ax cx di si
|
|
||||||
ret
|
|
||||||
|
|
||||||
;decompress ds:si en es:di taille bp d‚compress‚ cx compress‚
|
|
||||||
DecompressRle:
|
|
||||||
push cx dx si di
|
|
||||||
mov dx,cx
|
|
||||||
mov bp,di
|
|
||||||
decompression:
|
|
||||||
mov eax,[si]
|
|
||||||
cmp al,'/'
|
|
||||||
jne nocomp
|
|
||||||
cmp si,07FFFh-6
|
|
||||||
jae thenen
|
|
||||||
mov ecx,eax
|
|
||||||
ror ecx,16
|
|
||||||
cmp cl,'*'
|
|
||||||
jne nocomp
|
|
||||||
cmp byte ptr [si+4],'/'
|
|
||||||
jne nocomp
|
|
||||||
mov al,ch
|
|
||||||
mov cl,ah
|
|
||||||
xor ah,ah
|
|
||||||
xor ch,ch
|
|
||||||
rep stosb
|
|
||||||
add si,5
|
|
||||||
sub dx,5
|
|
||||||
jnz decompression
|
|
||||||
jmp thenen
|
|
||||||
nocomp:
|
|
||||||
mov es:[di],al
|
|
||||||
inc si
|
|
||||||
inc di
|
|
||||||
dec dx
|
|
||||||
jnz decompression
|
|
||||||
thenen:
|
|
||||||
mov ax,dx
|
|
||||||
sub bp,di
|
|
||||||
neg bp
|
|
||||||
pop di si dx cx
|
|
||||||
ret
|
|
||||||
|
|
||||||
;compress ds:si en es:di taille cx d‚compress‚ BP compress‚
|
|
||||||
CompressRle:
|
|
||||||
push ax bx cx dx si di ds es
|
|
||||||
mov bp,di
|
|
||||||
xchg si,di
|
|
||||||
push es
|
|
||||||
push ds
|
|
||||||
pop es
|
|
||||||
pop ds
|
|
||||||
mov dx,cx
|
|
||||||
;mov bp,cx
|
|
||||||
againcomp:
|
|
||||||
mov bx,di
|
|
||||||
mov al,es:[di]
|
|
||||||
mov cx,dx
|
|
||||||
cmp ch,0
|
|
||||||
je poo
|
|
||||||
mov cl,0ffh
|
|
||||||
;mov cx,bp
|
|
||||||
;sub cx,di
|
|
||||||
;mov ah,cl
|
|
||||||
poo:
|
|
||||||
mov ah,cl
|
|
||||||
inc di
|
|
||||||
xor ch,ch
|
|
||||||
repe scasb
|
|
||||||
sub cl,ah
|
|
||||||
neg cl
|
|
||||||
cmp cl,6
|
|
||||||
jbe nocomp2
|
|
||||||
mov dword ptr [si],' * /'
|
|
||||||
mov byte ptr [si+4],'/'
|
|
||||||
mov [si+1],cl
|
|
||||||
mov [si+3],al
|
|
||||||
add si,5
|
|
||||||
dec di
|
|
||||||
xor ch,ch
|
|
||||||
sub dx,cx
|
|
||||||
jnz againcomp
|
|
||||||
jmp fini
|
|
||||||
nocomp2:
|
|
||||||
mov [si],al
|
|
||||||
inc si
|
|
||||||
inc bx
|
|
||||||
mov di,bx
|
|
||||||
dec dx
|
|
||||||
jnz againcomp
|
|
||||||
fini:
|
|
||||||
sub bp,si
|
|
||||||
neg bp
|
|
||||||
pop es ds di si dx cx bx ax
|
|
||||||
ret
|
|
||||||
|
|
||||||
nbfit equ 255
|
|
||||||
namesize equ 12
|
|
||||||
extsize equ 5
|
|
||||||
exeptchar db '/\<>:|.',01,0,0
|
|
||||||
temp db 12+5+1+90 dup (0)
|
|
||||||
DiskSectorsPerTrack dw 18
|
|
||||||
DiskTracksPerHead dw 80
|
|
||||||
DiskHeads dw 2
|
|
||||||
sizec dw 512
|
|
||||||
reserv dw 1
|
|
||||||
buffer equ $
|
|
||||||
buffer2 equ $+512
|
|
||||||
fatway equ $+512
|
|
||||||
|
|
||||||
end start
|
|
BIN
noyau/font/2_hebrew.fnt
Normal file
BIN
noyau/font/2_hebrew.fnt
Normal file
Binary file not shown.
BIN
noyau/font/8x11snsf.fnt
Normal file
BIN
noyau/font/8x11snsf.fnt
Normal file
Binary file not shown.
BIN
noyau/font/ad&d.fnt
Normal file
BIN
noyau/font/ad&d.fnt
Normal file
Binary file not shown.
BIN
noyau/font/antique.fnt
Normal file
BIN
noyau/font/antique.fnt
Normal file
Binary file not shown.
BIN
noyau/font/applicat.fnt
Normal file
BIN
noyau/font/applicat.fnt
Normal file
Binary file not shown.
BIN
noyau/font/backward.fnt
Normal file
BIN
noyau/font/backward.fnt
Normal file
Binary file not shown.
BIN
noyau/font/bigserif.fnt
Normal file
BIN
noyau/font/bigserif.fnt
Normal file
Binary file not shown.
BIN
noyau/font/blcksnsf.fnt
Normal file
BIN
noyau/font/blcksnsf.fnt
Normal file
Binary file not shown.
BIN
noyau/font/block.fnt
Normal file
BIN
noyau/font/block.fnt
Normal file
Binary file not shown.
BIN
noyau/font/bold.fnt
Normal file
BIN
noyau/font/bold.fnt
Normal file
Binary file not shown.
BIN
noyau/font/breeze.fnt
Normal file
BIN
noyau/font/breeze.fnt
Normal file
Binary file not shown.
BIN
noyau/font/broadway.fnt
Normal file
BIN
noyau/font/broadway.fnt
Normal file
Binary file not shown.
BIN
noyau/font/comp.fnt
Normal file
BIN
noyau/font/comp.fnt
Normal file
Binary file not shown.
BIN
noyau/font/computer.fnt
Normal file
BIN
noyau/font/computer.fnt
Normal file
Binary file not shown.
BIN
noyau/font/courier.fnt
Normal file
BIN
noyau/font/courier.fnt
Normal file
Binary file not shown.
BIN
noyau/font/cyrillic.fnt
Normal file
BIN
noyau/font/cyrillic.fnt
Normal file
Binary file not shown.
BIN
noyau/font/dblmtx14.fnt
Normal file
BIN
noyau/font/dblmtx14.fnt
Normal file
Binary file not shown.
BIN
noyau/font/dblmtx16.fnt
Normal file
BIN
noyau/font/dblmtx16.fnt
Normal file
Binary file not shown.
BIN
noyau/font/finnish.fnt
Normal file
BIN
noyau/font/finnish.fnt
Normal file
Binary file not shown.
BIN
noyau/font/font1!!!.dat
Normal file
BIN
noyau/font/font1!!!.dat
Normal file
Binary file not shown.
BIN
noyau/font/font2!!!.dat
Normal file
BIN
noyau/font/font2!!!.dat
Normal file
Binary file not shown.
BIN
noyau/font/font3!!!.dat
Normal file
BIN
noyau/font/font3!!!.dat
Normal file
Binary file not shown.
BIN
noyau/font/font4!!!.dat
Normal file
BIN
noyau/font/font4!!!.dat
Normal file
Binary file not shown.
BIN
noyau/font/frankfrt.fnt
Normal file
BIN
noyau/font/frankfrt.fnt
Normal file
Binary file not shown.
BIN
noyau/font/fresno.fnt
Normal file
BIN
noyau/font/fresno.fnt
Normal file
Binary file not shown.
BIN
noyau/font/future.fnt
Normal file
BIN
noyau/font/future.fnt
Normal file
Binary file not shown.
BIN
noyau/font/greek.fnt
Normal file
BIN
noyau/font/greek.fnt
Normal file
Binary file not shown.
BIN
noyau/font/hebrew.fnt
Normal file
BIN
noyau/font/hebrew.fnt
Normal file
Binary file not shown.
BIN
noyau/font/hollow.fnt
Normal file
BIN
noyau/font/hollow.fnt
Normal file
Binary file not shown.
BIN
noyau/font/hylas.fnt
Normal file
BIN
noyau/font/hylas.fnt
Normal file
Binary file not shown.
BIN
noyau/font/inverted.fnt
Normal file
BIN
noyau/font/inverted.fnt
Normal file
Binary file not shown.
BIN
noyau/font/italic.fnt
Normal file
BIN
noyau/font/italic.fnt
Normal file
Binary file not shown.
BIN
noyau/font/italics.fnt
Normal file
BIN
noyau/font/italics.fnt
Normal file
Binary file not shown.
BIN
noyau/font/itt.fnt
Normal file
BIN
noyau/font/itt.fnt
Normal file
Binary file not shown.
BIN
noyau/font/lcd.fnt
Normal file
BIN
noyau/font/lcd.fnt
Normal file
Binary file not shown.
BIN
noyau/font/mechanix.fnt
Normal file
BIN
noyau/font/mechanix.fnt
Normal file
Binary file not shown.
BIN
noyau/font/medieval.fnt
Normal file
BIN
noyau/font/medieval.fnt
Normal file
Binary file not shown.
BIN
noyau/font/modern-1.fnt
Normal file
BIN
noyau/font/modern-1.fnt
Normal file
Binary file not shown.
BIN
noyau/font/norway.fnt
Normal file
BIN
noyau/font/norway.fnt
Normal file
Binary file not shown.
BIN
noyau/font/norway2.fnt
Normal file
BIN
noyau/font/norway2.fnt
Normal file
Binary file not shown.
0
noyau/thin8x8.fnt → noyau/font/old8x8.fnt
Executable file → Normal file
0
noyau/thin8x8.fnt → noyau/font/old8x8.fnt
Executable file → Normal file
BIN
noyau/font/oldeng.fnt
Normal file
BIN
noyau/font/oldeng.fnt
Normal file
Binary file not shown.
BIN
noyau/font/roman.fnt
Normal file
BIN
noyau/font/roman.fnt
Normal file
Binary file not shown.
BIN
noyau/font/sanserif.fnt
Normal file
BIN
noyau/font/sanserif.fnt
Normal file
Binary file not shown.
BIN
noyau/font/script.fnt
Normal file
BIN
noyau/font/script.fnt
Normal file
Binary file not shown.
BIN
noyau/font/standard.fnt
Normal file
BIN
noyau/font/standard.fnt
Normal file
Binary file not shown.
BIN
noyau/font/stretch.fnt
Normal file
BIN
noyau/font/stretch.fnt
Normal file
Binary file not shown.
BIN
noyau/font/thai.fnt
Normal file
BIN
noyau/font/thai.fnt
Normal file
Binary file not shown.
BIN
noyau/font/thin.fnt
Normal file
BIN
noyau/font/thin.fnt
Normal file
Binary file not shown.
911
noyau/format.asm
Normal file
911
noyau/format.asm
Normal file
@ -0,0 +1,911 @@
|
|||||||
|
.model tiny
|
||||||
|
.486
|
||||||
|
smart
|
||||||
|
.code
|
||||||
|
|
||||||
|
org 0100h
|
||||||
|
|
||||||
|
start:
|
||||||
|
jmp tsr ;Saute à la routine résidente
|
||||||
|
names db 'FORMAT' ;Nom drivers
|
||||||
|
id dw 1234h ;Identifiant drivers
|
||||||
|
Tsr:
|
||||||
|
cli ;Désactive interruptions logiciellement
|
||||||
|
cmp ax,cs:ID ;Compare si test de chargement
|
||||||
|
jne nomore ;Si pas test alors on continu
|
||||||
|
rol ax,3*4 ;Rotation de 3 chiffre de l'ID pour montrer que le drivers est chargé
|
||||||
|
jmp itsok ;On termine l'int avec notre code d'ID preuve du bon chargement de VIDEO
|
||||||
|
nomore:
|
||||||
|
cmp ah,maxfunc
|
||||||
|
jbe noerrorint
|
||||||
|
stc
|
||||||
|
jmp itsok
|
||||||
|
noerrorint:
|
||||||
|
clc
|
||||||
|
push bx
|
||||||
|
mov bl,ah ;On calcule d'aprés le n° de fonction
|
||||||
|
xor bh,bh ;quel sera l'entrée dans la table indexée
|
||||||
|
shl bx,1 ;des adresses fonctions.
|
||||||
|
mov bx,cs:[bx+tables] ;On récupère cette adresse depuis la table
|
||||||
|
mov cs:current,bx ;On la stocke temporairement pour obtenir les registres d'origine
|
||||||
|
pop bx
|
||||||
|
clc
|
||||||
|
call cs:current ;Puis on execute la fonction
|
||||||
|
itsok:
|
||||||
|
push bp
|
||||||
|
mov bp,sp ;On prend sp dans bp pour adresser la pile
|
||||||
|
jnc noerror ;La fonction appelée a renvoyer une erreur : Flag CARRY ?
|
||||||
|
or byte ptr [bp+6],1b;Si oui on le retranscrit sur le registre FLAG qui sera dépilé lors du IRET
|
||||||
|
;xor eax,eax
|
||||||
|
;mov ax,cs ;On récupère le segment et l'offset puis en renvoie l'adresse physique
|
||||||
|
;shl eax,4 ;de l'erreur.
|
||||||
|
;add ax,cs:current
|
||||||
|
;jmp endofint ;on termine l'int
|
||||||
|
noerror:
|
||||||
|
and byte ptr [bp+6],0FEh;Si pas d'erreur on efface le Bit CARRY du FLAG qui sera dépilé lors du IRET
|
||||||
|
endofint:
|
||||||
|
pop bp
|
||||||
|
sti ;On réactive les interruptions logiciellement
|
||||||
|
iret ;Puis on retourne au programme appelant.
|
||||||
|
|
||||||
|
current dw 0 ;Mot temporaire qui contient l'adresse de la fonction appelée
|
||||||
|
tables dw setvideomode ;Table qui contient les adresses de toutes les fonctions de VIDEO (WORD)
|
||||||
|
|
||||||
|
|
||||||
|
;Librairie qui prend en charge le format de STR ASCIIZ
|
||||||
|
;# nombre 8
|
||||||
|
;@ str 7
|
||||||
|
;& nom 6
|
||||||
|
|
||||||
|
;High Low
|
||||||
|
;0 variable 4 hex
|
||||||
|
;1 byte 3 dec
|
||||||
|
;2 word 2 oct
|
||||||
|
;3 3 octets 1 bin
|
||||||
|
;4 dword 5 adresse
|
||||||
|
;5 5 octets 6 nom
|
||||||
|
;6 ... 7 str
|
||||||
|
; 8 nombre
|
||||||
|
|
||||||
|
|
||||||
|
;Renvoie carry si la syntaxe de ds:si n'est pas respect‚ par rapport a es:di
|
||||||
|
CheckSyntax0:
|
||||||
|
push ax bx dx bp si di ds es
|
||||||
|
push es di
|
||||||
|
push cs
|
||||||
|
pop es
|
||||||
|
mov di,offset temp2
|
||||||
|
call copy0
|
||||||
|
mov si,di
|
||||||
|
push cs
|
||||||
|
pop ds
|
||||||
|
pop di es
|
||||||
|
call getdelimiter0
|
||||||
|
mov bp,dx
|
||||||
|
mov dl,' '
|
||||||
|
call setdelimiter0
|
||||||
|
call compressdelimiter0
|
||||||
|
call uppercase0
|
||||||
|
call getnbitems0
|
||||||
|
;call xch
|
||||||
|
;mov ax,cx
|
||||||
|
;call getnbitem0
|
||||||
|
;call xch
|
||||||
|
;cmp ax,cx
|
||||||
|
;call xch
|
||||||
|
;jne notequalatall
|
||||||
|
mov bx,cx
|
||||||
|
xor cx,cx
|
||||||
|
itemer:
|
||||||
|
call whatisitem0
|
||||||
|
mov dx,ax
|
||||||
|
call xch
|
||||||
|
call whatisitem0
|
||||||
|
call xch
|
||||||
|
cmp ax,dx
|
||||||
|
jne prob
|
||||||
|
cmp al,6
|
||||||
|
jb equal
|
||||||
|
call cmpitems0
|
||||||
|
je equal
|
||||||
|
prob:
|
||||||
|
cmp dl,4
|
||||||
|
ja nosize
|
||||||
|
cmp al,8
|
||||||
|
je equal
|
||||||
|
cmp al,4
|
||||||
|
jne notequalatall
|
||||||
|
cmp dh,ah
|
||||||
|
ja notequalatall
|
||||||
|
jmp equal
|
||||||
|
nosize:
|
||||||
|
cmp al,7
|
||||||
|
jne noname
|
||||||
|
cmp ah,0
|
||||||
|
jne notequalatall
|
||||||
|
jmp equal
|
||||||
|
noname:
|
||||||
|
cmp al,8
|
||||||
|
je equal
|
||||||
|
jmp notequalatall
|
||||||
|
equal:
|
||||||
|
inc cx
|
||||||
|
cmp cx,bx
|
||||||
|
jne itemer
|
||||||
|
cld
|
||||||
|
ackno:
|
||||||
|
mov dx,bp
|
||||||
|
call setdelimiter0
|
||||||
|
pop es ds di si bp dx bx ax
|
||||||
|
ret
|
||||||
|
notequalatall:
|
||||||
|
stc
|
||||||
|
jmp ackno
|
||||||
|
xch:
|
||||||
|
push ds
|
||||||
|
push es
|
||||||
|
pop ds
|
||||||
|
pop es
|
||||||
|
xchg si,di
|
||||||
|
ret
|
||||||
|
|
||||||
|
temp2 db 256 dup (0)
|
||||||
|
|
||||||
|
;Compare les ‚l‚ments cx de deux chaine ds:si et es:di
|
||||||
|
Cmpitems0:
|
||||||
|
push cx dx si di
|
||||||
|
push cx di
|
||||||
|
call getpointeritem0
|
||||||
|
mov si,di
|
||||||
|
xor cx,cx
|
||||||
|
inc cx
|
||||||
|
call getpointeritem0
|
||||||
|
mov dx,di
|
||||||
|
sub dx,si
|
||||||
|
dec cx
|
||||||
|
pop di cx
|
||||||
|
push ds si
|
||||||
|
push es
|
||||||
|
pop ds
|
||||||
|
mov si,di
|
||||||
|
call getpointeritem0
|
||||||
|
pop si ds
|
||||||
|
mov cx,dx
|
||||||
|
rep cmpsb
|
||||||
|
pop di si dx cx
|
||||||
|
ret
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
;Renvoie l'‚l‚ment cx de ds:si dans edx si nb et dans es:di si str ou name
|
||||||
|
gettypeditem0:
|
||||||
|
push bx cx si
|
||||||
|
call getpointeritem0
|
||||||
|
mov si,di
|
||||||
|
xor cx,cx
|
||||||
|
inc cl
|
||||||
|
call getpointeritem0
|
||||||
|
mov bx,di
|
||||||
|
dec bx
|
||||||
|
mov cl,0
|
||||||
|
xchg cl,ds:[bx]
|
||||||
|
call gettyped0
|
||||||
|
xchg cl,ds:[bx]
|
||||||
|
pop si cx bx
|
||||||
|
ret
|
||||||
|
|
||||||
|
;Renvoie ds:si dans edx si nb et dans es:di si str ou name
|
||||||
|
gettyped0:
|
||||||
|
push ax
|
||||||
|
call whatis0
|
||||||
|
cmp al,5
|
||||||
|
jb number
|
||||||
|
cmp al,6
|
||||||
|
je pointer
|
||||||
|
push ds
|
||||||
|
pop es
|
||||||
|
call getpointeritem0
|
||||||
|
jmp endofGettypeditem0
|
||||||
|
number:
|
||||||
|
mov edx,cs:lastnumber
|
||||||
|
jmp endofgettypeditem0
|
||||||
|
pointer:
|
||||||
|
call str0toadress
|
||||||
|
endofgettypeditem0:
|
||||||
|
pop ax
|
||||||
|
ret
|
||||||
|
|
||||||
|
;Renvoie dans ax le type de la str0 point‚e par ds:si ‚l‚ment cx
|
||||||
|
whatisitem0:
|
||||||
|
push bx cx si di
|
||||||
|
call getpointeritem0
|
||||||
|
mov si,di
|
||||||
|
xor cx,cx
|
||||||
|
inc cl
|
||||||
|
call getpointeritem0
|
||||||
|
mov bx,di
|
||||||
|
dec bx
|
||||||
|
mov cl,0
|
||||||
|
xchg cl,ds:[bx]
|
||||||
|
call whatis0
|
||||||
|
xchg cl,ds:[bx]
|
||||||
|
pop di si cx bx
|
||||||
|
ret
|
||||||
|
|
||||||
|
;Renvoie dans ax le type de la str0 point‚e par ds:si
|
||||||
|
;High Low
|
||||||
|
;0 variable 4 hex
|
||||||
|
;1 byte 3 dec
|
||||||
|
;2 word 2 oct
|
||||||
|
;3 3 octets 1 bin
|
||||||
|
;4 dword 5 adresse
|
||||||
|
;5 5 octets 6 name
|
||||||
|
;6 ... 7 str
|
||||||
|
whatis0:
|
||||||
|
push bx cx edx
|
||||||
|
mov cl,2
|
||||||
|
call str0isbase
|
||||||
|
jnc finbase
|
||||||
|
mov cl,8
|
||||||
|
call str0isbase
|
||||||
|
jnc finbase
|
||||||
|
mov cl,10
|
||||||
|
call str0isbase
|
||||||
|
jnc finbase
|
||||||
|
mov cl,16
|
||||||
|
call str0isbase
|
||||||
|
jc testadress
|
||||||
|
finbase:
|
||||||
|
mov bx,cx
|
||||||
|
xor ch,ch
|
||||||
|
mov al,cs:[bx+offset basenn-2]
|
||||||
|
call str0toint
|
||||||
|
mov cs:Lastnumber,edx
|
||||||
|
cmp edx,0000FFFFh
|
||||||
|
ja bits32
|
||||||
|
cmp dx,00FFh
|
||||||
|
ja bits16
|
||||||
|
mov ah,1
|
||||||
|
jmp endofwhat
|
||||||
|
bits16:
|
||||||
|
mov ah,2
|
||||||
|
jmp endofwhat
|
||||||
|
bits32:
|
||||||
|
mov ah,3
|
||||||
|
jmp endofwhat
|
||||||
|
testadress:
|
||||||
|
call str0isadress
|
||||||
|
jc testname
|
||||||
|
mov ax,0005h
|
||||||
|
jmp endofwhat
|
||||||
|
testname:
|
||||||
|
;call str0isname
|
||||||
|
;jc testvarstr
|
||||||
|
;jnc isok
|
||||||
|
;mov al,06h
|
||||||
|
cmp byte ptr [si],'&'
|
||||||
|
jne testvarstr
|
||||||
|
mov al,06h
|
||||||
|
call getlength0
|
||||||
|
dec cl
|
||||||
|
mov ah,cl
|
||||||
|
jmp endofwhat
|
||||||
|
testvarstr:
|
||||||
|
cmp byte ptr [si],'@'
|
||||||
|
jne testnumber
|
||||||
|
mov al,07h
|
||||||
|
call getlength0
|
||||||
|
dec cl
|
||||||
|
mov ah,cl
|
||||||
|
jmp endofwhat
|
||||||
|
testnumber:
|
||||||
|
cmp byte ptr [si],'#'
|
||||||
|
jne isstr
|
||||||
|
mov al,8
|
||||||
|
call getlength0
|
||||||
|
dec cl
|
||||||
|
mov ah,cl
|
||||||
|
jmp endofwhat
|
||||||
|
isstr:
|
||||||
|
mov al,07h
|
||||||
|
call getlength0
|
||||||
|
mov ah,cl
|
||||||
|
endofwhat:
|
||||||
|
pop edx cx bx
|
||||||
|
ret
|
||||||
|
|
||||||
|
Lastnumber dd 0
|
||||||
|
|
||||||
|
;Renvoie non carry si la str ds:si point‚e peut ˆtre une adresse
|
||||||
|
str0isadress:
|
||||||
|
;push
|
||||||
|
stc
|
||||||
|
;pop
|
||||||
|
ret
|
||||||
|
|
||||||
|
;Renvoie en es:di le pointeur str0 ds:si
|
||||||
|
Str0toAdress:
|
||||||
|
;push
|
||||||
|
stc
|
||||||
|
;pop
|
||||||
|
ret
|
||||||
|
|
||||||
|
;Renvoie non carry si la str ds:si point‚e peut ˆtre un nom de fichier
|
||||||
|
str0isname:
|
||||||
|
push ax si di
|
||||||
|
isname:
|
||||||
|
mov al,[si]
|
||||||
|
inc si
|
||||||
|
cmp al,0
|
||||||
|
je itsok
|
||||||
|
mov di,offset non
|
||||||
|
verify:
|
||||||
|
mov ah,[di]
|
||||||
|
inc di
|
||||||
|
cmp ah,0FFh
|
||||||
|
je isname
|
||||||
|
cmp ah,al
|
||||||
|
jne verify
|
||||||
|
stc
|
||||||
|
jmp itsdead
|
||||||
|
itsok:
|
||||||
|
clc
|
||||||
|
itsdead:
|
||||||
|
pop di si ax
|
||||||
|
ret
|
||||||
|
|
||||||
|
non db '/<>|"?*:\',01,0FFh
|
||||||
|
|
||||||
|
;Renvoie non carry si le texte point‚ par si est de la base cl
|
||||||
|
str0isbase:
|
||||||
|
push ax cx si di es
|
||||||
|
push cs
|
||||||
|
pop es
|
||||||
|
mov ah,cl
|
||||||
|
isstrbase:
|
||||||
|
mov al,[si]
|
||||||
|
cmp al,0
|
||||||
|
je okbase
|
||||||
|
mov cl,ah
|
||||||
|
xor ch,ch
|
||||||
|
mov di,cx
|
||||||
|
cmp al,es:[di-2+offset basen]
|
||||||
|
je verifbase
|
||||||
|
xor ch,ch
|
||||||
|
inc cl
|
||||||
|
mov di,offset base
|
||||||
|
cld
|
||||||
|
repne scasb
|
||||||
|
cmp cx,0
|
||||||
|
je nobase
|
||||||
|
inc si
|
||||||
|
jmp isstrbase
|
||||||
|
okbase:
|
||||||
|
clc
|
||||||
|
endbase:
|
||||||
|
pop es di si cx ax
|
||||||
|
ret
|
||||||
|
verifbase:
|
||||||
|
cmp byte ptr [si+1],0
|
||||||
|
je okbase
|
||||||
|
nobase:
|
||||||
|
stc
|
||||||
|
jmp endbase
|
||||||
|
|
||||||
|
temp dw 0
|
||||||
|
|
||||||
|
;Converti un str de base cl en int dans edx
|
||||||
|
str0toint:
|
||||||
|
push eax bx ecx si edi ebp es
|
||||||
|
push cs
|
||||||
|
pop es
|
||||||
|
mov ah,cl
|
||||||
|
mov cs:temp,si
|
||||||
|
gotos:
|
||||||
|
cmp byte ptr [si+1], 0
|
||||||
|
je oklo
|
||||||
|
inc si
|
||||||
|
jmp gotos
|
||||||
|
oklo:
|
||||||
|
mov edi,1
|
||||||
|
xor ebp,ebp
|
||||||
|
mov bl,cl
|
||||||
|
baseto:
|
||||||
|
cmp si,cs:temp
|
||||||
|
jb endbaseto
|
||||||
|
mov al,[si]
|
||||||
|
xor ecx,ecx
|
||||||
|
mov cl,bl
|
||||||
|
inc cl
|
||||||
|
push di
|
||||||
|
mov di,offset base
|
||||||
|
cld
|
||||||
|
repne scasb
|
||||||
|
pop di
|
||||||
|
jne noop
|
||||||
|
sub cl,bl
|
||||||
|
neg cl
|
||||||
|
mov eax,edi
|
||||||
|
mul ecx
|
||||||
|
add ebp,eax
|
||||||
|
mov eax,edi
|
||||||
|
mov cl,bl
|
||||||
|
mul ecx
|
||||||
|
mov edi,eax
|
||||||
|
noop:
|
||||||
|
dec si
|
||||||
|
jmp baseto
|
||||||
|
endbaseto:
|
||||||
|
mov edx,ebp
|
||||||
|
pop es ebp edi si ecx bx eax
|
||||||
|
ret
|
||||||
|
base db '0123456789ABCDEF'
|
||||||
|
basen db 'B O D H'
|
||||||
|
basenn db 1,0,0,0,0,0,2,0,3,0,0,0,0,0,4
|
||||||
|
|
||||||
|
;Renvoie en es:di la partie de cx caractŠres a partir de la gauche de ds:si
|
||||||
|
Left0:
|
||||||
|
push ax cx si di
|
||||||
|
cld
|
||||||
|
rep movsb
|
||||||
|
mov al,0
|
||||||
|
stosb
|
||||||
|
pop di si cx ax
|
||||||
|
ret
|
||||||
|
|
||||||
|
;Renvoie en es:di la partie de cx caractŠres a partir de la droite de ds:si
|
||||||
|
Right0:
|
||||||
|
push ax cx dx si di
|
||||||
|
mov dx,cx
|
||||||
|
call getlength0
|
||||||
|
add si,cx
|
||||||
|
sub si,dx
|
||||||
|
mov cx,dx
|
||||||
|
cld
|
||||||
|
rep movsb
|
||||||
|
mov al,0
|
||||||
|
stosb
|
||||||
|
pop di si dx cx ax
|
||||||
|
ret
|
||||||
|
|
||||||
|
;Renvoie en es:di la partie de cx caractŠres a partir de la position bx de ds:si
|
||||||
|
middle0:
|
||||||
|
push ax cx si di
|
||||||
|
add si,bx
|
||||||
|
cld
|
||||||
|
rep movsb
|
||||||
|
mov al,0
|
||||||
|
stosb
|
||||||
|
pop di si cx ax
|
||||||
|
ret
|
||||||
|
|
||||||
|
;Rempli de cx caractŠres dl a partir de la position bx de ds:si
|
||||||
|
Fill0:
|
||||||
|
push ax bx cx si di es
|
||||||
|
push ds
|
||||||
|
pop es
|
||||||
|
add si,bx
|
||||||
|
mov al,dl
|
||||||
|
mov di,si
|
||||||
|
cld
|
||||||
|
rep stosb
|
||||||
|
pop es di si cx bx ax
|
||||||
|
ret
|
||||||
|
|
||||||
|
;Remplace tout les caractŠres al de ds:si par des caractŠres dl
|
||||||
|
ReplaceAllchar0:
|
||||||
|
push ax cx di es
|
||||||
|
call GetLength0
|
||||||
|
push ds
|
||||||
|
pop es
|
||||||
|
mov di,si
|
||||||
|
findandchange:
|
||||||
|
repne scasb
|
||||||
|
cmp cx,0
|
||||||
|
je endofchange
|
||||||
|
mov es:[di-1],dl
|
||||||
|
jmp findandchange
|
||||||
|
endofchange:
|
||||||
|
pop es di cx ax
|
||||||
|
ret
|
||||||
|
|
||||||
|
|
||||||
|
;Recherche un caractŠre dl dans la chaŒne ds:si
|
||||||
|
SearchChar0:
|
||||||
|
push ax cx di es
|
||||||
|
call GetLength0
|
||||||
|
push ds
|
||||||
|
pop es
|
||||||
|
mov di,si
|
||||||
|
mov al,dl
|
||||||
|
repne scasb
|
||||||
|
pop es di cx ax
|
||||||
|
ret
|
||||||
|
|
||||||
|
;Inverse la chaine point‚e en ds:si
|
||||||
|
invert0:
|
||||||
|
push ax cx si di es
|
||||||
|
call GetLength0
|
||||||
|
push ds
|
||||||
|
pop es
|
||||||
|
mov di,si
|
||||||
|
add di,cx
|
||||||
|
dec di
|
||||||
|
revert:
|
||||||
|
mov al,[si]
|
||||||
|
xchg al,es:[di]
|
||||||
|
mov [si],al
|
||||||
|
inc si
|
||||||
|
dec di
|
||||||
|
cmp si,di
|
||||||
|
je finishinvert
|
||||||
|
dec di
|
||||||
|
cmp si,di
|
||||||
|
je finishinvert
|
||||||
|
inc di
|
||||||
|
jmp revert
|
||||||
|
finishinvert:
|
||||||
|
pop es di si cx ax
|
||||||
|
ret
|
||||||
|
|
||||||
|
;Compares 2 chaines de caractŠres DS:SI et ES:DI zerof si non equal
|
||||||
|
cmpstr0:
|
||||||
|
push cx dx si di
|
||||||
|
call GetLength0
|
||||||
|
mov dx,cx
|
||||||
|
push ds si
|
||||||
|
push es
|
||||||
|
pop ds
|
||||||
|
mov si,di
|
||||||
|
call GetLength0
|
||||||
|
pop si ds
|
||||||
|
cmp cx,dx
|
||||||
|
jne NotEqual
|
||||||
|
repe cmpsb
|
||||||
|
NotEqual:
|
||||||
|
pop di si dx cx
|
||||||
|
ret
|
||||||
|
|
||||||
|
;Compares 2 chaines de caractŠres DS:SI et ES:DI zerof si non equal et renvoie le nb de caractŠre egaux dans dx
|
||||||
|
evalue0:
|
||||||
|
push cx si di
|
||||||
|
push ds si
|
||||||
|
push es
|
||||||
|
pop ds
|
||||||
|
mov si,di
|
||||||
|
call GetLength0
|
||||||
|
pop si ds
|
||||||
|
mov dx,cx
|
||||||
|
repe cmpsb
|
||||||
|
pushf
|
||||||
|
sub dx,cx
|
||||||
|
popf
|
||||||
|
pop di si cx
|
||||||
|
ret
|
||||||
|
|
||||||
|
|
||||||
|
;Insert une chaine ds:si en es:di a partir du caractŠre cx
|
||||||
|
insert0:
|
||||||
|
push cx di si
|
||||||
|
add di,cx
|
||||||
|
call getlength0
|
||||||
|
push si di ds
|
||||||
|
push es
|
||||||
|
pop ds
|
||||||
|
mov si,di
|
||||||
|
add di,cx
|
||||||
|
call copy20
|
||||||
|
pop ds di si
|
||||||
|
cld
|
||||||
|
inc di
|
||||||
|
rep movsb
|
||||||
|
pop si di cx
|
||||||
|
ret
|
||||||
|
|
||||||
|
;Detruit CX caractŠres a partir du caractŠre BX de DS:SI
|
||||||
|
delete0:
|
||||||
|
push cx dx si di es
|
||||||
|
push ds
|
||||||
|
pop es
|
||||||
|
mov dx,cx
|
||||||
|
call getlength0
|
||||||
|
sub cx,dx
|
||||||
|
sub cx,bx
|
||||||
|
inc cx
|
||||||
|
add si,bx
|
||||||
|
mov di,si
|
||||||
|
add si,dx
|
||||||
|
cld
|
||||||
|
rep movsb
|
||||||
|
pop es di si dx cx
|
||||||
|
ret
|
||||||
|
|
||||||
|
;Copie une chaine de ds:si en es:di
|
||||||
|
Copy0:
|
||||||
|
push ax cx si di
|
||||||
|
call GetLength0
|
||||||
|
cld
|
||||||
|
rep movsb
|
||||||
|
mov al,0
|
||||||
|
stosb
|
||||||
|
pop di si cx ax
|
||||||
|
ret
|
||||||
|
|
||||||
|
;Copie une chaine de ds:si en es:di
|
||||||
|
Copy20:
|
||||||
|
push ax cx si di
|
||||||
|
call GetLength0
|
||||||
|
cld
|
||||||
|
add si,cx
|
||||||
|
add di,cx
|
||||||
|
inc cx
|
||||||
|
std
|
||||||
|
rep movsb
|
||||||
|
pop di si cx ax
|
||||||
|
ret
|
||||||
|
|
||||||
|
;ConcatŠne le chaine ds:si avec es:di
|
||||||
|
Concat0:
|
||||||
|
push ax cx dx si di
|
||||||
|
call GetLength0
|
||||||
|
mov dx,cx
|
||||||
|
xchg si,di
|
||||||
|
push ds
|
||||||
|
push es
|
||||||
|
pop ds
|
||||||
|
call GetLength0
|
||||||
|
pop ds
|
||||||
|
xchg si,di
|
||||||
|
add di,cx
|
||||||
|
mov cx,dx
|
||||||
|
cld
|
||||||
|
rep movsb
|
||||||
|
mov al,0
|
||||||
|
stosb
|
||||||
|
pop di si dx cx ax
|
||||||
|
ret
|
||||||
|
|
||||||
|
;Met DL comme d‚limiteur par d‚faut
|
||||||
|
SetDelimiter0:
|
||||||
|
mov cs:delim,dl
|
||||||
|
ret
|
||||||
|
|
||||||
|
;Renvoie le d‚limiteur par d‚faut dans dl
|
||||||
|
GetDelimiter0:
|
||||||
|
mov dl,cs:delim
|
||||||
|
ret
|
||||||
|
delim db 0
|
||||||
|
|
||||||
|
;D‚truit les d‚limiteur qui sont cons‚cutifs dans ds:si
|
||||||
|
CompressDelimiter0:
|
||||||
|
push ax dx si di es
|
||||||
|
call Getlength0
|
||||||
|
push ds
|
||||||
|
pop es
|
||||||
|
mov di,si
|
||||||
|
mov al,cs:delim
|
||||||
|
xor dx,dx
|
||||||
|
Compressitems:
|
||||||
|
repne scasb
|
||||||
|
inc dx
|
||||||
|
againcomp:
|
||||||
|
cmp [di],al
|
||||||
|
jne nosup
|
||||||
|
mov si,di
|
||||||
|
mov bx,0
|
||||||
|
push cx
|
||||||
|
mov cx,1
|
||||||
|
call delete0
|
||||||
|
pop cx
|
||||||
|
jmp againcomp
|
||||||
|
nosup:
|
||||||
|
cmp cx,0
|
||||||
|
jne compressitems
|
||||||
|
mov cx,dx
|
||||||
|
pop es di si dx ax
|
||||||
|
ret
|
||||||
|
|
||||||
|
;Met le nombre d'‚l‚ments … cx
|
||||||
|
Setnbitems0:
|
||||||
|
push ax cx dx di es
|
||||||
|
mov dx,cx
|
||||||
|
call Getnbitems0
|
||||||
|
cmp cx,dx
|
||||||
|
je noadjust
|
||||||
|
ja subsome
|
||||||
|
push ds
|
||||||
|
pop es
|
||||||
|
mov di,si
|
||||||
|
sub cx,dx
|
||||||
|
neg cx
|
||||||
|
push cx
|
||||||
|
call getlength0
|
||||||
|
add di,cx
|
||||||
|
pop cx
|
||||||
|
mov al,cs:delim
|
||||||
|
mov ah,'a'
|
||||||
|
rep stosw
|
||||||
|
mov al,0
|
||||||
|
stosb
|
||||||
|
jmp noadjust
|
||||||
|
subsome:
|
||||||
|
mov cx,dx
|
||||||
|
call GetPointeritem0
|
||||||
|
dec di
|
||||||
|
mov byte ptr [di],0
|
||||||
|
noadjust:
|
||||||
|
pop es di dx cx
|
||||||
|
ret
|
||||||
|
|
||||||
|
;Renvoie la taille dx de l'‚l‚ment cx
|
||||||
|
Getitemsize:
|
||||||
|
push cx di
|
||||||
|
call getpointeritem0
|
||||||
|
mov dx,di
|
||||||
|
inc cx
|
||||||
|
call getpointeritem0
|
||||||
|
sub dx,di
|
||||||
|
neg dx
|
||||||
|
dec dx
|
||||||
|
pop di cx
|
||||||
|
ret
|
||||||
|
|
||||||
|
;Renvoie en es:di l'‚l‚ment cx de ds:si
|
||||||
|
Getitem0:
|
||||||
|
push si di cx ax
|
||||||
|
push di
|
||||||
|
call getPointeritem0
|
||||||
|
call getitemsize
|
||||||
|
mov si,di
|
||||||
|
pop di
|
||||||
|
mov cx,dx
|
||||||
|
rep movsb
|
||||||
|
mov al,0
|
||||||
|
stosb
|
||||||
|
pop ax cx di si
|
||||||
|
ret
|
||||||
|
|
||||||
|
;renvoi un pointeur di sur l'‚l‚ment cx de ds:si
|
||||||
|
GetPointeritem0:
|
||||||
|
push ax bx cx dx es
|
||||||
|
mov bx,cx
|
||||||
|
call Getlength0
|
||||||
|
push ds
|
||||||
|
pop es
|
||||||
|
mov di,si
|
||||||
|
mov al,cs:delim
|
||||||
|
xor dx,dx
|
||||||
|
Countnbitems:
|
||||||
|
cmp bx,dx
|
||||||
|
je finishpointer
|
||||||
|
repne scasb
|
||||||
|
inc dx
|
||||||
|
cmp cx,0
|
||||||
|
jne countnbitems
|
||||||
|
inc di
|
||||||
|
finishpointer:
|
||||||
|
pop es dx cx bx ax
|
||||||
|
ret
|
||||||
|
|
||||||
|
;Renvoie le nombre d'‚l‚ments cx de ds:si
|
||||||
|
GetNbitems0:
|
||||||
|
push ax dx di es
|
||||||
|
call Getlength0
|
||||||
|
push ds
|
||||||
|
pop es
|
||||||
|
mov di,si
|
||||||
|
mov al,cs:delim
|
||||||
|
xor dx,dx
|
||||||
|
Countitems:
|
||||||
|
repne scasb
|
||||||
|
inc dx
|
||||||
|
cmp cx,0
|
||||||
|
jne countitems
|
||||||
|
mov cx,dx
|
||||||
|
pop es di dx ax
|
||||||
|
ret
|
||||||
|
|
||||||
|
;renvoie la taille en octets CX de la chaine point‚e en ds:si
|
||||||
|
GetLength0:
|
||||||
|
push ax di es
|
||||||
|
push ds
|
||||||
|
pop es
|
||||||
|
mov di,si
|
||||||
|
mov al,0
|
||||||
|
mov cx,0FFFFh
|
||||||
|
cld
|
||||||
|
repne scasb
|
||||||
|
neg cx
|
||||||
|
dec cx
|
||||||
|
dec cx
|
||||||
|
pop es di ax
|
||||||
|
ret
|
||||||
|
|
||||||
|
;Met la taille en octets de la chaine point‚e ds:si a CX
|
||||||
|
SetLength0:
|
||||||
|
push bx
|
||||||
|
mov bx,cx
|
||||||
|
mov byte ptr [si+bx],0
|
||||||
|
pop bx
|
||||||
|
ret
|
||||||
|
|
||||||
|
;met en majuscule la chaine ds:si
|
||||||
|
UpperCase0:
|
||||||
|
push si ax
|
||||||
|
UpperCase:
|
||||||
|
mov al,ds:[si]
|
||||||
|
inc si
|
||||||
|
cmp al,0
|
||||||
|
je EndUpperCase
|
||||||
|
cmp al,'a'
|
||||||
|
jb UpperCase
|
||||||
|
cmp al,'z'
|
||||||
|
ja UpperCase
|
||||||
|
sub byte ptr [si-1],'a'-'A'
|
||||||
|
jmp UpperCase
|
||||||
|
EndUpperCase:
|
||||||
|
clc
|
||||||
|
pop ax si
|
||||||
|
ret
|
||||||
|
|
||||||
|
;met en majuscule la premiŠre lettre chaine ds:si
|
||||||
|
OneCase0:
|
||||||
|
push ax
|
||||||
|
OneUpperCase:
|
||||||
|
mov al,ds:[si]
|
||||||
|
cmp al,'a'
|
||||||
|
jb OneEndUpperCase
|
||||||
|
cmp al,'z'
|
||||||
|
ja OneEndUpperCase
|
||||||
|
sub byte ptr [si],'a'-'A'
|
||||||
|
OneEndUpperCase:
|
||||||
|
clc
|
||||||
|
pop ax
|
||||||
|
ret
|
||||||
|
|
||||||
|
;met en minuscule la chaine ds:si
|
||||||
|
LowerCase0:
|
||||||
|
push si ax
|
||||||
|
LowerCase:
|
||||||
|
mov al,ds:[si]
|
||||||
|
inc si
|
||||||
|
cmp al,0
|
||||||
|
je EndLowerCase
|
||||||
|
cmp al,'A'
|
||||||
|
jb LowerCase
|
||||||
|
cmp al,'Z'
|
||||||
|
ja LowerCase
|
||||||
|
add byte ptr [si-1],'a'-'A'
|
||||||
|
jmp LowerCase
|
||||||
|
EndLowerCase:
|
||||||
|
clc
|
||||||
|
pop ax si
|
||||||
|
ret
|
||||||
|
|
||||||
|
;Inverse la casse la chaine ds:si
|
||||||
|
InvertCase0:
|
||||||
|
push si ax
|
||||||
|
InvertCase:
|
||||||
|
mov al,ds:[si]
|
||||||
|
inc si
|
||||||
|
cmp al,0
|
||||||
|
je EndInvertCase
|
||||||
|
cmp al,'A'
|
||||||
|
jb InvertCase
|
||||||
|
cmp al,'Z'
|
||||||
|
jbe GoInvertCase
|
||||||
|
cmp al,'a'
|
||||||
|
jb InvertCase
|
||||||
|
cmp al,'z'
|
||||||
|
ja InvertCase
|
||||||
|
sub byte ptr [si-1],'a'-'A'
|
||||||
|
jmp InvertCase
|
||||||
|
GoInvertCase:
|
||||||
|
add byte ptr [si-1],'a'-'A'
|
||||||
|
jmp InvertCase
|
||||||
|
EndInvertCase:
|
||||||
|
clc
|
||||||
|
pop ax si
|
||||||
|
ret
|
||||||
|
|
||||||
|
end start
|
162
noyau/hours.asm → noyau/heure.asm
Executable file → Normal file
162
noyau/hours.asm → noyau/heure.asm
Executable file → Normal file
@ -1,81 +1,81 @@
|
|||||||
.model tiny
|
.model tiny
|
||||||
.486
|
.486
|
||||||
smart
|
smart
|
||||||
.code
|
.code
|
||||||
|
|
||||||
org 0100h
|
org 0100h
|
||||||
|
|
||||||
start:
|
start:
|
||||||
|
|
||||||
jmp tsr
|
jmp tsr
|
||||||
offsets dd 0
|
offsets dd 0
|
||||||
db 'HOURS'
|
db 'HOURS'
|
||||||
tsr:
|
tsr:
|
||||||
pushf
|
pushf
|
||||||
db 2eh,0ffh,1eh
|
db 2eh,0ffh,1eh
|
||||||
dw offsets
|
dw offsets
|
||||||
cli
|
cli
|
||||||
pusha
|
pusha
|
||||||
push ds es
|
push ds es
|
||||||
push cs
|
push cs
|
||||||
push cs
|
push cs
|
||||||
pop ds
|
pop ds
|
||||||
pop es
|
pop es
|
||||||
mov ah,22h
|
mov ah,22h
|
||||||
mov di,offset infos
|
mov di,offset infos
|
||||||
int 47h
|
int 47h
|
||||||
mov bl,[infos+1]
|
mov bl,[infos+1]
|
||||||
xor bh,bh
|
xor bh,bh
|
||||||
sub bl,8
|
sub bl,8
|
||||||
mov di,bx
|
mov di,bx
|
||||||
shl di,1
|
shl di,1
|
||||||
mov dx,71h
|
mov dx,71h
|
||||||
xor eax,eax
|
xor eax,eax
|
||||||
mov cx,0B800h
|
mov cx,0B800h
|
||||||
mov es,cx
|
mov es,cx
|
||||||
mov cl,4
|
mov cl,4
|
||||||
mov bp,8
|
mov bp,8
|
||||||
show:
|
show:
|
||||||
dec dx
|
dec dx
|
||||||
mov al,cl
|
mov al,cl
|
||||||
out dx,al
|
out dx,al
|
||||||
inc dx
|
inc dx
|
||||||
in al,dx
|
in al,dx
|
||||||
call showbcd
|
call showbcd
|
||||||
cmp cl,0
|
cmp cl,0
|
||||||
je finic
|
je finic
|
||||||
mov byte ptr es:[di],':'
|
mov byte ptr es:[di],':'
|
||||||
add di,2
|
add di,2
|
||||||
sub cl,2
|
sub cl,2
|
||||||
jmp show
|
jmp show
|
||||||
finic:
|
finic:
|
||||||
pop es ds
|
pop es ds
|
||||||
popa
|
popa
|
||||||
sti
|
sti
|
||||||
iret
|
iret
|
||||||
|
|
||||||
|
|
||||||
;==============================Affiche le nombre nb hexa en EDX==============
|
;==============================Affiche le nombre nb hexa en EDX==============
|
||||||
Showbcd:
|
Showbcd:
|
||||||
push ax bx cx edx
|
push ax bx cx edx
|
||||||
mov edx,eax
|
mov edx,eax
|
||||||
mov cx,bp
|
mov cx,bp
|
||||||
sub cx,32
|
sub cx,32
|
||||||
neg cx
|
neg cx
|
||||||
shl edx,cl
|
shl edx,cl
|
||||||
mov ax,bp
|
mov ax,bp
|
||||||
shr ax,2
|
shr ax,2
|
||||||
bcdaize:
|
bcdaize:
|
||||||
rol edx,4
|
rol edx,4
|
||||||
mov bx,dx
|
mov bx,dx
|
||||||
and bx,0fh
|
and bx,0fh
|
||||||
add bl,'0'
|
add bl,'0'
|
||||||
mov es:[di],bl
|
mov es:[di],bl
|
||||||
add di,2
|
add di,2
|
||||||
dec al
|
dec al
|
||||||
jnz bcdaize
|
jnz bcdaize
|
||||||
pop edx cx bx ax
|
pop edx cx bx ax
|
||||||
ret
|
ret
|
||||||
infos db 40 dup (0)
|
infos db 40 dup (0)
|
||||||
|
|
||||||
end start
|
end start
|
64
noyau/timer.asm → noyau/horloge.asm
Executable file → Normal file
64
noyau/timer.asm → noyau/horloge.asm
Executable file → Normal file
@ -1,32 +1,32 @@
|
|||||||
.model tiny
|
.model tiny
|
||||||
.486
|
.486
|
||||||
smart
|
smart
|
||||||
.code
|
.code
|
||||||
|
|
||||||
org 0100h
|
org 0100h
|
||||||
|
|
||||||
start:
|
start:
|
||||||
|
|
||||||
jmp tsr
|
jmp tsr
|
||||||
offsets dd 0
|
offsets dd 0
|
||||||
db 'TIMER'
|
db 'TIMER'
|
||||||
tsr:
|
tsr:
|
||||||
pushf
|
pushf
|
||||||
db 2eh,0ffh,1eh
|
db 2eh,0ffh,1eh
|
||||||
dw offsets
|
dw offsets
|
||||||
cli
|
cli
|
||||||
push ax bx es
|
push ax bx es
|
||||||
mov bx,cs:compteur
|
mov bx,cs:compteur
|
||||||
inc bx
|
inc bx
|
||||||
and bx,11b
|
and bx,11b
|
||||||
mov cs:compteur,bx
|
mov cs:compteur,bx
|
||||||
mov bx,cs:[offset fig+bx]
|
mov bx,cs:[offset fig+bx]
|
||||||
mov ax,0B800h
|
mov ax,0B800h
|
||||||
mov es,ax
|
mov es,ax
|
||||||
mov es:[0],bl
|
mov es:[0],bl
|
||||||
pop es bx ax
|
pop es bx ax
|
||||||
sti
|
sti
|
||||||
iret
|
iret
|
||||||
compteur dw 0
|
compteur dw 0
|
||||||
fig db 'Ä\³/'
|
fig db 'Ä\³/'
|
||||||
end start
|
end start
|
596
noyau/joystick.asm → noyau/manette.asm
Executable file → Normal file
596
noyau/joystick.asm → noyau/manette.asm
Executable file → Normal file
@ -1,298 +1,298 @@
|
|||||||
.model tiny
|
.model tiny
|
||||||
.486
|
.486
|
||||||
smart
|
smart
|
||||||
.code
|
.code
|
||||||
org 0100h
|
org 0100h
|
||||||
start:
|
start:
|
||||||
jmp tsr
|
jmp tsr
|
||||||
drv db 'JOYSTICK',0
|
drv db 'JOYSTICK',0
|
||||||
Tsr:
|
Tsr:
|
||||||
cli
|
cli
|
||||||
cmp ax,1234h
|
cmp ax,1234h
|
||||||
jne nomore
|
jne nomore
|
||||||
mov ax,4321h
|
mov ax,4321h
|
||||||
jmp itsok
|
jmp itsok
|
||||||
nomore:
|
nomore:
|
||||||
push bx
|
push bx
|
||||||
cmp byte ptr cs:isact,1
|
cmp byte ptr cs:isact,1
|
||||||
je nottest
|
je nottest
|
||||||
mov cs:isact,1
|
mov cs:isact,1
|
||||||
jmp react
|
jmp react
|
||||||
mov bl,ah
|
mov bl,ah
|
||||||
xor bh,bh
|
xor bh,bh
|
||||||
shl bx,1
|
shl bx,1
|
||||||
mov bx,cs:[bx].tables
|
mov bx,cs:[bx].tables
|
||||||
mov cs:current,bx
|
mov cs:current,bx
|
||||||
pop bx
|
pop bx
|
||||||
call cs:current
|
call cs:current
|
||||||
itsok:
|
itsok:
|
||||||
jnc noerror
|
jnc noerror
|
||||||
push bp
|
push bp
|
||||||
mov bp,sp
|
mov bp,sp
|
||||||
or byte ptr [bp+6],1b
|
or byte ptr [bp+6],1b
|
||||||
pop bp
|
pop bp
|
||||||
mov ax,cs
|
mov ax,cs
|
||||||
shl eax,16
|
shl eax,16
|
||||||
mov ax,cs:current
|
mov ax,cs:current
|
||||||
jmp endofint
|
jmp endofint
|
||||||
noerror:
|
noerror:
|
||||||
push bp
|
push bp
|
||||||
mov bp,sp
|
mov bp,sp
|
||||||
and byte ptr [bp+6],0FEh
|
and byte ptr [bp+6],0FEh
|
||||||
pop bp
|
pop bp
|
||||||
endofint:
|
endofint:
|
||||||
mov cs:isact,0
|
mov cs:isact,0
|
||||||
sti
|
sti
|
||||||
iret
|
iret
|
||||||
nottest:
|
nottest:
|
||||||
pop bx
|
pop bx
|
||||||
jmp endofint
|
jmp endofint
|
||||||
current dw 0
|
current dw 0
|
||||||
tables dw 0;detectjoystick
|
tables dw 0;detectjoystick
|
||||||
;dw getjoystick
|
;dw getjoystick
|
||||||
;dw getjoystickscreen
|
;dw getjoystickscreen
|
||||||
;dw configjoystick
|
;dw configjoystick
|
||||||
isact db 0
|
isact db 0
|
||||||
|
|
||||||
;envoie en bx,cx les coordonn‚es et en dl les boutons
|
;envoie en bx,cx les coordonn‚es et en dl les boutons
|
||||||
getjoystick:
|
getjoystick:
|
||||||
push ax cx
|
push ax cx
|
||||||
mov bx,cs:rx
|
mov bx,cs:rx
|
||||||
mov cx,cs:ry
|
mov cx,cs:ry
|
||||||
mov al,cs:button
|
mov al,cs:button
|
||||||
not al
|
not al
|
||||||
mov cl,4
|
mov cl,4
|
||||||
shr al,cl
|
shr al,cl
|
||||||
mov dl,al
|
mov dl,al
|
||||||
pop cx ax
|
pop cx ax
|
||||||
ret
|
ret
|
||||||
|
|
||||||
;envoie en di les coordonn‚es ecran et en dl les boutons
|
;envoie en di les coordonn‚es ecran et en dl les boutons
|
||||||
getjoystickscreen:
|
getjoystickscreen:
|
||||||
push ax cx
|
push ax cx
|
||||||
mov di,cs:xy
|
mov di,cs:xy
|
||||||
mov al,cs:button
|
mov al,cs:button
|
||||||
not al
|
not al
|
||||||
mov cl,4
|
mov cl,4
|
||||||
shr al,cl
|
shr al,cl
|
||||||
mov dl,al
|
mov dl,al
|
||||||
pop cx ax
|
pop cx ax
|
||||||
ret
|
ret
|
||||||
db 'button'
|
db 'button'
|
||||||
Button db 0
|
Button db 0
|
||||||
db 'rx'
|
db 'rx'
|
||||||
rx dw 0
|
rx dw 0
|
||||||
db 'ry'
|
db 'ry'
|
||||||
ry dw 0
|
ry dw 0
|
||||||
db 'vx'
|
db 'vx'
|
||||||
VX db 0
|
VX db 0
|
||||||
db 'vy'
|
db 'vy'
|
||||||
VY db 0
|
VY db 0
|
||||||
db 'x'
|
db 'x'
|
||||||
X dw 7FFFh
|
X dw 7FFFh
|
||||||
db 'y'
|
db 'y'
|
||||||
Y dw 7FFFh
|
Y dw 7FFFh
|
||||||
speed db 6
|
speed db 6
|
||||||
spherex db 0
|
spherex db 0
|
||||||
spherey db 0
|
spherey db 0
|
||||||
db 'count'
|
db 'count'
|
||||||
count db 0
|
count db 0
|
||||||
db 'error'
|
db 'error'
|
||||||
error db 0
|
error db 0
|
||||||
xy dw 0
|
xy dw 0
|
||||||
old db 0
|
old db 0
|
||||||
|
|
||||||
calibrate db 0
|
calibrate db 0
|
||||||
db 'ticks'
|
db 'ticks'
|
||||||
ticks dw 0
|
ticks dw 0
|
||||||
db 'state'
|
db 'state'
|
||||||
state db 0
|
state db 0
|
||||||
db 'connard'
|
db 'connard'
|
||||||
connard db 1
|
connard db 1
|
||||||
connard2 db 1
|
connard2 db 1
|
||||||
;Gestionnaire de joystick
|
;Gestionnaire de joystick
|
||||||
react:
|
react:
|
||||||
push ax bx cx dx si di bp ds es
|
push ax bx cx dx si di bp ds es
|
||||||
push cs
|
push cs
|
||||||
pop ds
|
pop ds
|
||||||
mov dx,201h
|
mov dx,201h
|
||||||
cmp error, 1
|
cmp error, 1
|
||||||
je gest1
|
je gest1
|
||||||
cmp count,1
|
cmp count,1
|
||||||
je gest1
|
je gest1
|
||||||
cmp count,2
|
cmp count,2
|
||||||
je gest2
|
je gest2
|
||||||
gest1:
|
gest1:
|
||||||
mov error,0
|
mov error,0
|
||||||
mov count,2
|
mov count,2
|
||||||
call getticks
|
call getticks
|
||||||
mov ticks,ax
|
mov ticks,ax
|
||||||
out dx,al
|
out dx,al
|
||||||
in al,dx
|
in al,dx
|
||||||
and al,00000011b
|
and al,00000011b
|
||||||
mov state,al
|
mov state,al
|
||||||
jmp endgest
|
jmp endgest
|
||||||
gest2:
|
gest2:
|
||||||
not connard
|
not connard
|
||||||
call getticks
|
call getticks
|
||||||
sub ax,ticks
|
sub ax,ticks
|
||||||
cmp ax,1FF0h
|
cmp ax,1FF0h
|
||||||
jb nofinish
|
jb nofinish
|
||||||
mov error,1
|
mov error,1
|
||||||
jmp endgest
|
jmp endgest
|
||||||
nofinish:
|
nofinish:
|
||||||
mov bx,ax
|
mov bx,ax
|
||||||
in al,dx
|
in al,dx
|
||||||
and al,00000011b
|
and al,00000011b
|
||||||
cmp state,al
|
cmp state,al
|
||||||
je endgest
|
je endgest
|
||||||
xchg state,al
|
xchg state,al
|
||||||
xor al,state
|
xor al,state
|
||||||
mov cl,4
|
mov cl,4
|
||||||
or bx,bx
|
or bx,bx
|
||||||
js noadj
|
js noadj
|
||||||
shr bx,cl
|
shr bx,cl
|
||||||
noadj:
|
noadj:
|
||||||
test al,1
|
test al,1
|
||||||
je isy
|
je isy
|
||||||
mov VX,bl
|
mov VX,bl
|
||||||
jmp wasx
|
jmp wasx
|
||||||
isy:
|
isy:
|
||||||
test al,2
|
test al,2
|
||||||
je endgest
|
je endgest
|
||||||
mov VY,bl
|
mov VY,bl
|
||||||
wasx:
|
wasx:
|
||||||
mov connard2,0fh
|
mov connard2,0fh
|
||||||
mov count,1
|
mov count,1
|
||||||
endgest:
|
endgest:
|
||||||
in al,dx
|
in al,dx
|
||||||
not al
|
not al
|
||||||
mov cl,4
|
mov cl,4
|
||||||
shr al,cl
|
shr al,cl
|
||||||
mov button,al
|
mov button,al
|
||||||
push cs
|
push cs
|
||||||
pop es
|
pop es
|
||||||
mov di,offset infos
|
mov di,offset infos
|
||||||
mov ah,34
|
mov ah,34
|
||||||
int 47h
|
int 47h
|
||||||
mov cl,speed
|
mov cl,speed
|
||||||
movsx bx,VY
|
movsx bx,VY
|
||||||
shl bx,cl
|
shl bx,cl
|
||||||
cmp spherey,0
|
cmp spherey,0
|
||||||
jne nolimity
|
jne nolimity
|
||||||
xor ah,ah
|
xor ah,ah
|
||||||
mov al,[di]
|
mov al,[di]
|
||||||
cmp byte ptr [di+7],4
|
cmp byte ptr [di+7],4
|
||||||
jbe text4
|
jbe text4
|
||||||
shl ax,3
|
shl ax,3
|
||||||
text4:
|
text4:
|
||||||
dec ax
|
dec ax
|
||||||
cmp bx,0
|
cmp bx,0
|
||||||
jg decy
|
jg decy
|
||||||
cmp ry,ax
|
cmp ry,ax
|
||||||
jae noaddy
|
jae noaddy
|
||||||
jmp nolimity
|
jmp nolimity
|
||||||
decy:
|
decy:
|
||||||
cmp ry,0
|
cmp ry,0
|
||||||
je noaddy
|
je noaddy
|
||||||
nolimity:
|
nolimity:
|
||||||
sub y,bx
|
sub y,bx
|
||||||
noaddy:
|
noaddy:
|
||||||
movsx bx,VX
|
movsx bx,VX
|
||||||
shl bx,cl
|
shl bx,cl
|
||||||
cmp spherex,0
|
cmp spherex,0
|
||||||
jne nolimitx
|
jne nolimitx
|
||||||
xor ah,ah
|
xor ah,ah
|
||||||
mov al,[di+1]
|
mov al,[di+1]
|
||||||
cmp byte ptr [di+7],4
|
cmp byte ptr [di+7],4
|
||||||
jbe text5
|
jbe text5
|
||||||
shl ax,3
|
shl ax,3
|
||||||
text5:
|
text5:
|
||||||
dec ax
|
dec ax
|
||||||
cmp bx,0
|
cmp bx,0
|
||||||
jl decx
|
jl decx
|
||||||
cmp rx,ax
|
cmp rx,ax
|
||||||
jae noaddx
|
jae noaddx
|
||||||
jmp nolimitx
|
jmp nolimitx
|
||||||
decx:
|
decx:
|
||||||
cmp rx,0
|
cmp rx,0
|
||||||
je noaddx
|
je noaddx
|
||||||
nolimitx:
|
nolimitx:
|
||||||
add x,bx
|
add x,bx
|
||||||
noaddx:
|
noaddx:
|
||||||
mov ax,x
|
mov ax,x
|
||||||
mov bx,0FFFFh
|
mov bx,0FFFFh
|
||||||
xor ch,ch
|
xor ch,ch
|
||||||
mov cl,[di+1]
|
mov cl,[di+1]
|
||||||
cmp byte ptr [di+7],4
|
cmp byte ptr [di+7],4
|
||||||
jbe text1
|
jbe text1
|
||||||
shl cx,3
|
shl cx,3
|
||||||
text1:
|
text1:
|
||||||
mul cx
|
mul cx
|
||||||
div bx
|
div bx
|
||||||
mov rx,ax
|
mov rx,ax
|
||||||
mov ax,y
|
mov ax,y
|
||||||
xor ch,ch
|
xor ch,ch
|
||||||
mov cl,[di]
|
mov cl,[di]
|
||||||
cmp byte ptr [di+7],4
|
cmp byte ptr [di+7],4
|
||||||
jbe text2
|
jbe text2
|
||||||
shl cx,3
|
shl cx,3
|
||||||
text2:
|
text2:
|
||||||
mul cx
|
mul cx
|
||||||
div bx
|
div bx
|
||||||
mov ry,ax
|
mov ry,ax
|
||||||
xor ch,ch
|
xor ch,ch
|
||||||
mov cl,[di+1]
|
mov cl,[di+1]
|
||||||
cmp byte ptr [di+7],4
|
cmp byte ptr [di+7],4
|
||||||
jbe text3
|
jbe text3
|
||||||
shl cx,3
|
shl cx,3
|
||||||
text3:
|
text3:
|
||||||
mul cx
|
mul cx
|
||||||
add ax,rx
|
add ax,rx
|
||||||
cmp byte ptr [di+7],4
|
cmp byte ptr [di+7],4
|
||||||
mov di,ax
|
mov di,ax
|
||||||
jbe textpoint
|
jbe textpoint
|
||||||
mov ax,0A000h
|
mov ax,0A000h
|
||||||
mov es,ax
|
mov es,ax
|
||||||
jmp graphpoint
|
jmp graphpoint
|
||||||
textpoint:
|
textpoint:
|
||||||
mov ax,0B800h
|
mov ax,0B800h
|
||||||
mov es,ax
|
mov es,ax
|
||||||
shl di,1
|
shl di,1
|
||||||
inc di
|
inc di
|
||||||
graphpoint:
|
graphpoint:
|
||||||
mov bx,xy
|
mov bx,xy
|
||||||
cmp byte ptr es:[bx],070h
|
cmp byte ptr es:[bx],070h
|
||||||
jne waschanged
|
jne waschanged
|
||||||
mov al,old
|
mov al,old
|
||||||
mov byte ptr es:[bx],al
|
mov byte ptr es:[bx],al
|
||||||
waschanged:
|
waschanged:
|
||||||
mov xy,di
|
mov xy,di
|
||||||
mov al,es:[di]
|
mov al,es:[di]
|
||||||
mov old,al
|
mov old,al
|
||||||
mov byte ptr es:[di],070h
|
mov byte ptr es:[di],070h
|
||||||
mov al, 20h
|
mov al, 20h
|
||||||
out 0a0h, al
|
out 0a0h, al
|
||||||
out 20h, al
|
out 20h, al
|
||||||
errormouse:
|
errormouse:
|
||||||
pop es ds bp di si dx cx bx ax
|
pop es ds bp di si dx cx bx ax
|
||||||
mov cs:isact,0
|
mov cs:isact,0
|
||||||
pop bx
|
pop bx
|
||||||
iret
|
iret
|
||||||
infos db 40 dup (0)
|
infos db 40 dup (0)
|
||||||
|
|
||||||
|
|
||||||
getticks:
|
getticks:
|
||||||
mov al,0
|
mov al,0
|
||||||
out 43h,al
|
out 43h,al
|
||||||
jmp wait1
|
jmp wait1
|
||||||
wait1:
|
wait1:
|
||||||
in al,40h
|
in al,40h
|
||||||
mov ah,al
|
mov ah,al
|
||||||
jmp wait2
|
jmp wait2
|
||||||
wait2:
|
wait2:
|
||||||
in al,40h
|
in al,40h
|
||||||
xchg ah,al
|
xchg ah,al
|
||||||
ret
|
ret
|
||||||
|
|
||||||
end start
|
end start
|
119
noyau/mcb.asm
Normal file
119
noyau/mcb.asm
Normal file
@ -0,0 +1,119 @@
|
|||||||
|
FirstMB dw 0
|
||||||
|
|
||||||
|
;Initialise les blocs de mémoire
|
||||||
|
MBinit:
|
||||||
|
push ax cx es
|
||||||
|
mov ax,gs
|
||||||
|
mov cs:Firstmb,ax
|
||||||
|
dec ax
|
||||||
|
mov es,ax
|
||||||
|
mov cx,0A000h
|
||||||
|
sub cx,ax
|
||||||
|
dec cx
|
||||||
|
mov es:[MB.Reference],Free
|
||||||
|
mov es:[MB.Sizes],cx
|
||||||
|
mov es:[MB.Check],'NH'
|
||||||
|
mov es:[MB.IsNotLast],False
|
||||||
|
clc
|
||||||
|
pop es cx ax
|
||||||
|
ret
|
||||||
|
notforfree:
|
||||||
|
stc
|
||||||
|
pop es cx ax
|
||||||
|
ret
|
||||||
|
|
||||||
|
;Libère le bloc de mémoire GS
|
||||||
|
MBFree:
|
||||||
|
push bx es
|
||||||
|
mov bx,gs
|
||||||
|
dec bx
|
||||||
|
mov es,bx
|
||||||
|
cmp es:[MB.Check],'NH'
|
||||||
|
je notforfree
|
||||||
|
mov es:[MB.IsResident],0
|
||||||
|
mov es:[MB.Reference],Free
|
||||||
|
mov dword ptr es:[MB.Names],'eerF'
|
||||||
|
mov dword ptr es:[MB.Names+4],0
|
||||||
|
pop es bx
|
||||||
|
ret
|
||||||
|
|
||||||
|
;Creér un bloc de nom ds:si de taille cx (octets) -> n°segement dans GS
|
||||||
|
MBCreate:
|
||||||
|
push ax bx cx dx si di es
|
||||||
|
shr cx,4
|
||||||
|
inc cx
|
||||||
|
mov bx,cs:firstmb
|
||||||
|
dec bx
|
||||||
|
searchfree:
|
||||||
|
mov es,bx
|
||||||
|
cmp es:[MB.Check],'NH'
|
||||||
|
jne wasntgood
|
||||||
|
cmp es:[MB.IsNotLast],True
|
||||||
|
sete dl
|
||||||
|
cmp es:[MB.Reference],Free
|
||||||
|
je weregood
|
||||||
|
cmp dl,False
|
||||||
|
je wasntgood
|
||||||
|
notsogood:
|
||||||
|
inc bx
|
||||||
|
add bx,es:[MB.Sizes]
|
||||||
|
jmp searchfree
|
||||||
|
weregood:
|
||||||
|
mov ax,es:[MB.Sizes]
|
||||||
|
cmp cx,ax
|
||||||
|
ja notsogood
|
||||||
|
mov es:[MB.IsNotLast],True
|
||||||
|
mov es:[MB.Reference],cs
|
||||||
|
mov es:[MB.IsResident],False
|
||||||
|
mov es:[MB.Sizes],cx
|
||||||
|
mov di,MB.Names
|
||||||
|
push ax cx
|
||||||
|
mov cx,8
|
||||||
|
loops:
|
||||||
|
mov dh,[si]
|
||||||
|
inc si
|
||||||
|
dec cx
|
||||||
|
jz endofloops
|
||||||
|
cmp dh,0
|
||||||
|
je endofloops
|
||||||
|
mov es:[di],dh
|
||||||
|
inc di
|
||||||
|
jmp loops
|
||||||
|
endofloops:
|
||||||
|
inc cx
|
||||||
|
mov al,0
|
||||||
|
rep stosb
|
||||||
|
pop cx ax
|
||||||
|
mov word ptr es:[MB.Check],'NH'
|
||||||
|
sub ax,cx
|
||||||
|
dec ax
|
||||||
|
js nofree
|
||||||
|
inc bx
|
||||||
|
mov gs,bx
|
||||||
|
add bx,cx
|
||||||
|
mov es,bx
|
||||||
|
mov es:[MB.IsNotLast],dl
|
||||||
|
mov es:[MB.IsResident],False
|
||||||
|
mov es:[MB.Reference],Free
|
||||||
|
mov es:[MB.Sizes],ax
|
||||||
|
mov dword ptr es:[MB.Names],'eerF'
|
||||||
|
mov dword ptr es:[MB.Names+4],0
|
||||||
|
mov es:[MB.Check],'NH'
|
||||||
|
nofree:
|
||||||
|
clc
|
||||||
|
pop es di si dx cx bx ax
|
||||||
|
ret
|
||||||
|
wasntgood:
|
||||||
|
stc
|
||||||
|
pop es di si dx cx bx ax
|
||||||
|
ret
|
||||||
|
|
||||||
|
;Rend le segment GS résident
|
||||||
|
MBresident:
|
||||||
|
push bx es
|
||||||
|
mov bx,gs
|
||||||
|
dec bx
|
||||||
|
mov es,bx
|
||||||
|
mov es:[MB.IsResident],True
|
||||||
|
pop es bx
|
||||||
|
ret
|
BIN
noyau/old8x8.fnt
BIN
noyau/old8x8.fnt
Binary file not shown.
1398
noyau/lpt.asm → noyau/port.asm
Executable file → Normal file
1398
noyau/lpt.asm → noyau/port.asm
Executable file → Normal file
File diff suppressed because it is too large
Load Diff
654
noyau/mouse.asm → noyau/souris.asm
Executable file → Normal file
654
noyau/mouse.asm → noyau/souris.asm
Executable file → Normal file
@ -1,327 +1,327 @@
|
|||||||
.model tiny
|
.model tiny
|
||||||
.486
|
.486
|
||||||
smart
|
smart
|
||||||
.code
|
.code
|
||||||
org 0100h
|
org 0100h
|
||||||
start:
|
start:
|
||||||
jmp tsr
|
jmp tsr
|
||||||
drv db 'MOUSE',0
|
drv db 'MOUSE',0
|
||||||
Tsr:
|
Tsr:
|
||||||
cli
|
cli
|
||||||
cmp ax,1234h
|
cmp ax,1234h
|
||||||
jne nomore
|
jne nomore
|
||||||
mov ax,4321h
|
mov ax,4321h
|
||||||
jmp itsok
|
jmp itsok
|
||||||
nomore:
|
nomore:
|
||||||
push bx ax
|
push bx ax
|
||||||
mov ah,4
|
mov ah,4
|
||||||
mov bh,0
|
mov bh,0
|
||||||
int 50h
|
int 50h
|
||||||
mov bl,al
|
mov bl,al
|
||||||
pop ax
|
pop ax
|
||||||
cmp byte ptr cs:isact,1
|
cmp byte ptr cs:isact,1
|
||||||
je nottest
|
je nottest
|
||||||
mov cs:isact,1
|
mov cs:isact,1
|
||||||
and bl,10000b
|
and bl,10000b
|
||||||
cmp bl,16
|
cmp bl,16
|
||||||
jae react
|
jae react
|
||||||
mov bl,ah
|
mov bl,ah
|
||||||
xor bh,bh
|
xor bh,bh
|
||||||
shl bx,1
|
shl bx,1
|
||||||
mov bx,cs:[bx].tables
|
mov bx,cs:[bx].tables
|
||||||
mov cs:current,bx
|
mov cs:current,bx
|
||||||
pop bx
|
pop bx
|
||||||
call cs:current
|
call cs:current
|
||||||
itsok:
|
itsok:
|
||||||
jnc noerror
|
jnc noerror
|
||||||
push bp
|
push bp
|
||||||
mov bp,sp
|
mov bp,sp
|
||||||
or byte ptr [bp+6],1b
|
or byte ptr [bp+6],1b
|
||||||
pop bp
|
pop bp
|
||||||
mov ax,cs
|
mov ax,cs
|
||||||
shl eax,16
|
shl eax,16
|
||||||
mov ax,cs:current
|
mov ax,cs:current
|
||||||
jmp endofint
|
jmp endofint
|
||||||
noerror:
|
noerror:
|
||||||
push bp
|
push bp
|
||||||
mov bp,sp
|
mov bp,sp
|
||||||
and byte ptr [bp+6],0FEh
|
and byte ptr [bp+6],0FEh
|
||||||
pop bp
|
pop bp
|
||||||
endofint:
|
endofint:
|
||||||
mov cs:isact,0
|
mov cs:isact,0
|
||||||
sti
|
sti
|
||||||
iret
|
iret
|
||||||
nottest:
|
nottest:
|
||||||
pop bx
|
pop bx
|
||||||
jmp endofint
|
jmp endofint
|
||||||
current dw 0
|
current dw 0
|
||||||
tables dw cmdmouse
|
tables dw cmdmouse
|
||||||
dw cmdmouse2
|
dw cmdmouse2
|
||||||
dw detectmouse
|
dw detectmouse
|
||||||
dw getmouse
|
dw getmouse
|
||||||
dw getmousescreen
|
dw getmousescreen
|
||||||
dw configmouse
|
dw configmouse
|
||||||
|
|
||||||
isact db 0
|
isact db 0
|
||||||
|
|
||||||
;Envoie une commande AL … la souris via controleur clavier
|
;Envoie une commande AL … la souris via controleur clavier
|
||||||
cmdmouse:
|
cmdmouse:
|
||||||
push ax
|
push ax
|
||||||
videbuff1:
|
videbuff1:
|
||||||
in al, 64h
|
in al, 64h
|
||||||
and al, 10b
|
and al, 10b
|
||||||
jne videbuff1
|
jne videbuff1
|
||||||
mov al, 00d4h
|
mov al, 00d4h
|
||||||
out 64h, al
|
out 64h, al
|
||||||
videbuff2:
|
videbuff2:
|
||||||
in al, 64h
|
in al, 64h
|
||||||
and al, 10b
|
and al, 10b
|
||||||
jne videbuff2
|
jne videbuff2
|
||||||
pop ax
|
pop ax
|
||||||
out 60h, al
|
out 60h, al
|
||||||
in al, 60h
|
in al, 60h
|
||||||
ret
|
ret
|
||||||
|
|
||||||
;Envoie une commande2 AL … la souris via controleur clavier carry=nomouse
|
;Envoie une commande2 AL … la souris via controleur clavier carry=nomouse
|
||||||
cmdmouse2:
|
cmdmouse2:
|
||||||
push ax
|
push ax
|
||||||
videbuff21:
|
videbuff21:
|
||||||
in al, 64h
|
in al, 64h
|
||||||
and al, 10b
|
and al, 10b
|
||||||
jne videbuff21
|
jne videbuff21
|
||||||
mov al, 0060h
|
mov al, 0060h
|
||||||
out 64h, al
|
out 64h, al
|
||||||
videbuff22:
|
videbuff22:
|
||||||
in al, 64h
|
in al, 64h
|
||||||
and al, 10b
|
and al, 10b
|
||||||
jne videbuff22
|
jne videbuff22
|
||||||
pop ax
|
pop ax
|
||||||
out 60h, al
|
out 60h, al
|
||||||
in al, 60h
|
in al, 60h
|
||||||
ret
|
ret
|
||||||
|
|
||||||
Detectmouse:
|
Detectmouse:
|
||||||
push ax cx
|
push ax cx
|
||||||
mov al, 0a8h ;AUX enable
|
mov al, 0a8h ;AUX enable
|
||||||
out 64h, al
|
out 64h, al
|
||||||
mov al, 0f3h ;Set sample
|
mov al, 0f3h ;Set sample
|
||||||
call cmdmouse
|
call cmdmouse
|
||||||
mov al, 100 ;Set sample
|
mov al, 100 ;Set sample
|
||||||
call cmdmouse
|
call cmdmouse
|
||||||
mov al, 0e8h ;Set resolution
|
mov al, 0e8h ;Set resolution
|
||||||
call cmdmouse
|
call cmdmouse
|
||||||
mov al, 01 ;Set resolution
|
mov al, 01 ;Set resolution
|
||||||
call cmdmouse
|
call cmdmouse
|
||||||
mov al, 0e7h ;Set scale 2:1
|
mov al, 0e7h ;Set scale 2:1
|
||||||
call cmdmouse
|
call cmdmouse
|
||||||
mov al, 0f4h ;Enable device
|
mov al, 0f4h ;Enable device
|
||||||
call cmdmouse
|
call cmdmouse
|
||||||
mov al, 47h ;Interruption ON
|
mov al, 47h ;Interruption ON
|
||||||
call cmdmouse2
|
call cmdmouse2
|
||||||
mov cx, 1024
|
mov cx, 1024
|
||||||
testmouse:
|
testmouse:
|
||||||
in al, 60h ;Lecture du port de donn‚es
|
in al, 60h ;Lecture du port de donn‚es
|
||||||
cmp al, 250 ;Test si il y a une souris
|
cmp al, 250 ;Test si il y a une souris
|
||||||
je okmouse
|
je okmouse
|
||||||
dec cx
|
dec cx
|
||||||
jnz testmouse
|
jnz testmouse
|
||||||
stc
|
stc
|
||||||
jmp endoftest
|
jmp endoftest
|
||||||
okmouse:
|
okmouse:
|
||||||
clc
|
clc
|
||||||
endoftest:
|
endoftest:
|
||||||
pop cx ax
|
pop cx ax
|
||||||
ret
|
ret
|
||||||
|
|
||||||
;envoie en bx,cx les coordonn‚es et en dl les boutons
|
;envoie en bx,cx les coordonn‚es et en dl les boutons
|
||||||
getmouse:
|
getmouse:
|
||||||
mov bx,cs:rx
|
mov bx,cs:rx
|
||||||
mov cx,cs:ry
|
mov cx,cs:ry
|
||||||
mov dl,cs:button
|
mov dl,cs:button
|
||||||
sub dl,8
|
sub dl,8
|
||||||
and dl,0Fh
|
and dl,0Fh
|
||||||
clc
|
clc
|
||||||
ret
|
ret
|
||||||
|
|
||||||
;envoie en di les coordonn‚es ecran et en dl les boutons
|
;envoie en di les coordonn‚es ecran et en dl les boutons
|
||||||
getmousescreen:
|
getmousescreen:
|
||||||
mov di,cs:xy
|
mov di,cs:xy
|
||||||
mov dl,cs:button
|
mov dl,cs:button
|
||||||
sub dl,8
|
sub dl,8
|
||||||
and dl,0Fh
|
and dl,0Fh
|
||||||
clc
|
clc
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
|
||||||
;configure la rapidit‚ dans cl et dans ah,al sphŠre x et y
|
;configure la rapidit‚ dans cl et dans ah,al sphŠre x et y
|
||||||
Configmouse:
|
Configmouse:
|
||||||
mov cs:speed,cl
|
mov cs:speed,cl
|
||||||
mov cs:spherex,ah
|
mov cs:spherex,ah
|
||||||
mov cs:spherey,al
|
mov cs:spherey,al
|
||||||
ret
|
ret
|
||||||
|
|
||||||
Button db 0
|
Button db 0
|
||||||
rx dw 0
|
rx dw 0
|
||||||
ry dw 0
|
ry dw 0
|
||||||
VX db 0
|
VX db 0
|
||||||
VY db 0
|
VY db 0
|
||||||
X dw 7FFFh
|
X dw 7FFFh
|
||||||
Y dw 7FFFh
|
Y dw 7FFFh
|
||||||
speed db 6
|
speed db 6
|
||||||
spherex db 0
|
spherex db 0
|
||||||
spherey db 0
|
spherey db 0
|
||||||
count db 0
|
count db 0
|
||||||
error db 0
|
error db 0
|
||||||
xy dw 0
|
xy dw 0
|
||||||
old db 0
|
old db 0
|
||||||
;Gestionnaire de souris PS/2
|
;Gestionnaire de souris PS/2
|
||||||
react:
|
react:
|
||||||
push ax bx cx dx di ds es
|
push ax bx cx dx di ds es
|
||||||
push cs
|
push cs
|
||||||
pop ds
|
pop ds
|
||||||
in al, 60h
|
in al, 60h
|
||||||
cmp error, 1
|
cmp error, 1
|
||||||
je gest1
|
je gest1
|
||||||
cmp count, 1
|
cmp count, 1
|
||||||
je gest1
|
je gest1
|
||||||
cmp count, 2
|
cmp count, 2
|
||||||
je gest2
|
je gest2
|
||||||
cmp count, 3
|
cmp count, 3
|
||||||
je gest3
|
je gest3
|
||||||
|
|
||||||
gest1:
|
gest1:
|
||||||
mov count, 2
|
mov count, 2
|
||||||
mov Button, al
|
mov Button, al
|
||||||
and al, 00001000b
|
and al, 00001000b
|
||||||
cmp al, 8
|
cmp al, 8
|
||||||
je gest1end
|
je gest1end
|
||||||
mov error, 1
|
mov error, 1
|
||||||
jmp gest1end2
|
jmp gest1end2
|
||||||
gest1end:
|
gest1end:
|
||||||
mov error, 0
|
mov error, 0
|
||||||
gest1end2:
|
gest1end2:
|
||||||
mov count, 2
|
mov count, 2
|
||||||
jmp endgest
|
jmp endgest
|
||||||
gest2:
|
gest2:
|
||||||
mov count, 3
|
mov count, 3
|
||||||
mov VX, al
|
mov VX, al
|
||||||
jmp endgest
|
jmp endgest
|
||||||
gest3:
|
gest3:
|
||||||
mov count, 1
|
mov count, 1
|
||||||
mov VY, al
|
mov VY, al
|
||||||
jmp endgest
|
jmp endgest
|
||||||
endgest:
|
endgest:
|
||||||
cmp error,1
|
cmp error,1
|
||||||
je errormouse
|
je errormouse
|
||||||
push cs
|
push cs
|
||||||
pop es
|
pop es
|
||||||
mov di,offset infos
|
mov di,offset infos
|
||||||
mov ah,34
|
mov ah,34
|
||||||
int 47h
|
int 47h
|
||||||
mov cl,speed
|
mov cl,speed
|
||||||
movsx bx,VY
|
movsx bx,VY
|
||||||
shl bx,cl
|
shl bx,cl
|
||||||
cmp spherey,0
|
cmp spherey,0
|
||||||
jne nolimity
|
jne nolimity
|
||||||
xor ah,ah
|
xor ah,ah
|
||||||
mov al,[di]
|
mov al,[di]
|
||||||
cmp byte ptr [di+7],4
|
cmp byte ptr [di+7],4
|
||||||
jbe text4
|
jbe text4
|
||||||
shl ax,3
|
shl ax,3
|
||||||
text4:
|
text4:
|
||||||
dec ax
|
dec ax
|
||||||
cmp bx,0
|
cmp bx,0
|
||||||
jg decy
|
jg decy
|
||||||
cmp ry,ax
|
cmp ry,ax
|
||||||
jae noaddy
|
jae noaddy
|
||||||
jmp nolimity
|
jmp nolimity
|
||||||
decy:
|
decy:
|
||||||
cmp ry,0
|
cmp ry,0
|
||||||
je noaddy
|
je noaddy
|
||||||
nolimity:
|
nolimity:
|
||||||
sub y,bx
|
sub y,bx
|
||||||
noaddy:
|
noaddy:
|
||||||
movsx bx,VX
|
movsx bx,VX
|
||||||
shl bx,cl
|
shl bx,cl
|
||||||
cmp spherex,0
|
cmp spherex,0
|
||||||
jne nolimitx
|
jne nolimitx
|
||||||
xor ah,ah
|
xor ah,ah
|
||||||
mov al,[di+1]
|
mov al,[di+1]
|
||||||
cmp byte ptr [di+7],4
|
cmp byte ptr [di+7],4
|
||||||
jbe text5
|
jbe text5
|
||||||
shl ax,3
|
shl ax,3
|
||||||
text5:
|
text5:
|
||||||
dec ax
|
dec ax
|
||||||
cmp bx,0
|
cmp bx,0
|
||||||
jl decx
|
jl decx
|
||||||
cmp rx,ax
|
cmp rx,ax
|
||||||
jae noaddx
|
jae noaddx
|
||||||
jmp nolimitx
|
jmp nolimitx
|
||||||
decx:
|
decx:
|
||||||
cmp rx,0
|
cmp rx,0
|
||||||
je noaddx
|
je noaddx
|
||||||
nolimitx:
|
nolimitx:
|
||||||
add x,bx
|
add x,bx
|
||||||
noaddx:
|
noaddx:
|
||||||
mov ax,x
|
mov ax,x
|
||||||
mov bx,0FFFFh
|
mov bx,0FFFFh
|
||||||
xor ch,ch
|
xor ch,ch
|
||||||
mov cl,[di+1]
|
mov cl,[di+1]
|
||||||
cmp byte ptr [di+7],4
|
cmp byte ptr [di+7],4
|
||||||
jbe text1
|
jbe text1
|
||||||
shl cx,3
|
shl cx,3
|
||||||
text1:
|
text1:
|
||||||
mul cx
|
mul cx
|
||||||
div bx
|
div bx
|
||||||
mov rx,ax
|
mov rx,ax
|
||||||
mov ax,y
|
mov ax,y
|
||||||
xor ch,ch
|
xor ch,ch
|
||||||
mov cl,[di]
|
mov cl,[di]
|
||||||
cmp byte ptr [di+7],4
|
cmp byte ptr [di+7],4
|
||||||
jbe text2
|
jbe text2
|
||||||
shl cx,3
|
shl cx,3
|
||||||
text2:
|
text2:
|
||||||
mul cx
|
mul cx
|
||||||
div bx
|
div bx
|
||||||
mov ry,ax
|
mov ry,ax
|
||||||
xor ch,ch
|
xor ch,ch
|
||||||
mov cl,[di+1]
|
mov cl,[di+1]
|
||||||
cmp byte ptr [di+7],4
|
cmp byte ptr [di+7],4
|
||||||
jbe text3
|
jbe text3
|
||||||
shl cx,3
|
shl cx,3
|
||||||
text3:
|
text3:
|
||||||
mul cx
|
mul cx
|
||||||
add ax,rx
|
add ax,rx
|
||||||
cmp byte ptr [di+7],4
|
cmp byte ptr [di+7],4
|
||||||
mov di,ax
|
mov di,ax
|
||||||
jbe textpoint
|
jbe textpoint
|
||||||
mov ax,0A000h
|
mov ax,0A000h
|
||||||
mov es,ax
|
mov es,ax
|
||||||
jmp graphpoint
|
jmp graphpoint
|
||||||
textpoint:
|
textpoint:
|
||||||
mov ax,0B800h
|
mov ax,0B800h
|
||||||
mov es,ax
|
mov es,ax
|
||||||
shl di,1
|
shl di,1
|
||||||
inc di
|
inc di
|
||||||
graphpoint:
|
graphpoint:
|
||||||
mov bx,xy
|
mov bx,xy
|
||||||
cmp byte ptr es:[bx],070h
|
cmp byte ptr es:[bx],070h
|
||||||
jne waschanged
|
jne waschanged
|
||||||
mov al,old
|
mov al,old
|
||||||
mov byte ptr es:[bx],al
|
mov byte ptr es:[bx],al
|
||||||
waschanged:
|
waschanged:
|
||||||
mov xy,di
|
mov xy,di
|
||||||
mov al,es:[di]
|
mov al,es:[di]
|
||||||
mov old,al
|
mov old,al
|
||||||
mov byte ptr es:[di],070h
|
mov byte ptr es:[di],070h
|
||||||
mov al, 20h
|
mov al, 20h
|
||||||
out 0a0h, al
|
out 0a0h, al
|
||||||
out 20h, al
|
out 20h, al
|
||||||
errormouse:
|
errormouse:
|
||||||
pop es ds di dx cx bx ax
|
pop es ds di dx cx bx ax
|
||||||
mov cs:isact,0
|
mov cs:isact,0
|
||||||
pop bx
|
pop bx
|
||||||
iret
|
iret
|
||||||
infos db 40 dup (0)
|
infos db 40 dup (0)
|
||||||
|
|
||||||
end start
|
end start
|
676
noyau/system.asm
676
noyau/system.asm
@ -1,676 +0,0 @@
|
|||||||
.model tiny
|
|
||||||
.486
|
|
||||||
smart
|
|
||||||
.code
|
|
||||||
|
|
||||||
org 0100h
|
|
||||||
|
|
||||||
start:
|
|
||||||
mov si,offset video
|
|
||||||
mov bx,400h
|
|
||||||
mov ax,47h
|
|
||||||
call installhandler
|
|
||||||
jc erroron
|
|
||||||
mov si,offset timer
|
|
||||||
mov bx,900h
|
|
||||||
mov ax,8h
|
|
||||||
call replacehandler
|
|
||||||
jc erroron
|
|
||||||
mov si,offset pic
|
|
||||||
mov bx,950h
|
|
||||||
mov ax,50h
|
|
||||||
call installhandler
|
|
||||||
jc erroron
|
|
||||||
mov si,offset drive
|
|
||||||
mov bx,1020h
|
|
||||||
mov ax,48h
|
|
||||||
call installhandler
|
|
||||||
jc erroron
|
|
||||||
mov si,offset keyboard
|
|
||||||
mov bx,1400h
|
|
||||||
mov ax,9h
|
|
||||||
call replacehandler
|
|
||||||
jc erroron
|
|
||||||
mov ax,40h
|
|
||||||
mov es,ax
|
|
||||||
mov dx,es:[8]
|
|
||||||
cmp dx,0
|
|
||||||
je nolpt1
|
|
||||||
mov al,0FFh
|
|
||||||
add dx,2
|
|
||||||
out dx,al
|
|
||||||
mov si,offset lpt
|
|
||||||
mov bx,1500h
|
|
||||||
mov ax,0Fh
|
|
||||||
call installhandler
|
|
||||||
jc erroron
|
|
||||||
mov es,bx
|
|
||||||
sub al,8
|
|
||||||
xor ah,ah
|
|
||||||
int 50h
|
|
||||||
mov byte ptr es:[105h],'1'
|
|
||||||
nolpt1:
|
|
||||||
push es
|
|
||||||
mov ax,40h
|
|
||||||
mov es,ax
|
|
||||||
mov dx,es:[10]
|
|
||||||
pop es
|
|
||||||
cmp dx,0
|
|
||||||
je nolpt2
|
|
||||||
mov al,0FFh
|
|
||||||
add dx,2
|
|
||||||
out dx,al
|
|
||||||
mov si,offset lpt
|
|
||||||
mov bx,1700h
|
|
||||||
mov ax,0Dh
|
|
||||||
call installhandler
|
|
||||||
jc erroron
|
|
||||||
sub al,8
|
|
||||||
xor ah,ah
|
|
||||||
int 50h
|
|
||||||
mov es,bx
|
|
||||||
mov byte ptr es:[105h],'2'
|
|
||||||
nolpt2:
|
|
||||||
mov si,offset mouse
|
|
||||||
mov bx,1900h
|
|
||||||
mov ax,74h
|
|
||||||
call installhandler
|
|
||||||
jc erroron
|
|
||||||
mov ax,0012
|
|
||||||
int 50h
|
|
||||||
mov ah,2
|
|
||||||
int 74h
|
|
||||||
;mov si,offset joystick
|
|
||||||
;mov bx,2700h
|
|
||||||
;mov ax,08h
|
|
||||||
;call replacehandler
|
|
||||||
mov si,offset hours
|
|
||||||
mov bx,2900h
|
|
||||||
mov ax,08h
|
|
||||||
call replacehandler
|
|
||||||
|
|
||||||
start2:
|
|
||||||
push cs
|
|
||||||
push cs
|
|
||||||
pop ds
|
|
||||||
pop es
|
|
||||||
mov ah,21
|
|
||||||
mov cl,7
|
|
||||||
int 47h
|
|
||||||
mov ax,0002
|
|
||||||
int 47h
|
|
||||||
mov ah,2
|
|
||||||
int 47h
|
|
||||||
mov ah,25
|
|
||||||
mov bx,0
|
|
||||||
int 47h
|
|
||||||
mov ah,13
|
|
||||||
mov si,offset msg1
|
|
||||||
int 47h
|
|
||||||
mov ah,6
|
|
||||||
int 47h
|
|
||||||
int 47h
|
|
||||||
mov ah,13
|
|
||||||
mov si,offset prompt
|
|
||||||
int 47h
|
|
||||||
mov ah,6
|
|
||||||
int 47h
|
|
||||||
xor di,di
|
|
||||||
mov ax,0001h
|
|
||||||
mov bx,offset buffer
|
|
||||||
mov cx,13
|
|
||||||
int 48h
|
|
||||||
xor bp,bp
|
|
||||||
showall:
|
|
||||||
cmp byte ptr [bx+di],0
|
|
||||||
je endof2
|
|
||||||
mov al,[bx+di+12]
|
|
||||||
mov byte ptr [bx+di+12],0
|
|
||||||
mov si,bx
|
|
||||||
add si,di
|
|
||||||
mov ah,13
|
|
||||||
int 47h
|
|
||||||
mov si,offset spaces
|
|
||||||
int 47h
|
|
||||||
mov [bx+di+12],al
|
|
||||||
mov byte ptr [bx+di+12+5],0
|
|
||||||
mov si,bx
|
|
||||||
add si,di
|
|
||||||
add si,12
|
|
||||||
int 47h
|
|
||||||
mov ah,6
|
|
||||||
int 47h
|
|
||||||
add di,32
|
|
||||||
inc bp
|
|
||||||
jmp showall
|
|
||||||
endof2:
|
|
||||||
mov ah,21
|
|
||||||
mov cl,112
|
|
||||||
int 47h
|
|
||||||
mov ah,13
|
|
||||||
mov si,offset menu
|
|
||||||
int 47h
|
|
||||||
mov xx,1
|
|
||||||
mov xxold,2
|
|
||||||
call Select
|
|
||||||
endof:
|
|
||||||
mov ax,0
|
|
||||||
int 16h
|
|
||||||
cmp ah,50h
|
|
||||||
jne tre1
|
|
||||||
cmp xx,bp
|
|
||||||
je endof
|
|
||||||
inc xx
|
|
||||||
call select
|
|
||||||
jmp endof
|
|
||||||
tre1:
|
|
||||||
cmp ah,48h
|
|
||||||
jne tre2
|
|
||||||
cmp xx,1
|
|
||||||
je endof
|
|
||||||
dec xx
|
|
||||||
call select
|
|
||||||
jmp endof
|
|
||||||
tre2:
|
|
||||||
cmp al,0Dh
|
|
||||||
jne tre3
|
|
||||||
mov di,xx
|
|
||||||
dec di
|
|
||||||
shl di,5
|
|
||||||
mov dx,[di+bx+26]
|
|
||||||
cmp [di+bx+12],00657865h ;EXE
|
|
||||||
jne tre3
|
|
||||||
mov ah,6
|
|
||||||
int 47h
|
|
||||||
int 47h
|
|
||||||
mov ah,21
|
|
||||||
mov cl,7
|
|
||||||
int 47h
|
|
||||||
mov ah,13
|
|
||||||
mov si,offset msg2
|
|
||||||
int 47h
|
|
||||||
mov cx,dx
|
|
||||||
call executefatway
|
|
||||||
tre3:
|
|
||||||
cmp ah,59
|
|
||||||
jne tre4
|
|
||||||
mov lastread,0FFFFh
|
|
||||||
jmp start2
|
|
||||||
tre4:
|
|
||||||
cmp ah,67
|
|
||||||
jne endof
|
|
||||||
mov ax,0001
|
|
||||||
int 47h
|
|
||||||
mov ah,2
|
|
||||||
int 47h
|
|
||||||
mov ah,21
|
|
||||||
mov cl,4
|
|
||||||
int 47h
|
|
||||||
mov ah,13
|
|
||||||
mov si,offset msg3
|
|
||||||
int 47h
|
|
||||||
mov ax,0
|
|
||||||
int 16h
|
|
||||||
mov ax,40h
|
|
||||||
mov ds,ax
|
|
||||||
mov bx,1234h
|
|
||||||
mov ds:[072h],bx
|
|
||||||
push 0FFFFh
|
|
||||||
push 0000h
|
|
||||||
db 0CBh
|
|
||||||
|
|
||||||
executefatway:
|
|
||||||
push cs
|
|
||||||
mov bx,offset start2
|
|
||||||
push bx
|
|
||||||
mov bx,03000h
|
|
||||||
mov es,bx
|
|
||||||
push bx
|
|
||||||
mov bx,0100h
|
|
||||||
push bx
|
|
||||||
call loadfatway
|
|
||||||
push es
|
|
||||||
push es
|
|
||||||
push es
|
|
||||||
pop ds
|
|
||||||
pop fs
|
|
||||||
pop gs
|
|
||||||
push 7202h
|
|
||||||
popf
|
|
||||||
db 0CBh
|
|
||||||
|
|
||||||
;selectionne la ligne xx
|
|
||||||
Select:
|
|
||||||
push ax di
|
|
||||||
mov di,xxold
|
|
||||||
mov al,7
|
|
||||||
add di,2
|
|
||||||
mov ah,32
|
|
||||||
int 47h
|
|
||||||
mov ax,xx
|
|
||||||
mov xxold,ax
|
|
||||||
mov di,xx
|
|
||||||
mov ah,32
|
|
||||||
mov al,112
|
|
||||||
add di,2
|
|
||||||
int 47h
|
|
||||||
pop di ax
|
|
||||||
ret
|
|
||||||
|
|
||||||
xx dw 1
|
|
||||||
xxold dw 0
|
|
||||||
menu db 'F1 Read disk F2 Read file F9 Quit F11 Change video F12 Debug ',0
|
|
||||||
msg1 db ' Cos 2000 menu loader release 1.0',0
|
|
||||||
msg2 db 'The program is loading',0
|
|
||||||
msg3 db ' Cos will restart your computer, eject the floppy disk and press a key',0
|
|
||||||
prompt db '>',0
|
|
||||||
spaces db ' ',0
|
|
||||||
dot db '.',0
|
|
||||||
|
|
||||||
;cx entr‚e -> fatway chemin
|
|
||||||
getfatway:
|
|
||||||
push bx cx
|
|
||||||
mov bx,offset fatway
|
|
||||||
fatagain:
|
|
||||||
mov cs:[bx],cx
|
|
||||||
add bx,2
|
|
||||||
cmp cx,0FFF0h
|
|
||||||
jae finishload
|
|
||||||
call getfat
|
|
||||||
jnc fatagain
|
|
||||||
finishload:
|
|
||||||
pop cx bx
|
|
||||||
ret
|
|
||||||
|
|
||||||
;Charge le fichier de chemin cx -> taille dx
|
|
||||||
loadfatway:
|
|
||||||
push ax bx cx di
|
|
||||||
call getfatway
|
|
||||||
jc endload
|
|
||||||
mov di,offset fatway
|
|
||||||
mov si,offset dot
|
|
||||||
mov ah,13
|
|
||||||
xor dx,dx
|
|
||||||
loadagain:
|
|
||||||
mov cx,cs:[di]
|
|
||||||
cmp cx,0FFF0h
|
|
||||||
jae endload
|
|
||||||
add di,2
|
|
||||||
call readsector
|
|
||||||
jc endload
|
|
||||||
add bx,cs:sizec
|
|
||||||
add dx,cs:sizec
|
|
||||||
jmp loadagain
|
|
||||||
endload:
|
|
||||||
pop di cx bx ax
|
|
||||||
ret
|
|
||||||
|
|
||||||
|
|
||||||
sizec dw 512
|
|
||||||
reserv dw 1
|
|
||||||
|
|
||||||
;<-cx nøsecteur ->cx code FAT
|
|
||||||
getfat:
|
|
||||||
push es ax bx dx
|
|
||||||
push cs
|
|
||||||
pop ds
|
|
||||||
push cs
|
|
||||||
pop es
|
|
||||||
mov ax,cx
|
|
||||||
xor dx,dx
|
|
||||||
div sizec
|
|
||||||
mov cx,ax
|
|
||||||
add cx,reserv
|
|
||||||
mov bx,offset buffer
|
|
||||||
call readsector
|
|
||||||
jc errorgetfat
|
|
||||||
shl dx,1
|
|
||||||
add bx,dx
|
|
||||||
mov cx,[bx]
|
|
||||||
errorgetfat:
|
|
||||||
pop dx bx ax es
|
|
||||||
ret
|
|
||||||
|
|
||||||
ReadSector:
|
|
||||||
push ax cx dx si
|
|
||||||
cmp cx,cs:lastread
|
|
||||||
je done
|
|
||||||
mov cs:LastRead,cx
|
|
||||||
mov AX, CX
|
|
||||||
xor DX, DX
|
|
||||||
div cs:DiskSectorsPerTrack
|
|
||||||
mov CL, DL ;{ Set the sector }
|
|
||||||
and CL, 63 ;{ Top two bits are bits 8&9 of the cylinder }
|
|
||||||
xor DX, DX
|
|
||||||
div cs:DiskTracksPerHead
|
|
||||||
mov CH, DL ;{ Set the track bits 0-7 }
|
|
||||||
mov AL, DH
|
|
||||||
ror AL, 1
|
|
||||||
ror AL, 1
|
|
||||||
and AL, 11000000b
|
|
||||||
or CL, AL ;{ Set bits 8&9 of track }
|
|
||||||
xor dX, DX
|
|
||||||
div cs:DiskHeads
|
|
||||||
mov DH, DL ;{ Set the head }
|
|
||||||
inc CL
|
|
||||||
mov SI, 4
|
|
||||||
TryAgain:
|
|
||||||
mov AL, 1
|
|
||||||
mov DL, 0
|
|
||||||
mov AH, 2
|
|
||||||
int 13h
|
|
||||||
jnc Done
|
|
||||||
dec SI
|
|
||||||
jnz TryAgain
|
|
||||||
mov word ptr cs:lastread,0ffffh
|
|
||||||
Done:
|
|
||||||
pop si dx cx ax
|
|
||||||
ret
|
|
||||||
|
|
||||||
WriteSector:
|
|
||||||
push ax cx dx si
|
|
||||||
cmp cs:Lastread,cx
|
|
||||||
jne nodestruct
|
|
||||||
mov cs:Lastread,0ffffh
|
|
||||||
nodestruct:
|
|
||||||
mov AX, CX
|
|
||||||
xor DX, DX
|
|
||||||
div cs:DiskSectorsPerTrack
|
|
||||||
mov CL, DL ;{ Set the sector }
|
|
||||||
and CL, 63 ;{ Top two bits are bits 8&9 of the cylinder }
|
|
||||||
xor DX, DX
|
|
||||||
div cs:DiskTracksPerHead
|
|
||||||
mov CH, DL ;{ Set the track bits 0-7 }
|
|
||||||
mov AL, DH
|
|
||||||
ror AL, 1
|
|
||||||
ror AL, 1
|
|
||||||
and AL, 11000000b
|
|
||||||
or CL, AL ;{ Set bits 8&9 of track }
|
|
||||||
xor DX, DX
|
|
||||||
div cs:DiskHeads
|
|
||||||
mov DH, DL ;{ Set the head }
|
|
||||||
inc CL
|
|
||||||
mov SI, 4
|
|
||||||
TryAgain2:
|
|
||||||
mov AL, 1
|
|
||||||
mov DL, 0
|
|
||||||
mov AH, 3
|
|
||||||
int 13h
|
|
||||||
jnc Done2
|
|
||||||
dec SI
|
|
||||||
jnz TryAgain2
|
|
||||||
Done2:
|
|
||||||
pop si dx cx ax
|
|
||||||
ret
|
|
||||||
|
|
||||||
Lastread dw 0FFFFh
|
|
||||||
|
|
||||||
;remplace le handler pointer par ds:si en bx:100h interruption ax
|
|
||||||
replacehandler:
|
|
||||||
push ax bx cx si di ds es
|
|
||||||
mov es,bx
|
|
||||||
mov di,0100h
|
|
||||||
call loadfile
|
|
||||||
jc reph
|
|
||||||
mov bx,ax
|
|
||||||
call getint
|
|
||||||
mov es:[102h],si
|
|
||||||
mov es:[104h],ds
|
|
||||||
call setint
|
|
||||||
reph:
|
|
||||||
pop es ds di si cx bx ax
|
|
||||||
ret
|
|
||||||
|
|
||||||
;install le handler pointer par ds:si en bx:100h interruption ax
|
|
||||||
installhandler:
|
|
||||||
push bx cx di es
|
|
||||||
mov es,bx
|
|
||||||
mov di,100h
|
|
||||||
call loadfile
|
|
||||||
jc insh
|
|
||||||
mov bx,ax
|
|
||||||
call setint
|
|
||||||
insh:
|
|
||||||
pop es di cx bx
|
|
||||||
ret
|
|
||||||
|
|
||||||
;Charge le fichier Ds:si en es:di taille-> cx
|
|
||||||
loadfile:
|
|
||||||
push bx
|
|
||||||
call searchfile
|
|
||||||
jc errorloadfile
|
|
||||||
mov bx,di
|
|
||||||
call loadfatway
|
|
||||||
jc errorloadfile
|
|
||||||
mov cx,dx
|
|
||||||
errorloadfile:
|
|
||||||
pop bx
|
|
||||||
ret
|
|
||||||
|
|
||||||
;met es:di le handle de l'int bx
|
|
||||||
setint:
|
|
||||||
push ax bx ds
|
|
||||||
cli
|
|
||||||
shl bx,2
|
|
||||||
xor ax,ax
|
|
||||||
mov ds,ax
|
|
||||||
mov ds:[bx],di
|
|
||||||
mov ds:[bx+2],es
|
|
||||||
pop ds bx ax
|
|
||||||
sti
|
|
||||||
ret
|
|
||||||
|
|
||||||
;met ds:si le handle de l'int bx
|
|
||||||
getint:
|
|
||||||
push ax bx es
|
|
||||||
shl bx,2
|
|
||||||
xor ax,ax
|
|
||||||
mov es,ax
|
|
||||||
mov si,es:[bx]
|
|
||||||
mov ds,es:[bx+2]
|
|
||||||
pop es bx ax
|
|
||||||
ret
|
|
||||||
|
|
||||||
;Recherche le fichier et retourne sont path et en cx sont debut
|
|
||||||
Searchfile:
|
|
||||||
push ax bx dx si di ds es
|
|
||||||
push cs
|
|
||||||
pop es
|
|
||||||
xor dx,dx
|
|
||||||
mov di,offset temp
|
|
||||||
call asciiztofit
|
|
||||||
push cs
|
|
||||||
pop ds
|
|
||||||
mov cx,13
|
|
||||||
check:
|
|
||||||
mov bx,offset buffer
|
|
||||||
call readsector
|
|
||||||
jc errorboot
|
|
||||||
xor di,di
|
|
||||||
findnext:
|
|
||||||
cmp byte ptr [bx+di],0
|
|
||||||
je errorboot
|
|
||||||
push si di cx
|
|
||||||
mov si,di
|
|
||||||
add si,bx
|
|
||||||
mov di,offset temp
|
|
||||||
mov cx,12+4
|
|
||||||
cld
|
|
||||||
rep cmpsb
|
|
||||||
pop cx di si
|
|
||||||
je oksystem
|
|
||||||
add di,32
|
|
||||||
inc dx
|
|
||||||
cmp dx,nbfit
|
|
||||||
ja errorboot
|
|
||||||
cmp di,sizec
|
|
||||||
jb findnext
|
|
||||||
inc cx
|
|
||||||
jmp Check
|
|
||||||
oksystem:
|
|
||||||
mov cx,[di+BX+26]
|
|
||||||
cld
|
|
||||||
jmp goodboot
|
|
||||||
errorboot:
|
|
||||||
stc
|
|
||||||
goodboot:
|
|
||||||
pop es ds di si dx bx ax
|
|
||||||
ret
|
|
||||||
|
|
||||||
;->name ds:si ->es:di
|
|
||||||
AsciiZtoFit:
|
|
||||||
push ax bx cx dx si di ds es
|
|
||||||
xor bx,bx
|
|
||||||
mov dx,di
|
|
||||||
noextens:
|
|
||||||
mov al,[si+bx]
|
|
||||||
cmp al,'.'
|
|
||||||
je extens
|
|
||||||
call Issystchar
|
|
||||||
jc errortranslate
|
|
||||||
mov es:[di],al
|
|
||||||
inc di
|
|
||||||
inc bx
|
|
||||||
cmp bx,namesize ;(.)
|
|
||||||
jne noextens
|
|
||||||
erro:
|
|
||||||
stc
|
|
||||||
jmp errortranslate
|
|
||||||
extens:
|
|
||||||
add si,bx
|
|
||||||
inc si
|
|
||||||
sub bx,namesize
|
|
||||||
neg bx
|
|
||||||
mov al,0
|
|
||||||
mov cx,bx
|
|
||||||
cld
|
|
||||||
rep stosb
|
|
||||||
xor bx,bx
|
|
||||||
wasextens:
|
|
||||||
mov al,[si+bx]
|
|
||||||
cmp al,0
|
|
||||||
je endextens
|
|
||||||
call Issystchar
|
|
||||||
jc errortranslate
|
|
||||||
mov es:[di],al
|
|
||||||
inc di
|
|
||||||
inc bx
|
|
||||||
cmp bx,extsize
|
|
||||||
jne wasextens
|
|
||||||
jmp erro
|
|
||||||
endextens:
|
|
||||||
sub bx,extsize
|
|
||||||
neg bx
|
|
||||||
mov al,0
|
|
||||||
mov cx,bx
|
|
||||||
cld
|
|
||||||
rep stosb
|
|
||||||
mov si,dx
|
|
||||||
mov di,dx
|
|
||||||
push es
|
|
||||||
pop ds
|
|
||||||
mov cx,extsize+namesize
|
|
||||||
call uppercaseMEM
|
|
||||||
clc
|
|
||||||
endtranslate:
|
|
||||||
pop es ds di si dx cx bx ax
|
|
||||||
ret
|
|
||||||
errortranslate:
|
|
||||||
stc
|
|
||||||
jmp endtranslate
|
|
||||||
|
|
||||||
;Carry si al = caractŠre systŠme
|
|
||||||
isSystchar:
|
|
||||||
push di
|
|
||||||
mov di,offset exeptchar
|
|
||||||
isexcept:
|
|
||||||
cmp al,cs:[di]
|
|
||||||
je nogood
|
|
||||||
inc di
|
|
||||||
cmp byte ptr cs:[di],0
|
|
||||||
jne isexcept
|
|
||||||
endanal:
|
|
||||||
clc
|
|
||||||
pop di
|
|
||||||
ret
|
|
||||||
nogood:
|
|
||||||
stc
|
|
||||||
jmp endanal
|
|
||||||
|
|
||||||
;Transforme les x caractŠres de la mem en ds:si en maj
|
|
||||||
uppercaseMEM:
|
|
||||||
push si di cx ax
|
|
||||||
mov di,si
|
|
||||||
uppercaser:
|
|
||||||
mov al,ds:[si]
|
|
||||||
inc si
|
|
||||||
cmp al,'A'
|
|
||||||
jb nonmaj
|
|
||||||
cmp al,'Z'
|
|
||||||
ja nonmaj
|
|
||||||
add al,'a'-'A'
|
|
||||||
nonmaj:
|
|
||||||
mov es:[di],al
|
|
||||||
inc di
|
|
||||||
dec cx
|
|
||||||
jnz uppercaser
|
|
||||||
enduppercase:
|
|
||||||
clc
|
|
||||||
pop ax cx di si
|
|
||||||
ret
|
|
||||||
|
|
||||||
erroron:
|
|
||||||
push cs
|
|
||||||
pop ds
|
|
||||||
xor edx,edx
|
|
||||||
mov dx,ax
|
|
||||||
mov ax,0001h
|
|
||||||
int 47h
|
|
||||||
mov ah,6
|
|
||||||
int 47h
|
|
||||||
mov ah,6
|
|
||||||
int 47h
|
|
||||||
mov ah,13
|
|
||||||
mov si,offset errormsg
|
|
||||||
int 47h
|
|
||||||
mov ah,10
|
|
||||||
mov cx,16
|
|
||||||
int 47h
|
|
||||||
mov ah,6
|
|
||||||
int 47h
|
|
||||||
mov ah,6
|
|
||||||
int 47h
|
|
||||||
mov ah,13
|
|
||||||
mov si,offset errormsg2
|
|
||||||
int 47h
|
|
||||||
mov ax,0
|
|
||||||
int 16h
|
|
||||||
push 0FFFFh
|
|
||||||
push 0
|
|
||||||
db 0CBh
|
|
||||||
|
|
||||||
errormsg db 'Error with drivers loading on interrupt nø',0
|
|
||||||
errormsg2 db 'Press a key to restart...',0
|
|
||||||
namesize equ 12
|
|
||||||
extsize equ 5
|
|
||||||
nbfit equ 255
|
|
||||||
hours db 'hours.sys',0
|
|
||||||
joystick db 'joystick.sys',0
|
|
||||||
mouse db 'mouse.sys',0
|
|
||||||
pic db 'pic8259a.sys',0
|
|
||||||
drive db 'drive.sys',0
|
|
||||||
timer db 'timer.sys',0
|
|
||||||
lpt db 'lpt.sys',0
|
|
||||||
video db 'video.sys',0
|
|
||||||
keyboard db 'keyboard.sys',0
|
|
||||||
temp db 12+5+1 dup (0)
|
|
||||||
exeptchar db '/\<>:|.',01,0,0
|
|
||||||
DiskSectorsPerTrack dw 18
|
|
||||||
DiskTracksPerHead dw 80
|
|
||||||
DiskHeads dw 2
|
|
||||||
|
|
||||||
fatway equ $
|
|
||||||
|
|
||||||
buffer equ $+3000
|
|
||||||
|
|
||||||
end start
|
|
897
noyau/systeme.asm
Normal file
897
noyau/systeme.asm
Normal file
@ -0,0 +1,897 @@
|
|||||||
|
.model tiny
|
||||||
|
.486
|
||||||
|
smart
|
||||||
|
.code
|
||||||
|
|
||||||
|
org 0100h
|
||||||
|
|
||||||
|
include ..\include\fat.h
|
||||||
|
|
||||||
|
start:
|
||||||
|
push cs
|
||||||
|
push cs
|
||||||
|
push cs
|
||||||
|
push cs
|
||||||
|
pop ds
|
||||||
|
pop es
|
||||||
|
pop fs
|
||||||
|
pop gs
|
||||||
|
;xor ax,ax
|
||||||
|
;mov ds,ax
|
||||||
|
;mov si,7C00h
|
||||||
|
mov si,offset eepop
|
||||||
|
mov di,offset myboot
|
||||||
|
mov cx,type bootsector
|
||||||
|
push cs
|
||||||
|
pop es
|
||||||
|
rep movsb
|
||||||
|
jmp noone
|
||||||
|
|
||||||
|
eepop db 0,0,0
|
||||||
|
bootdb db 'COS2000A' ;Fabricant + n°série Formatage
|
||||||
|
sizec dw 512 ;octet/secteur
|
||||||
|
db 1 ;secteur/cluster
|
||||||
|
reserv dw 1 ;secteur reserv‚
|
||||||
|
nbfat db 2 ;nb de copie de la FAT
|
||||||
|
nbfit dw 224 ;taille rep racine
|
||||||
|
allclu dw 2880 ;nb secteur du volume si < 32 még
|
||||||
|
db 0F0h ;Descripteur de média
|
||||||
|
fatsize dw 9 ;secteur/FAT
|
||||||
|
nbtrack dw 18 ;secteur/piste
|
||||||
|
head dw 2 ;nb de tˆteb de lecture/écriture
|
||||||
|
hidden dd 0 ;nombre de secteur cach‚s
|
||||||
|
dd 0 ;si nbsecteur = 0 nbsect ; the number of sectors
|
||||||
|
bootdrv db 0 ;Lecteur de d‚marrage
|
||||||
|
bootsig db 0 ;NA
|
||||||
|
db 29h ;boot signature 29h
|
||||||
|
bootsig2 dd 01020304h ;no de serie
|
||||||
|
pope db 'COS2000 ' ;nom de volume
|
||||||
|
db 'FAT12 ' ;FAT
|
||||||
|
|
||||||
|
|
||||||
|
xor ax,ax
|
||||||
|
mov es,ax
|
||||||
|
mov di,1Eh*4
|
||||||
|
lds si,es:[di]
|
||||||
|
mov es:[di],cs
|
||||||
|
mov word ptr es:[di],offset myDPT
|
||||||
|
push cs
|
||||||
|
pop es
|
||||||
|
mov cx,type DPT
|
||||||
|
rep movsb
|
||||||
|
mov ax,cs:[Bootsector.SectorsPerTrack]
|
||||||
|
mov es:[DPT.SectorPerTracks],al
|
||||||
|
noone:
|
||||||
|
push cs
|
||||||
|
push cs
|
||||||
|
push cs
|
||||||
|
push cs
|
||||||
|
pop ds
|
||||||
|
pop es
|
||||||
|
pop fs
|
||||||
|
pop gs
|
||||||
|
|
||||||
|
call InitDrive
|
||||||
|
|
||||||
|
mov si,offset premice
|
||||||
|
mov bx,7
|
||||||
|
call showstr
|
||||||
|
mov si,offset next
|
||||||
|
call showstr
|
||||||
|
mov si,offset conf
|
||||||
|
call showstr
|
||||||
|
mov al,0
|
||||||
|
mov cx,2000
|
||||||
|
mov di,offset loadinglist
|
||||||
|
rep stosb
|
||||||
|
mov di,offset loadinglist
|
||||||
|
call loadfile
|
||||||
|
jc noconfread
|
||||||
|
|
||||||
|
mov si,offset debut
|
||||||
|
mov bx,7
|
||||||
|
call showstr
|
||||||
|
mov bx,500h
|
||||||
|
xor cx,cx
|
||||||
|
mov si,offset loadinglist
|
||||||
|
suiteloading:
|
||||||
|
call readline
|
||||||
|
jc noconfload
|
||||||
|
push bx si
|
||||||
|
mov bl,7
|
||||||
|
mov si,offset next
|
||||||
|
call showstr
|
||||||
|
pop si bx
|
||||||
|
call showstr
|
||||||
|
mov dx,bx
|
||||||
|
push bx si
|
||||||
|
mov bx,7
|
||||||
|
mov si,offset address
|
||||||
|
call showstr
|
||||||
|
mov cx,16
|
||||||
|
call showhex
|
||||||
|
mov si,offset addressend
|
||||||
|
call showstr
|
||||||
|
xor bp,bp
|
||||||
|
mov dx,ax
|
||||||
|
cmp ax,8h
|
||||||
|
jb noadder
|
||||||
|
cmp ax,10h
|
||||||
|
ja noadder
|
||||||
|
mov bp,1
|
||||||
|
sub dx,8
|
||||||
|
jmp haveirq
|
||||||
|
noadder:
|
||||||
|
cmp ax,70h
|
||||||
|
jb noadd
|
||||||
|
cmp ax,78h
|
||||||
|
ja noadd
|
||||||
|
mov bp,1
|
||||||
|
sub dx,68h
|
||||||
|
haveirq:
|
||||||
|
mov si,offset irqs
|
||||||
|
call showstr
|
||||||
|
mov cx,4
|
||||||
|
call showhex
|
||||||
|
mov si,offset irqsend
|
||||||
|
call showstr
|
||||||
|
noadd:
|
||||||
|
pop si bx
|
||||||
|
cmp bp,1
|
||||||
|
jne install
|
||||||
|
call replacehandler
|
||||||
|
jmp suites
|
||||||
|
install:
|
||||||
|
call installhandler
|
||||||
|
suites:
|
||||||
|
jc nohandlerload
|
||||||
|
add bx,0F00h
|
||||||
|
inc cx
|
||||||
|
call nextline
|
||||||
|
jnz suiteloading
|
||||||
|
|
||||||
|
mov si,offset fini
|
||||||
|
mov bl,7
|
||||||
|
call showstr
|
||||||
|
mov si,offset next
|
||||||
|
call showstr
|
||||||
|
mov si,offset prompt
|
||||||
|
call showstr
|
||||||
|
mov ax,6000h
|
||||||
|
mov es,ax
|
||||||
|
push ax
|
||||||
|
mov di,0100h
|
||||||
|
push di
|
||||||
|
call loadfile
|
||||||
|
jc nopromptload
|
||||||
|
push 7202h
|
||||||
|
popf
|
||||||
|
push es
|
||||||
|
push es
|
||||||
|
push es
|
||||||
|
pop ds
|
||||||
|
pop fs
|
||||||
|
pop gs
|
||||||
|
db 0CBh
|
||||||
|
|
||||||
|
nopromptload:
|
||||||
|
mov si,offset prompte
|
||||||
|
mov bl,4
|
||||||
|
call showstr
|
||||||
|
jmp erroron
|
||||||
|
|
||||||
|
nohandlerload:
|
||||||
|
mov si,offset handlere
|
||||||
|
mov bl,4
|
||||||
|
call showstr
|
||||||
|
jmp erroron
|
||||||
|
|
||||||
|
noconfread:
|
||||||
|
mov si,offset confee
|
||||||
|
mov bl,4
|
||||||
|
call showstr
|
||||||
|
jmp erroron
|
||||||
|
|
||||||
|
noconfload:
|
||||||
|
mov di,si
|
||||||
|
mov si,offset confe
|
||||||
|
mov bl,4
|
||||||
|
call showstr
|
||||||
|
mov dx,cx
|
||||||
|
mov cx,16
|
||||||
|
call showhex
|
||||||
|
mov si,offset confe2
|
||||||
|
mov bl,3
|
||||||
|
call showstr
|
||||||
|
mov dx,di
|
||||||
|
mov cx,16
|
||||||
|
call showhex
|
||||||
|
|
||||||
|
erroron:
|
||||||
|
push cs
|
||||||
|
pop ds
|
||||||
|
mov si,offset erreur
|
||||||
|
mov bl,4
|
||||||
|
call showstr
|
||||||
|
mov ax,0
|
||||||
|
int 16h
|
||||||
|
push 0FFFFh
|
||||||
|
push 0
|
||||||
|
db 0CBh
|
||||||
|
|
||||||
|
address db ' [',0
|
||||||
|
addressend db ':0100] ',0
|
||||||
|
irqs db ' (IRQ ',0
|
||||||
|
irqsend db ')',0
|
||||||
|
prompt db 'commande.exe',0
|
||||||
|
conf db 'systeme.ini',0
|
||||||
|
premice db 0Dh,0Ah,'Chargement du fichier de configuration:',0
|
||||||
|
debut db 0Dh,0Ah,'Chargement des pilotes systeme:',0
|
||||||
|
fini db 0Dh,0Ah,'Chargement de l''interpreteur de commande:',0
|
||||||
|
next db 0Dh,0Ah,' - ',0
|
||||||
|
prompte db 0Dh,0Ah,'Erreur lors du chargement de l''interpreteur',0
|
||||||
|
handlere db 0Dh,0Ah,'Erreur lors du chargement des pilotes',0
|
||||||
|
confe db 0Dh,0Ah,'Erreur dans le fichier de configuration a la ligne ',0
|
||||||
|
confee db 0Dh,0Ah,'Erreur de lecture du fichier de configuration',0
|
||||||
|
confe2 db ' caractere ',0
|
||||||
|
erreur db 0Dh,0Ah,'Pressez une touche pour redemarrer...',0
|
||||||
|
|
||||||
|
;==positionne si sur l'entrée suivante de la loading liste jusqu'a equal
|
||||||
|
nextline:
|
||||||
|
push ax cx di
|
||||||
|
mov di,si
|
||||||
|
mov al,0Ah
|
||||||
|
mov cx,20
|
||||||
|
repnz scasb
|
||||||
|
mov si,di
|
||||||
|
cmp byte ptr [di],0
|
||||||
|
pop di cx ax
|
||||||
|
ret
|
||||||
|
|
||||||
|
;==Lit la loading list et initialise SI(Fichier) BX(adresse) AX(interruption)
|
||||||
|
readline:
|
||||||
|
push cx dx di es
|
||||||
|
push ds
|
||||||
|
pop es
|
||||||
|
;Voir taille de la ligne -> DX
|
||||||
|
mov di,si
|
||||||
|
mov al,0Dh
|
||||||
|
mov cx,20
|
||||||
|
repne scasb
|
||||||
|
sub cx,20
|
||||||
|
neg cx
|
||||||
|
mov dx,cx
|
||||||
|
;N° interruption ??
|
||||||
|
mov di,si
|
||||||
|
mov al,'('
|
||||||
|
repne scasb
|
||||||
|
jne noaddr
|
||||||
|
;Non, je recherche l'int positionnement parenthese de fin
|
||||||
|
mov al,')'
|
||||||
|
repne scasb
|
||||||
|
jne errorlist
|
||||||
|
;Je lit l'interruption dans DL
|
||||||
|
xor dl,dl
|
||||||
|
xor cx,cx
|
||||||
|
dec di
|
||||||
|
readingint:
|
||||||
|
dec di
|
||||||
|
mov al,[di]
|
||||||
|
cmp al,'('
|
||||||
|
je finishint
|
||||||
|
call eval
|
||||||
|
jc errorlist
|
||||||
|
shl ax,cl
|
||||||
|
add dl,al
|
||||||
|
add cx,4
|
||||||
|
cmp cx,8
|
||||||
|
ja errorlist
|
||||||
|
jmp readingint
|
||||||
|
noaddr:
|
||||||
|
dec di
|
||||||
|
mov dl,0
|
||||||
|
finishint:
|
||||||
|
;mise d'un 0 a la fin du nom
|
||||||
|
mov byte ptr [di],0
|
||||||
|
mov al,dl
|
||||||
|
pop es di dx cx
|
||||||
|
clc
|
||||||
|
ret
|
||||||
|
errorlist:
|
||||||
|
sub di,si
|
||||||
|
mov si,di
|
||||||
|
pop es di dx cx
|
||||||
|
stc
|
||||||
|
ret
|
||||||
|
|
||||||
|
|
||||||
|
;return carry si pas hexa pour al et renvoie dans al la valeur décimale
|
||||||
|
eval:
|
||||||
|
push si
|
||||||
|
xor si,si
|
||||||
|
searchex:
|
||||||
|
cmp al,cs:[si+offset hexas]
|
||||||
|
je endsearchex
|
||||||
|
inc si
|
||||||
|
cmp si,15
|
||||||
|
jbe searchex
|
||||||
|
pop si
|
||||||
|
stc
|
||||||
|
ret
|
||||||
|
endsearchex:
|
||||||
|
mov ax,si
|
||||||
|
pop si
|
||||||
|
clc
|
||||||
|
ret
|
||||||
|
|
||||||
|
hexas db '0123456789ABCDEF',0
|
||||||
|
|
||||||
|
;==============================Affiche le nombre nb hexa en EDX de taille CX et couleur BL==============
|
||||||
|
ShowHex:
|
||||||
|
push ax bx cx edx si di
|
||||||
|
mov di,cx
|
||||||
|
sub cx,32
|
||||||
|
neg cx
|
||||||
|
shl edx,cl
|
||||||
|
shr di,2
|
||||||
|
mov ah,0Eh
|
||||||
|
and bx,1111b
|
||||||
|
Hexaize:
|
||||||
|
rol edx,4
|
||||||
|
mov si,dx
|
||||||
|
and si,1111b
|
||||||
|
mov al,[si+offset tab]
|
||||||
|
int 10h
|
||||||
|
dec di
|
||||||
|
jnz Hexaize
|
||||||
|
pop di si edx cx bx ax
|
||||||
|
ret
|
||||||
|
Tab db '0123456789ABCDEF'
|
||||||
|
|
||||||
|
;==============================Affiche une chaine DS:SI de couleur BL==============
|
||||||
|
showstr:
|
||||||
|
push ax bx si
|
||||||
|
again:
|
||||||
|
lodsb
|
||||||
|
or al,al
|
||||||
|
jz fin
|
||||||
|
mov ah,0Eh
|
||||||
|
and bx,1111b
|
||||||
|
int 10h
|
||||||
|
jmp again
|
||||||
|
fin:
|
||||||
|
pop si bx ax
|
||||||
|
ret
|
||||||
|
|
||||||
|
;================================================
|
||||||
|
;Routine de gestion de handler
|
||||||
|
;================================================
|
||||||
|
|
||||||
|
;remplace le handler pointer par ds:si en bx:100h interruption ax
|
||||||
|
replacehandler:
|
||||||
|
push ax bx cx si di ds es
|
||||||
|
mov es,bx
|
||||||
|
mov di,0100h
|
||||||
|
call loadfile
|
||||||
|
jc reph
|
||||||
|
mov bx,ax
|
||||||
|
call getint
|
||||||
|
mov es:[102h],si
|
||||||
|
mov es:[104h],ds
|
||||||
|
call setint
|
||||||
|
reph:
|
||||||
|
pop es ds di si cx bx ax
|
||||||
|
ret
|
||||||
|
|
||||||
|
;install le handler pointer par ds:si en bx:100h interruption ax
|
||||||
|
installhandler:
|
||||||
|
push bx cx di es
|
||||||
|
mov es,bx
|
||||||
|
mov di,100h
|
||||||
|
call loadfile
|
||||||
|
jc insh
|
||||||
|
mov bx,ax
|
||||||
|
call setint
|
||||||
|
insh:
|
||||||
|
pop es di cx bx
|
||||||
|
ret
|
||||||
|
|
||||||
|
;met es:di le handle de l'int bx
|
||||||
|
setint:
|
||||||
|
push ax bx ds
|
||||||
|
cli
|
||||||
|
shl bx,2
|
||||||
|
xor ax,ax
|
||||||
|
mov ds,ax
|
||||||
|
mov ds:[bx],di
|
||||||
|
mov ds:[bx+2],es
|
||||||
|
pop ds bx ax
|
||||||
|
sti
|
||||||
|
ret
|
||||||
|
|
||||||
|
;met ds:si le handle de l'int bx
|
||||||
|
getint:
|
||||||
|
push ax bx es
|
||||||
|
shl bx,2
|
||||||
|
xor ax,ax
|
||||||
|
mov es,ax
|
||||||
|
mov si,es:[bx]
|
||||||
|
mov ds,es:[bx+2]
|
||||||
|
pop es bx ax
|
||||||
|
ret
|
||||||
|
|
||||||
|
;================================================
|
||||||
|
;Routine de gestion de systeme de fichier FAT12
|
||||||
|
;================================================
|
||||||
|
|
||||||
|
;DPT disquette
|
||||||
|
mydpt DPT ?
|
||||||
|
|
||||||
|
;Secteur de boot
|
||||||
|
myboot bootSector ?
|
||||||
|
|
||||||
|
;Données Calculée
|
||||||
|
clustersize dw 0
|
||||||
|
TracksPerHead dw 0
|
||||||
|
DriveSize dd 0
|
||||||
|
AdressBoot dw 0
|
||||||
|
AdressFat dw 0
|
||||||
|
AdressParent dw 0
|
||||||
|
AdressData dw 0
|
||||||
|
AddingValue dw 0
|
||||||
|
CurrentDir dw 0 ;En cluster
|
||||||
|
CurrentDirStr db 128 dup (0)
|
||||||
|
|
||||||
|
;Pour recherches
|
||||||
|
EntryPlace dw 0 ;En octet
|
||||||
|
AdressDirectory dw 0 ;En cluster
|
||||||
|
firstsearch dw 1 ;Premiere requete ?
|
||||||
|
|
||||||
|
getfat:
|
||||||
|
push ax bx dx si
|
||||||
|
mov ax,cx
|
||||||
|
mov bx,ax
|
||||||
|
and bx,0000000000000001b
|
||||||
|
shr ax,1
|
||||||
|
mov cx,3
|
||||||
|
mul cx
|
||||||
|
mov si,offset bufferfat
|
||||||
|
add si,ax
|
||||||
|
cmp bx,0h
|
||||||
|
jnz evenfat
|
||||||
|
oddfat:
|
||||||
|
mov dx,cs:[si]
|
||||||
|
and dx,0FFFh
|
||||||
|
mov cx,dx
|
||||||
|
jmp endfat
|
||||||
|
evenfat:
|
||||||
|
mov dx,cs:[si+1]
|
||||||
|
and dx,0FFF0h
|
||||||
|
shr dx,4
|
||||||
|
mov cx,dx
|
||||||
|
endfat:
|
||||||
|
cmp dx,0FF0h
|
||||||
|
jbe nocarry
|
||||||
|
stc
|
||||||
|
pop si dx bx ax
|
||||||
|
ret
|
||||||
|
nocarry:
|
||||||
|
clc
|
||||||
|
pop si dx bx ax
|
||||||
|
ret
|
||||||
|
|
||||||
|
;============loadfile (Fonction 4)===============
|
||||||
|
;Charge le fichier ds:si en es:di ->ecx taille
|
||||||
|
;-> AH=4
|
||||||
|
;<- Flag Carry si erreur
|
||||||
|
;=====================================================
|
||||||
|
loadfile:
|
||||||
|
push eax bx di
|
||||||
|
push es di
|
||||||
|
push cs
|
||||||
|
pop es
|
||||||
|
mov di,offset tempfit
|
||||||
|
call searchfile
|
||||||
|
pop di es
|
||||||
|
jne errorload
|
||||||
|
jc errorload
|
||||||
|
mov cx,cs:tempfit.FileGroup
|
||||||
|
mov eax,cs:tempfit.FileSize
|
||||||
|
call loadway
|
||||||
|
jc errorload
|
||||||
|
clc
|
||||||
|
;mov ecx,eax
|
||||||
|
pop di bx eax
|
||||||
|
ret
|
||||||
|
errorload:
|
||||||
|
stc
|
||||||
|
mov ecx,0
|
||||||
|
pop di bx eax
|
||||||
|
ret
|
||||||
|
|
||||||
|
tempfit db 32 dup (0)
|
||||||
|
|
||||||
|
;=============SearchFile (Fonction 10)===============
|
||||||
|
;Renvois dans ES:DI la fit du fichier DS:SI et non equal si pas existant
|
||||||
|
;-> AH=10
|
||||||
|
;<- Flag Carry si erreur
|
||||||
|
;=====================================================
|
||||||
|
SearchFile:
|
||||||
|
push ax cx ds si di es
|
||||||
|
call uppercase
|
||||||
|
push ds si
|
||||||
|
call findfirstfilez
|
||||||
|
push ds
|
||||||
|
pop es
|
||||||
|
mov di,si
|
||||||
|
pop si ds
|
||||||
|
jc errorsearch
|
||||||
|
jmp founded
|
||||||
|
nextsearch:
|
||||||
|
push ds si
|
||||||
|
call findnextfilez
|
||||||
|
push ds
|
||||||
|
pop es
|
||||||
|
mov di,si
|
||||||
|
pop si ds
|
||||||
|
founded:
|
||||||
|
cmp byte ptr cs:[di],0
|
||||||
|
je notgood
|
||||||
|
cmp byte ptr cs:[di+FileAttr],0Fh
|
||||||
|
je nextsearch
|
||||||
|
call cmpnames
|
||||||
|
jc nextsearch
|
||||||
|
okfound:
|
||||||
|
push cs
|
||||||
|
pop ds
|
||||||
|
mov si,di
|
||||||
|
pop es di
|
||||||
|
push di es
|
||||||
|
mov cx,32
|
||||||
|
rep movsb
|
||||||
|
clc
|
||||||
|
pop es di si ds cx ax
|
||||||
|
ret
|
||||||
|
notgood:
|
||||||
|
cmp si,0FF5h
|
||||||
|
pop es di si ds cx ax
|
||||||
|
ret
|
||||||
|
errorsearch:
|
||||||
|
stc
|
||||||
|
pop es di si ds cx ax
|
||||||
|
ret
|
||||||
|
|
||||||
|
;Transforme la chaine ds:si en maj
|
||||||
|
uppercase:
|
||||||
|
push si ax
|
||||||
|
mov di,si
|
||||||
|
uppercaser:
|
||||||
|
mov al,ds:[si]
|
||||||
|
cmp al,0
|
||||||
|
je enduppercase
|
||||||
|
cmp al,'a'
|
||||||
|
jb nonmaj
|
||||||
|
cmp al,'z'
|
||||||
|
ja nonmaj
|
||||||
|
sub al,'a'-'A'
|
||||||
|
mov ds:[si],al
|
||||||
|
nonmaj:
|
||||||
|
inc si
|
||||||
|
jmp uppercaser
|
||||||
|
enduppercase:
|
||||||
|
clc
|
||||||
|
pop ax si
|
||||||
|
ret
|
||||||
|
|
||||||
|
;Compare le nom ds:si '.' avec es:di
|
||||||
|
CmpNames:
|
||||||
|
push ax cx si di
|
||||||
|
mov cx,8
|
||||||
|
repe cmpsb
|
||||||
|
jne nequal
|
||||||
|
inc si
|
||||||
|
nequal:
|
||||||
|
cmp byte ptr [si-1],'.'
|
||||||
|
jne trynoext
|
||||||
|
mov al,' '
|
||||||
|
rep scasb
|
||||||
|
mov cx,3
|
||||||
|
rep cmpsb
|
||||||
|
jne notequal
|
||||||
|
cmp byte ptr [si],0
|
||||||
|
jne notequal
|
||||||
|
cmp cx,0
|
||||||
|
jl notequal
|
||||||
|
itok:
|
||||||
|
pop di si cx ax
|
||||||
|
ret
|
||||||
|
trynoext:
|
||||||
|
cmp byte ptr [si-1],0
|
||||||
|
jne notequal
|
||||||
|
jmp itok
|
||||||
|
notequal:
|
||||||
|
stc
|
||||||
|
pop di si cx ax
|
||||||
|
ret
|
||||||
|
|
||||||
|
;charge le fichier de de groupe CX et de taille eax
|
||||||
|
LoadWay:
|
||||||
|
push eax bx dx si di ecx ds es
|
||||||
|
cmp eax,0
|
||||||
|
je Zeroload
|
||||||
|
rol eax,16
|
||||||
|
mov dx,ax
|
||||||
|
ror eax,16
|
||||||
|
div cs:clusterSize
|
||||||
|
mov bx,ax
|
||||||
|
cmp bx,1
|
||||||
|
jb adjustlast
|
||||||
|
Loadfat:
|
||||||
|
call readcluster
|
||||||
|
jc noway
|
||||||
|
add di,cs:clusterSize
|
||||||
|
call getfat
|
||||||
|
dec bx
|
||||||
|
jnz loadfat
|
||||||
|
AdjustLast:
|
||||||
|
push es di
|
||||||
|
push cs
|
||||||
|
pop es
|
||||||
|
mov di,offset bufferread
|
||||||
|
mov si,di
|
||||||
|
call Readcluster
|
||||||
|
pop di es
|
||||||
|
jc noway
|
||||||
|
mov cx,dx
|
||||||
|
push cs
|
||||||
|
pop ds
|
||||||
|
rep movsb
|
||||||
|
zeroload:
|
||||||
|
clc
|
||||||
|
pop es ds ecx di si dx bx eax
|
||||||
|
ret
|
||||||
|
noway:
|
||||||
|
stc
|
||||||
|
pop es ds ebp di si dx bx eax
|
||||||
|
ret
|
||||||
|
|
||||||
|
;=============INITDRIVE (Fonction 04H)===============
|
||||||
|
;Initialise le lecteur pour une utilisation ultérieure
|
||||||
|
;-> AH=4
|
||||||
|
;<- Flag Carry si erreur
|
||||||
|
;=====================================================
|
||||||
|
InitDrive:
|
||||||
|
push eax bx cx edx di ds es
|
||||||
|
push cs
|
||||||
|
pop ds
|
||||||
|
push cs
|
||||||
|
pop es
|
||||||
|
mov cs:lastseg,0
|
||||||
|
mov cs:lastoff,0
|
||||||
|
mov cs:LastRead,0
|
||||||
|
mov ax,myboot.sectorsize
|
||||||
|
mov bl,myboot.SectorsPerCluster
|
||||||
|
xor bh,bh
|
||||||
|
mul bx
|
||||||
|
mov clustersize,ax
|
||||||
|
mov bx,myboot.HiddenSectorsL
|
||||||
|
adc bx,myboot.HiddenSectorsH
|
||||||
|
mov AdressBoot,bx
|
||||||
|
add bx,myboot.ReservedSectors
|
||||||
|
mov AdressFat,bx
|
||||||
|
xor ax,ax
|
||||||
|
mov al,myboot.FatsPerDrive
|
||||||
|
mul myboot.SectorsPerFat
|
||||||
|
add bx,ax
|
||||||
|
mov AdressParent,bx
|
||||||
|
mov AdressDirectory,bx
|
||||||
|
mov ax,32
|
||||||
|
mul myboot.DirectorySize
|
||||||
|
div myboot.SectorSize
|
||||||
|
add bx,ax
|
||||||
|
mov AdressData,bx
|
||||||
|
sub bx,2
|
||||||
|
mov AddingValue,bx
|
||||||
|
mov ax,myboot.SectorsPerDrive
|
||||||
|
div myboot.SectorsPerTrack
|
||||||
|
xor dx,dx
|
||||||
|
div myboot.HeadsPerDrive
|
||||||
|
mov TracksPerHead,ax
|
||||||
|
xor eax,eax
|
||||||
|
mov ax,myboot.SectorsPerDrive
|
||||||
|
sub ax,AdressData
|
||||||
|
mul myboot.SectorSize
|
||||||
|
shl edx,16
|
||||||
|
add edx,eax
|
||||||
|
mov DriveSize,edx
|
||||||
|
mov CurrentDir,0
|
||||||
|
mov EntryPlace,0
|
||||||
|
mov adressdirectory,0
|
||||||
|
mov firstsearch,1
|
||||||
|
mov currentdirstr,0
|
||||||
|
mov di,offset bufferfat
|
||||||
|
mov dx,myboot.SectorsPerFat
|
||||||
|
mov cx,AdressFat
|
||||||
|
SeeFat:
|
||||||
|
call readsector
|
||||||
|
jc ErrorInit
|
||||||
|
add di,myboot.SectorSize
|
||||||
|
inc cx
|
||||||
|
dec dx
|
||||||
|
jnz seefat
|
||||||
|
clc
|
||||||
|
pop es ds di edx cx bx eax
|
||||||
|
ret
|
||||||
|
ErrorInit:
|
||||||
|
stc
|
||||||
|
pop es ds di edx cx bx eax
|
||||||
|
ret
|
||||||
|
|
||||||
|
;=============FindFirstFile (Fonction 7)==============
|
||||||
|
;Renvois dans ES:DI un bloc d'info
|
||||||
|
;-> AH=7
|
||||||
|
;<- Flag Carry si erreur
|
||||||
|
;=====================================================
|
||||||
|
FindFirstFileZ:
|
||||||
|
push cx
|
||||||
|
mov cx,cs:CurrentDir
|
||||||
|
mov cs:AdressDirectory,cx
|
||||||
|
xor cx,cx
|
||||||
|
mov cs:EntryPlace,cx
|
||||||
|
mov cs:firstsearch,1
|
||||||
|
call findnextfileZ
|
||||||
|
pop cx
|
||||||
|
ret
|
||||||
|
|
||||||
|
;=============FindnextFile (Fonction 8)==============
|
||||||
|
;Renvois dans ES:DI un bloc d'info
|
||||||
|
;-> AH=8
|
||||||
|
;<- Flag Carry si erreur
|
||||||
|
;=====================================================
|
||||||
|
;fait pointer ds:si sur la prochaine entrée du repertoire courant
|
||||||
|
FindnextFileZ:
|
||||||
|
push ax bx cx es di
|
||||||
|
push cs
|
||||||
|
pop ds
|
||||||
|
mov cx,cs:AdressDirectory
|
||||||
|
mov bx,cs:Entryplace
|
||||||
|
FindnextFileagain:
|
||||||
|
cmp cs:firstsearch,1
|
||||||
|
je first
|
||||||
|
add bx,32
|
||||||
|
cmp bx,cs:clusterSize
|
||||||
|
jb nopop
|
||||||
|
first:
|
||||||
|
mov di,offset bufferentry
|
||||||
|
push cs
|
||||||
|
pop es
|
||||||
|
mov bx,0
|
||||||
|
cmp cs:currentdir,0
|
||||||
|
jne notrootdir
|
||||||
|
cmp cs:firstsearch,1
|
||||||
|
je noaddfirst1
|
||||||
|
inc cx
|
||||||
|
noaddfirst1:
|
||||||
|
add cx,cs:adressparent
|
||||||
|
mov al,myboot.sectorspercluster
|
||||||
|
readroot:
|
||||||
|
call readsector
|
||||||
|
jc notwell
|
||||||
|
add di,myboot.sectorsize
|
||||||
|
dec al
|
||||||
|
jnz readroot
|
||||||
|
sub cx,cs:adressparent
|
||||||
|
jmp nopop
|
||||||
|
notrootdir:
|
||||||
|
cmp cs:firstsearch,1
|
||||||
|
je noaddfirst2
|
||||||
|
call getfat
|
||||||
|
noaddfirst2:
|
||||||
|
jc notwell
|
||||||
|
call readcluster
|
||||||
|
jc notwell
|
||||||
|
nopop:
|
||||||
|
mov cs:firstsearch,0
|
||||||
|
mov si,offset bufferentry
|
||||||
|
add si,bx
|
||||||
|
cmp byte ptr cs:[si],0
|
||||||
|
je notwell
|
||||||
|
mov cs:entryplace,bx
|
||||||
|
mov cs:AdressDirectory,cx
|
||||||
|
cmp byte ptr cs:[si],0E5h
|
||||||
|
je findnextfileagain
|
||||||
|
cmp byte ptr cs:[si+fileattr],28h
|
||||||
|
je findnextfileagain
|
||||||
|
cmp byte ptr cs:[si+fileattr],0Fh
|
||||||
|
je findnextfileagain
|
||||||
|
clc
|
||||||
|
pop di es cx bx ax
|
||||||
|
ret
|
||||||
|
notwell:
|
||||||
|
stc
|
||||||
|
pop di es cx bx ax
|
||||||
|
ret
|
||||||
|
|
||||||
|
|
||||||
|
;=============READCLUSTER (Fonction 14)===============
|
||||||
|
;Lit le secteur CX et le met en es:di
|
||||||
|
;-> AH=14
|
||||||
|
;<- Flag Carry si erreur
|
||||||
|
;=====================================================
|
||||||
|
readcluster:
|
||||||
|
push ax bx cx dx di
|
||||||
|
mov ax,cx
|
||||||
|
mov bl,cs:myboot.sectorspercluster
|
||||||
|
xor bh,bh
|
||||||
|
mul bx
|
||||||
|
mov cx,ax
|
||||||
|
add cx,cs:addingvalue
|
||||||
|
readsectors:
|
||||||
|
call readsector
|
||||||
|
jc errorreadincluster
|
||||||
|
add di,cs:myboot.sectorsize
|
||||||
|
inc cx
|
||||||
|
dec bl
|
||||||
|
jnz readsectors
|
||||||
|
clc
|
||||||
|
pop di dx cx bx ax
|
||||||
|
ret
|
||||||
|
errorreadincluster:
|
||||||
|
stc
|
||||||
|
pop di dx cx bx ax
|
||||||
|
ret
|
||||||
|
|
||||||
|
;=============READSECTOR (Fonction 01H)===============
|
||||||
|
;Lit le secteur CX et le met en es:di
|
||||||
|
;-> AH=1
|
||||||
|
;<- Flag Carry si erreur
|
||||||
|
;=====================================================
|
||||||
|
ReadSector:
|
||||||
|
push ax bx cx dx si
|
||||||
|
cmp cx,cs:lastread
|
||||||
|
jne gom
|
||||||
|
mov ax,es
|
||||||
|
cmp cs:lastseg,ax
|
||||||
|
jne gom
|
||||||
|
cmp di,cs:lastoff
|
||||||
|
jne gom
|
||||||
|
jmp done
|
||||||
|
gom:
|
||||||
|
mov cs:lastseg,ax
|
||||||
|
mov cs:lastoff,di
|
||||||
|
mov cs:LastRead,cx
|
||||||
|
mov ax,cx
|
||||||
|
xor dx,dx
|
||||||
|
div cs:myboot.SectorsPerTrack
|
||||||
|
inc dl
|
||||||
|
mov bl,dl
|
||||||
|
xor dx,dx
|
||||||
|
div cs:myboot.HeadsPerDrive
|
||||||
|
mov dh,cs:myboot.bootdrive
|
||||||
|
xchg dl,dh
|
||||||
|
mov cx,ax
|
||||||
|
xchg cl,ch
|
||||||
|
shl cl,6
|
||||||
|
or cl,bl
|
||||||
|
mov bx,di
|
||||||
|
mov SI,4
|
||||||
|
mov AL,1
|
||||||
|
TryAgain:
|
||||||
|
mov AH, 2
|
||||||
|
int 13h
|
||||||
|
jnc Done
|
||||||
|
dec SI
|
||||||
|
jnz TryAgain
|
||||||
|
Done:
|
||||||
|
pop si dx cx bx ax
|
||||||
|
ret
|
||||||
|
|
||||||
|
lastread dw 0
|
||||||
|
lastseg dw 0
|
||||||
|
lastoff dw 0
|
||||||
|
|
||||||
|
bufferread equ $
|
||||||
|
bufferFat equ $+2048
|
||||||
|
bufferentry equ $+2048+2048
|
||||||
|
loadinglist equ $+2048+2048+2048
|
||||||
|
end start
|
7
noyau/systeme.ini
Normal file
7
noyau/systeme.ini
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
video.sys(47)
|
||||||
|
horloge.sys(8)
|
||||||
|
8259a.sys(50)
|
||||||
|
disque.sys(48)
|
||||||
|
souris.sys(74)
|
||||||
|
clavier.sys(9)
|
||||||
|
heure.sys(8)
|
3381
noyau/video.asm
Executable file → Normal file
3381
noyau/video.asm
Executable file → Normal file
File diff suppressed because it is too large
Load Diff
@ -1,4 +0,0 @@
|
|||||||
@echo off
|
|
||||||
cd ..
|
|
||||||
setup
|
|
||||||
cd sources
|
|
@ -1,67 +0,0 @@
|
|||||||
.model tiny
|
|
||||||
.486
|
|
||||||
smart
|
|
||||||
.code
|
|
||||||
|
|
||||||
org 0100h
|
|
||||||
|
|
||||||
|
|
||||||
start:
|
|
||||||
jmp transform
|
|
||||||
NameBoot db 'Boot.exe',0
|
|
||||||
nameboot2 db 'Boot.bin',0
|
|
||||||
buffer db 510 dup (0)
|
|
||||||
dw 0AA55h
|
|
||||||
message db 0ah,0dh,'Transformation of boot.com to boot.bin...',0ah,0dh,'By Nico',0ah,0dh,'Copyright 2000',0ah,0dh,'$'
|
|
||||||
ok db 0ah,0dh,'The transformation was done succefully !',0ah,0dh,'$'
|
|
||||||
errormsg db 0ah,0dh,'Some errors has been detected !',0ah,0dh,'$'
|
|
||||||
transform:
|
|
||||||
mov ah,09
|
|
||||||
mov dx,offset message
|
|
||||||
int 21h
|
|
||||||
mov ax,3D00h
|
|
||||||
mov dx,offset nameboot
|
|
||||||
int 21h
|
|
||||||
jc error
|
|
||||||
mov bx,ax
|
|
||||||
mov ax,4202h
|
|
||||||
xor cx,cx
|
|
||||||
xor dx,dx
|
|
||||||
int 21h
|
|
||||||
jc error
|
|
||||||
cmp dx,0
|
|
||||||
jne error
|
|
||||||
mov ax,4200h
|
|
||||||
xor cx,cx
|
|
||||||
mov dx,7E00h
|
|
||||||
int 21h
|
|
||||||
jc error
|
|
||||||
mov ah,3fh
|
|
||||||
mov cx,512
|
|
||||||
mov dx,offset buffer
|
|
||||||
int 21h
|
|
||||||
jc error
|
|
||||||
mov ah,3eh
|
|
||||||
int 21h
|
|
||||||
jc error
|
|
||||||
mov ah,3ch
|
|
||||||
xor cx,cx
|
|
||||||
mov dx,offset nameboot2
|
|
||||||
int 21h
|
|
||||||
jc error
|
|
||||||
mov ah,40h
|
|
||||||
mov cx,512
|
|
||||||
mov dx,offset buffer
|
|
||||||
int 21h
|
|
||||||
jc error
|
|
||||||
mov ah,09
|
|
||||||
mov dx,offset ok
|
|
||||||
int 21h
|
|
||||||
ret
|
|
||||||
error:
|
|
||||||
mov ah,09
|
|
||||||
mov dx,offset errormsg
|
|
||||||
int 21h
|
|
||||||
ret
|
|
||||||
|
|
||||||
end start
|
|
108
outils/rip.asm
108
outils/rip.asm
@ -1,108 +0,0 @@
|
|||||||
net segment
|
|
||||||
|
|
||||||
org 0100h
|
|
||||||
assume cs:net,ds:net
|
|
||||||
|
|
||||||
start:
|
|
||||||
jmp deb
|
|
||||||
taille dw 0
|
|
||||||
signe db 'rip'
|
|
||||||
signe2 db 64 dup (0)
|
|
||||||
p1 db '@'
|
|
||||||
p2 db '@'
|
|
||||||
min db 4
|
|
||||||
deb:
|
|
||||||
mov BL,DS:[0080h]
|
|
||||||
xor BH,BH
|
|
||||||
or BX,BX
|
|
||||||
mov byte ptr [0081h+BX],00h
|
|
||||||
mov AX,3D02h
|
|
||||||
mov DX,0082H
|
|
||||||
int 21h
|
|
||||||
mov bx,ax
|
|
||||||
mov ah,3fh
|
|
||||||
mov cx,0ffffh
|
|
||||||
mov dx,offset data
|
|
||||||
int 21h
|
|
||||||
mov taille,ax
|
|
||||||
mov ah,3eh
|
|
||||||
int 21h
|
|
||||||
mov si,82h
|
|
||||||
mov di,offset signe2
|
|
||||||
mov cx,64
|
|
||||||
rep movsb
|
|
||||||
mov di,offset signe2
|
|
||||||
mov cx,64
|
|
||||||
mov al,2eh
|
|
||||||
repne scasb
|
|
||||||
push di
|
|
||||||
mov si,di
|
|
||||||
mov di,offset data
|
|
||||||
add di,taille
|
|
||||||
mov cx,3
|
|
||||||
rep movsb
|
|
||||||
mov ax,di
|
|
||||||
pop di
|
|
||||||
mov cx,3
|
|
||||||
mov si,offset signe
|
|
||||||
rep movsb
|
|
||||||
mov di,ax
|
|
||||||
mov cx,taille
|
|
||||||
mov si,offset data
|
|
||||||
mov dx,1
|
|
||||||
boucle:
|
|
||||||
lodsb
|
|
||||||
cmp al,[si]
|
|
||||||
jne pas
|
|
||||||
inc dl
|
|
||||||
loop boucle
|
|
||||||
jmp fin
|
|
||||||
pas:
|
|
||||||
cmp dl,min
|
|
||||||
jb suite
|
|
||||||
cmp dl,1
|
|
||||||
jne go
|
|
||||||
suite:
|
|
||||||
mov bx,cx
|
|
||||||
mov cx,dx
|
|
||||||
rep stosb
|
|
||||||
mov cx,bx
|
|
||||||
mov dl,1
|
|
||||||
loop boucle
|
|
||||||
jmp fin
|
|
||||||
go:
|
|
||||||
mov ah,al
|
|
||||||
mov al,p1
|
|
||||||
stosb
|
|
||||||
mov al,dl
|
|
||||||
stosb
|
|
||||||
mov al,ah
|
|
||||||
stosb
|
|
||||||
mov al,p2
|
|
||||||
stosb
|
|
||||||
mov dl,1
|
|
||||||
loop boucle
|
|
||||||
fin:
|
|
||||||
mov ah,3ch
|
|
||||||
mov cx,0
|
|
||||||
mov dx,offset signe2
|
|
||||||
int 21h
|
|
||||||
mov bx,ax
|
|
||||||
mov ah,40h
|
|
||||||
mov cx,di
|
|
||||||
sub cx,offset data
|
|
||||||
sub cx,taille
|
|
||||||
mov dx,offset data
|
|
||||||
add dx,taille
|
|
||||||
int 21h
|
|
||||||
mov ah,3eh
|
|
||||||
int 21h
|
|
||||||
mov ah,41h
|
|
||||||
mov dx,82h
|
|
||||||
int 21h
|
|
||||||
ret
|
|
||||||
data db 0
|
|
||||||
net ends
|
|
||||||
end start
|
|
||||||
|
|
||||||
net
|
|
@ -1,88 +0,0 @@
|
|||||||
net segment
|
|
||||||
|
|
||||||
org 0100h
|
|
||||||
assume cs:net,ds:net
|
|
||||||
|
|
||||||
start:
|
|
||||||
jmp deb
|
|
||||||
taille dw 0
|
|
||||||
signe2 db 64 dup (0)
|
|
||||||
p1 db '@'
|
|
||||||
p2 db '@'
|
|
||||||
deb:
|
|
||||||
mov BL,DS:[0080h]
|
|
||||||
xor BH,BH
|
|
||||||
or BX,BX
|
|
||||||
mov byte ptr [0081h+BX],00h
|
|
||||||
mov AX,3D02h
|
|
||||||
mov DX,0082H
|
|
||||||
int 21h
|
|
||||||
mov bx,ax
|
|
||||||
mov ah,3fh
|
|
||||||
mov cx,0ffffh
|
|
||||||
mov dx,offset data
|
|
||||||
int 21h
|
|
||||||
mov taille,ax
|
|
||||||
mov ah,3eh
|
|
||||||
int 21h
|
|
||||||
mov si,82h
|
|
||||||
mov di,offset signe2
|
|
||||||
mov cx,64
|
|
||||||
rep movsb
|
|
||||||
mov di,offset signe2
|
|
||||||
mov cx,64
|
|
||||||
mov al,2eh
|
|
||||||
repne scasb
|
|
||||||
mov si,offset data
|
|
||||||
mov cx,3
|
|
||||||
rep movsb
|
|
||||||
mov cx,taille
|
|
||||||
mov di,offset data
|
|
||||||
add di,taille
|
|
||||||
mov dx,1
|
|
||||||
boucle:
|
|
||||||
lodsb
|
|
||||||
cmp al,p1
|
|
||||||
je pas
|
|
||||||
suite:
|
|
||||||
stosb
|
|
||||||
loop boucle
|
|
||||||
jmp fin
|
|
||||||
pas:
|
|
||||||
mov al,p2
|
|
||||||
cmp [si+2],al
|
|
||||||
jne suite
|
|
||||||
lodsb
|
|
||||||
mov bx,cx
|
|
||||||
mov cl,al
|
|
||||||
xor ch,ch
|
|
||||||
lodsb
|
|
||||||
rep stosb
|
|
||||||
mov cx,bx
|
|
||||||
sub cx,3
|
|
||||||
inc si
|
|
||||||
loop boucle
|
|
||||||
fin:
|
|
||||||
mov ah,3ch
|
|
||||||
mov cx,0
|
|
||||||
mov dx,offset signe2
|
|
||||||
int 21h
|
|
||||||
mov bx,ax
|
|
||||||
mov ah,40h
|
|
||||||
mov cx,di
|
|
||||||
sub cx,offset data
|
|
||||||
sub cx,taille
|
|
||||||
mov dx,offset data
|
|
||||||
add dx,taille
|
|
||||||
int 21h
|
|
||||||
mov ah,3eh
|
|
||||||
int 21h
|
|
||||||
mov ah,41h
|
|
||||||
mov dx,82h
|
|
||||||
int 21h
|
|
||||||
ret
|
|
||||||
data db 0
|
|
||||||
net ends
|
|
||||||
end start
|
|
||||||
|
|
||||||
net
|
|
57
programs/MAKEFILE
Normal file
57
programs/MAKEFILE
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
lnk_boot = tlink /x
|
||||||
|
asm= tasm /t/m5/zi
|
||||||
|
lnk= tlink /x/t
|
||||||
|
|
||||||
|
all: detect.exe editeur.exe gestion.exe logo.exe pmode.exe souris.exe test.exe verifier.exe volume.exe
|
||||||
|
|
||||||
|
detect.exe: detect.asm
|
||||||
|
$(asm) detect
|
||||||
|
$(lnk) detect
|
||||||
|
ren detect.com detect.exe
|
||||||
|
|
||||||
|
editeur.exe: editeur.asm
|
||||||
|
$(asm) editeur
|
||||||
|
$(lnk) editeur
|
||||||
|
ren editeur.com editeur.exe
|
||||||
|
|
||||||
|
gestion.exe: gestion.asm
|
||||||
|
$(asm) gestion
|
||||||
|
$(lnk) gestion
|
||||||
|
ren gestion.com gestion.exe
|
||||||
|
|
||||||
|
logo.exe: logo.asm
|
||||||
|
$(asm) logo
|
||||||
|
$(lnk) logo
|
||||||
|
ren logo.com logo.exe
|
||||||
|
|
||||||
|
pmode.exe: pmode.asm
|
||||||
|
$(asm) pmode
|
||||||
|
$(lnk) pmode
|
||||||
|
ren pmode.com pmode.exe
|
||||||
|
|
||||||
|
souris.exe: souris.asm
|
||||||
|
$(asm) souris
|
||||||
|
$(lnk) souris
|
||||||
|
ren souris.com souris.exe
|
||||||
|
|
||||||
|
test.exe: test.asm
|
||||||
|
$(asm) test
|
||||||
|
$(lnk) test
|
||||||
|
ren test.com test.exe
|
||||||
|
|
||||||
|
verifier.exe: verifier.asm
|
||||||
|
$(asm) verifier
|
||||||
|
$(lnk) verifier
|
||||||
|
ren verifier.com verifier.exe
|
||||||
|
|
||||||
|
volume.exe: volume.asm
|
||||||
|
$(asm) volume
|
||||||
|
$(lnk) volume
|
||||||
|
ren volume.com volume.exe
|
||||||
|
|
||||||
|
clean:
|
||||||
|
del *.obj
|
||||||
|
del *.exe
|
||||||
|
del *.com
|
||||||
|
del *.sys
|
||||||
|
del *.err
|
@ -1,54 +0,0 @@
|
|||||||
@echo off
|
|
||||||
|
|
||||||
echo Assembling file %1...
|
|
||||||
..\util\tasm %1.asm /m5/x/t
|
|
||||||
if errorlevel 1 goto end
|
|
||||||
if "%1"=="boot" goto boot
|
|
||||||
echo Linking file %1...
|
|
||||||
..\util\tlink %1.obj /x/t
|
|
||||||
if errorlevel 1 goto end
|
|
||||||
echo Copying file %1...
|
|
||||||
if "%1"=="video" goto video
|
|
||||||
if "%1"=="lpt" goto system
|
|
||||||
if "%1"=="keyboard" goto system
|
|
||||||
if "%1"=="mouse" goto system
|
|
||||||
if "%1"=="pic8259a" goto system
|
|
||||||
if "%1"=="timer" goto system
|
|
||||||
if "%1"=="drive" goto system
|
|
||||||
if "%1"=="joystick" goto system
|
|
||||||
if "%1"=="system" goto system
|
|
||||||
if "%1"=="setup" goto setup
|
|
||||||
copy %1.com ..\data\%1.exe>nul
|
|
||||||
goto end
|
|
||||||
|
|
||||||
:boot
|
|
||||||
echo Linking file %1...
|
|
||||||
..\util\tlink %1.obj /x
|
|
||||||
if errorlevel 1 goto end
|
|
||||||
echo Copying file %1...
|
|
||||||
..\util\exe2boot %1.exe
|
|
||||||
copy %1.bin ..\data\%1.bin>nul
|
|
||||||
goto end
|
|
||||||
|
|
||||||
:video
|
|
||||||
type thin8x8.fnt>>%1.com
|
|
||||||
:system
|
|
||||||
copy %1.com ..\data\%1.sys>nul
|
|
||||||
goto end
|
|
||||||
:setup
|
|
||||||
copy %1.com ..\%1.com>nul
|
|
||||||
goto end
|
|
||||||
|
|
||||||
:end
|
|
||||||
if not exist *.bin goto exes
|
|
||||||
del *.bin
|
|
||||||
:exes
|
|
||||||
if not exist *.exe goto coms
|
|
||||||
del *.exe
|
|
||||||
:coms
|
|
||||||
if not exist *.com goto objs
|
|
||||||
del *.com
|
|
||||||
:objs
|
|
||||||
if not exist *.obj goto nobjs
|
|
||||||
del *.obj
|
|
||||||
:nobjs
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user