Phil il y a 5 ans
Parent
commit
e24858dbda
1 fichiers modifiés avec 28 ajouts et 0 suppressions
  1. 28 0
      loop.asm

+ 28 - 0
loop.asm

@@ -0,0 +1,28 @@
+section	.text
+   global _start        ;must be declared for using gcc
+	
+_start:	                ;tell linker entry point
+   mov ecx,10
+   mov eax, '1'
+	
+l1:
+   mov [num], eax
+   mov eax, 4
+   mov ebx, 1
+   push ecx
+	
+   mov ecx, num        
+   mov edx, 1        
+   int 0x80
+	
+   mov eax, [num]
+   sub eax, '0'
+   inc eax
+   add eax, '0'
+   pop ecx
+   loop l1
+	
+   mov eax,1             ;system call number (sys_exit)
+   int 0x80              ;call kernel
+section	.bss
+num resb 1