I want to print a message 10 times
My compiler : NASM
OS : Debian
I think I need to create a loop :(
Thnx
My compiler : NASM
OS : Debian
I think I need to create a loop :(
Thnx
i db 0
aa:
PRINT YOUR MSG
inc i
cmp i,10
jne aa
Tell me if this helps
aa:
PRINT YOUR MSG
inc i
cmp i,10
jne aa
Tell me if this helps
Good reply :)
Only suggestion is that we should not keep the counter in data variable.
Instead we should keep the counter in a register.
This way we can perform the loop more quickly by avoiding needless memory access of counter.
Only suggestion is that we should not keep the counter in data variable.
Instead we should keep the counter in a register.
This way we can perform the loop more quickly by avoiding needless memory access of counter.
PRINT YOUR MSG <<<<
thats where you should put code to print your message, its not actual sourcecode!
thats where you should put code to print your message, its not actual sourcecode!
section .text
global _start
_start:
mov cx,10
dec cx
cmp cx,10
jnz dongu
dongu:
.... ???
.... ???
.... ?????
section .data
msg db "www.asmcommunity.net",0xA
global _start
_start:
mov cx,10
dec cx
cmp cx,10
jnz dongu
dongu:
.... ???
.... ???
.... ?????
section .data
msg db "www.asmcommunity.net",0xA
federal,
Seriously? Compare yours to karthikeyanck's and answer the following questions:
What value will cx have after the first dec?
Does yours loop? Why not?
How do you print a message?
Seriously? Compare yours to karthikeyanck's and answer the following questions:
What value will cx have after the first dec?
Does yours loop? Why not?
How do you print a message?
code 10 times to print only the message
missing code
missing code
code 10 times to print only the message
missing code
The Linux Assembly site has various documents, tutorials and examples. One particular example, Hello, world!, has all of the "missing" information you need to achieve your goal.