Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Counting from 0 to 10
section .data numPrint db '0' ; for transform number to string and back section .bss num db 1 ; number for printint count db 1 ; counter for cycle section .text global _start _start: mov al, 0 mov [count], al ; set counter to 0 mov [num], al ; set number to 0 loop: call toString ; number to string/print/back to number mov al, [count] inc al ; increment value mov [count], al ; counter + 1 mov [num], al ; number + 1 mov al, 10 ; till 10 cmp [count], al ; check exit condition jnz loop jz exit exit: ; exit program mov eax, 1 mov ebx, 0 int 80h toString: ; prepare number mov bl, [numPrint] add [num], bl call print ret print: ; output printing to screen mov eax, 4 mov ebx, 1 mov ecx, num mov edx, 1 int 80h call toNumber ; string -> number ret toNumber: mov bl, [numPrint] sub [num], bl ret
run
|
edit
|
history
|
help
0
dKleinhen Lab #1
Positive And Negative Count In Array
fdsfdsfdfs
first.asm
printHelp
First Program Group Lab
index1
fsdffdasf
intfunct_64.asm
dsffsdfsdfds