diff options
author | Pixel <> | 2001-04-16 19:31:22 +0000 |
---|---|---|
committer | Pixel <> | 2001-04-16 19:31:22 +0000 |
commit | 9608fc23272222a5472444514c044b736108e33d (patch) | |
tree | 115fad27c37ef138c6d5f3cb9fae50696a2c77fd /samples/sommeentiers.asm | |
parent | 7a31dae61cabad2e6e237948b7b88e4d795dbb1a (diff) |
Bleh
Diffstat (limited to 'samples/sommeentiers.asm')
-rw-r--r-- | samples/sommeentiers.asm | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/samples/sommeentiers.asm b/samples/sommeentiers.asm deleted file mode 100644 index 2e533a7..0000000 --- a/samples/sommeentiers.asm +++ /dev/null @@ -1,28 +0,0 @@ -;Ce programme va calculer la somme des 97 premiers entiers -.DATA -MSG DS "La somme des " -MSG2 DS " premiers entiers est égale à" -N DB 97 -ZERO DB 0 -SOMME DB 4 - -.TEXT - -.START - MOV R5,[N] ;init du compteur - MOV R1,0 ;init de R1 - MOV R2,0 ;init de R2 - -BOUCLE: ADD R1,R1,R5 ; R1=R1+R5 - AND R3,Fl,0x00000001 ; - ADD R2,R2,R3 ; R2=R2+CF - SUB R5,R5,1 ; DEC R5 - MOV R6,ZERO ; - JNE R5,R6,BOUCLE ; si R5!=0 on refait la boucle - MOV, [SOMME], R1 ; ; - MOV, [SOMME+2], R2 ;on place la valeur de la somme - MOV, [0xffffff04], MSG ;on affiche le msg et la somme - MOV, [0xffffff06], SOMME ; - MOV, [0xffffff06], SOMME+2 ; - MOV, [0xffffff04], MSG2 ; - HALT
\ No newline at end of file |