Epreuve 0

This commit is contained in:
Nogard 2026-03-21 13:23:56 +01:00
parent ca9e186462
commit 0a808f53e2
2 changed files with 21 additions and 0 deletions

21
Epreuve0.asm Normal file
View File

@ -0,0 +1,21 @@
_main:
MOV R0 0 ; a
MOV R1 1 ; b
OUT R0 ; print 0
_loop:
OUT R1 ; print b
MOV R2 0 ; 0
MOV R3 R0 ; c = a
SUB R2 R1 ; 0 - b
SUB R3 R2 ; a - (0 - b) = a - -b = a + b
MOV R0 R1 ; a = b
MOV R1 R3 ; b = c
CMP R0 R1
JLT _end ; end si b < a
JMP _loop
_end:
JMP _end

0
notes.txt Normal file
View File