Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Système exploitation
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Cours L3 Info
Système exploitation
Commits
718af451
Commit
718af451
authored
5 months ago
by
Lucas B
Browse files
Options
Downloads
Patches
Plain Diff
Insertion et Listing
parent
ac7f3e03
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
Projets/enregistrement.asm
+125
-2
125 additions, 2 deletions
Projets/enregistrement.asm
with
125 additions
and
2 deletions
Projets/enregistrement.asm
+
125
−
2
View file @
718af451
...
...
@@ -43,6 +43,9 @@ lent_po: equ $ - t_po
t_pf:
db
")"
lent_pf:
equ
$
-
t_pf
t_espace:
db
" "
t_newline:
db
10
;/***************************************************************************************************************************/
;/*********************************************** Differente Variable Utiliser **********************************************/
;/***************************************************************************************************************************/
...
...
@@ -51,7 +54,13 @@ lent_pf: equ $ - t_pf
v_choix:
db
"12"
lenv_choix:
equ
$
-
v_choix
; Variable general
v_i:
db
0
v_j:
db
0
v_tampon:
db
0
; variable pour la liste des personnes
v_personnes:
db
0
; Ne mettre aucune donner deriere pour evite qu'elle soit ecrasse
section
.text
...
...
@@ -106,7 +115,45 @@ mov ecx, t_enregistrement ; On affiche le contenu a partir du pointeur t_e
mov
edx
,
lent_enregistrement
; On affiche lent_enregistrement variable
int
80h
; On execute l'appel Systeme
; TODO
;/************ On incremete la valeur de la variable ************/
mov
edi
,
v_personnes
l_debutPourEnregistrer:
cmp
byte
[
edi
],
0
je
l_finPourEnregistrer
inc
edi
jmp
l_debutPourEnregistrer
l_finPourEnregistrer:
mov
al
,
[
v_personnes
]
cmp
byte
[
edi
],
al
je
l_debutLire
mov
byte
[
edi
],
10
inc
edi
l_debutLire:
; Lire un caractère depuis l'entrée standard
mov
eax
,
3
; Syscall read
mov
ebx
,
0
; STDIN
mov
ecx
,
v_tampon
; Lire dans "v_tampon"
mov
edx
,
1
; Lire 1 caractère
int
80h
; Vérifier si le caractère est un espace (ASCII 32)
cmp
byte
[
v_tampon
],
10
je
l_finLire
; Si espace, fin du programme
mov
al
,
[
v_tampon
]
mov
byte
[
edi
],
al
inc
edi
jmp
l_debutLire
; Lire le prochain caractère
l_finLire:
mov
byte
[
edi
],
0
jmp
l_menu
; lorsque on a terminer on raffiche le menu
...
...
@@ -122,8 +169,84 @@ mov ecx, t_lister ; On affiche le contenu a partir du pointeur t_l
mov
edx
,
lent_lister
; On affiche lent_lister variable
int
80h
; On execute l'appel Systeme
; TODO
;/************ Compteur de personne ************/
mov
byte
[
v_i
],
1
; On initialise le numero de personne
add
byte
[
v_i
],
'0'
; On le convertie en caractere
;/************ On incremete la valeur de la variable ************/
mov
edi
,
v_personnes
;/************ Si il n'y a rien, on affiche rien *************/
cmp
byte
[
edi
],
0
je
l_finPourLister
;/************ On affiche le nombre et l'espace ************/
mov
eax
,
4
; Appel systeme write
mov
ebx
,
1
; Sur la sortie standart
mov
ecx
,
v_i
; On affiche le contenu a partir du pointeur v_i
mov
edx
,
1
; On affiche 1 caractere
int
80h
; On execute l'appel Systeme
mov
eax
,
4
; Appel systeme write
mov
ebx
,
1
; Sur la sortie standart
mov
ecx
,
t_espace
; On affiche le contenu a partir du pointeur t_lister
mov
edx
,
1
; On affiche lent_lister variable
int
80h
; On execute l'appel Systeme
;/************ On incremete la valeur de la variable ************/
inc
byte
[
v_i
]
; On incremente v_i
l_debutPourLister:
cmp
byte
[
edi
],
0
je
l_finPourLister
cmp
byte
[
edi
],
10
je
l_numLister
mov
eax
,
4
; Appel systeme write
mov
ebx
,
1
; Sur la sortie standart
mov
ecx
,
edi
; On affiche le contenu a partir du pointeur v_personnes + v_j
mov
edx
,
1
; On affiche 1 seule caractere
int
80h
; On execute l'appel Systeme
inc
edi
jmp
l_debutPourLister
l_numLister:
mov
eax
,
4
; Appel systeme write
mov
ebx
,
1
; Sur la sortie standart
mov
ecx
,
t_newline
; On affiche le contenu a partir du pointeur t_lister
mov
edx
,
1
; On affiche lent_lister variable
int
80h
; On execute l'appel Systeme
mov
eax
,
4
; Appel systeme write
mov
ebx
,
1
; Sur la sortie standart
mov
ecx
,
v_i
; On affiche le contenu a partir du pointeur v_i
mov
edx
,
1
; On affiche 1 caractere
int
80h
; On execute l'appel Systeme
mov
eax
,
4
; Appel systeme write
mov
ebx
,
1
; Sur la sortie standart
mov
ecx
,
t_espace
; On affiche le contenu a partir du pointeur t_lister
mov
edx
,
1
; On affiche lent_lister variable
int
80h
; On execute l'appel Systeme
inc
byte
[
v_i
]
; On incremente v_i
inc
edi
; On incremente v_i
jmp
l_debutPourLister
l_finPourLister:
mov
eax
,
4
; Appel systeme write
mov
ebx
,
1
; Sur la sortie standart
mov
ecx
,
t_newline
; On affiche le contenu a partir du pointeur t_lister
mov
edx
,
1
; On affiche lent_lister variable
int
80h
; On execute l'appel Systeme
mov
eax
,
4
; Appel systeme write
mov
ebx
,
1
; Sur la sortie standart
mov
ecx
,
t_newline
; On affiche le contenu a partir du pointeur t_lister
mov
edx
,
1
; On affiche lent_lister variable
int
80h
; On execute l'appel Systeme
jmp
l_menu
; lorsque on a terminer on raffiche le menu
;/***************************************************************************************************************************/
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment