Bonjour le monde
Votre premier programme en émojis ! Chargez un nombre et affichez-le.
débutant · bases
📥 42 🖨️ ⏹️
Sortie: 42
Essayer, examiner, modifier
Chargez un exemple dans le laboratoire, suivez ses instructions pas à pas, puis modifiez une valeur. Chaque exemple comprend sa sortie attendue.
Votre premier programme en émojis ! Chargez un nombre et affichez-le.
débutant · bases
📥 42 🖨️ ⏹️
Sortie: 42
Additionnez deux nombres.
débutant · bases
📥 10 ➕ 5 🖨️ ⏹️
Sortie: 15
Effectuez plusieurs opérations arithmétiques.
débutant · bases
📥 100 ➕ 50 🖨️ ➖ 30 🖨️ ✖️ 2 🖨️ ➗ 4 🖨️ ⏹️
Sortie: 150, 120, 240, 60
Comptez de 10 à 1 avec une boucle.
débutant · bases
LOAD 10 again: PRINT SUB 1 JUMP_IF_ZERO done JUMP again done: HALT
Sortie: 10, 9, 8, 7, 6, 5, 4, 3, 2, 1
Produisez huit valeurs de Fibonacci avec des registres et une boucle bornée.
intermédiaire · algorithmes
LOAD 1 R1 LOAD 1 R2 LOOP 8 LOAD R1 PRINT COPY R0 R3 ADD R2 COPY R2 R1 COPY R0 R2 RETURN HALT
Sortie: 1, 1, 2, 3, 5, 8, 13, 21
Affichez 2⁰ à 2⁷ : 1, 2, 4, 8, 16, 32, 64, 128.
intermédiaire · algorithmes
📥 1 🖨️ ✖️ 2 🖨️ ✖️ 2 🖨️ ✖️ 2 🖨️ ✖️ 2 🖨️ ✖️ 2 🖨️ ✖️ 2 🖨️ ✖️ 2 🖨️ ⏹️
Sortie: 1, 2, 4, 8, 16, 32, 64, 128
Enregistrez deux octets, effacez R0, puis relisez-les réellement en mémoire.
intermédiaire · bases
LOAD 42 STORE 0 LOAD 99 STORE 1 LOAD 0 LOAD [0] PRINT LOAD [1] PRINT HALT
Sortie: 42, 99
Déterminez si un nombre est pair ou impair avec MOD.
intermédiaire · algorithmes
📥 7 📊 2 🖨️ 📥 8 📊 2 🖨️ ⏹️
Sortie: 1, 0
Empilez et dépilez des valeurs.
avancé · avancé
📥 10 ⬆️ 📥 20 ⬆️ 📥 30 ⬆️ ⬇️ 🖨️ ⬇️ 🖨️ ⬇️ 🖨️ ⏹️
Sortie: 30, 20, 10
Calculez 6 × 7 par additions répétées.
intermédiaire · algorithmes
LOAD 0 LOOP 7 ADD 6 RETURN PRINT HALT
Sortie: 42
Observez les opérations AND, OR et XOR.
avancé · avancé
📥 12 🔀 10 🖨️ 📥 12 🔃 3 🖨️ 📥 12 🔄 15 🖨️ 📥 255 ❌ 🖨️ ⏹️
Sortie: 8, 15, 3, -256
Calculez la somme des nombres de 1 à 10.
débutant · algorithmes
LOAD 1 R1 LOAD 0 R2 LOOP 10 LOAD R2 ADD R1 COPY R0 R2 LOAD R1 ADD 1 COPY R0 R1 RETURN LOAD R2 PRINT HALT
Sortie: 55
Calculez 5! (factorielle de 5 = 120) avec une boucle.
intermédiaire · algorithmes
LOAD 5 R1 LOAD 1 R2 LOOP 5 LOAD R2 MUL R1 COPY R0 R2 LOAD R1 SUB 1 COPY R0 R1 RETURN LOAD R2 PRINT HALT
Sortie: 120
Choisissez le plus grand de deux petits entiers positifs ou nuls avec un masque de signe sur 32 bits.
débutant · bases
LOAD 15 R1 LOAD 25 R2 LOAD R1 SUB R2 AND -2147483648 JUMP_IF_ZERO first LOAD R2 JUMP show first: LOAD R1 show: PRINT HALT
Sortie: 25
Échangez les valeurs de R1 et R2 avec la pile.
débutant · bases
📥 10 📋 R0 R1 📥 20 📋 R0 R2 📥 R1 🖨️ 📥 R2 🖨️ 📥 R1 ⬆️ 📥 R2 📋 R0 R1 ⬇️ 📋 R0 R2 📥 R1 🖨️ 📥 R2 🖨️ ⏹️
Sortie: 10, 20, 20, 10
Trouvez la valeur absolue d’un petit entier signé sur 32 bits avec un masque de signe.
débutant · algorithmes
LOAD -42 R1 LOAD R1 AND -2147483648 JUMP_IF_ZERO positive LOAD R1 MUL -1 JUMP show positive: LOAD R1 show: PRINT HALT
Sortie: 42
Comptez de 3 à 1, puis de 1 à 3.
débutant · bases
📥 3 🖨️ ➖ 1 ❓ 5 ⏭️ 1 📥 1 🖨️ ➕ 1 ⚖️ 4 ❓ 11 ⏭️ 6 ⏹️
Sortie: 3, 2, 1, 1, 2, 3
Doublez deux fois 7 par addition, ce qui équivaut à multiplier par 4.
intermédiaire · avancé
📥 7 📋 R0 R1 📥 R1 ➕ R1 📋 R0 R1 📥 R1 ➕ R1 📋 R0 R1 📥 R1 🖨️ ⏹️
Affichez les 5 premiers nombres triangulaires : 1, 3, 6, 10, 15.
intermédiaire · algorithmes
LOAD 0 R2 LOAD 1 R1 LOOP 5 LOAD R2 ADD R1 COPY R0 R2 PRINT LOAD R1 ADD 1 COPY R0 R1 RETURN HALT
Sortie: 1, 3, 6, 10, 15
Copiez une valeur à travers les 8 registres.
intermédiaire · avancé
📥 42 📋 R0 R1 📋 R1 R2 📋 R2 R3 📋 R3 R4 📋 R4 R5 📋 R5 R6 📋 R6 R7 📥 R7 🖨️ ⏹️
Sortie: 42