-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpgm.txt
More file actions
18 lines (16 loc) · 680 Bytes
/
pgm.txt
File metadata and controls
18 lines (16 loc) · 680 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
; Programme qui demande la taille d'une liste aleatoire a l'utilisateur et l'affiche
read 1000 ;
push 1000 ; [n]
push# 0 ; [n, i]
push# -1
populate: rnd 10 ; [n, i, x1]
write -1
push 1 ; [n, i, x1, i]
push# 1 ; [n, i, x1, i, 1]
op 10 ; [n, i, x1, i+1]
dup ; [n, i, x1, i+1, i+1]
pop 1 ; [n, i+1, x1, i+1]
push 0 ; [n, i+1, x1, i+1, n]
op 1 ; [n, i+1, x1, i+1 != n ? 1 : 0]
jnz populate
halt