21
Programming with NASM / Re: Printing number to screen without using extern
« Last post by fredericopissarra on May 28, 2024, 08:13:00 PM »What if the number is a loop variable ?Again: Convert the number to a string and print the string...
What if the number is a loop variable ?Again: Convert the number to a string and print the string...
A "number", printed on the screen, is just a string... Convert the number to a string and print it using some syscall or API function (in case of Windows).What if the number is a loop variable ?
Is it possible to print a numerical value to screen without extern . How ? This came up on my previous thread...A "number", printed on the screen, is just a string... Convert the number to a string and print it using some syscall or API function (in case of Windows).
I would think that you can use as many loops as you want. It's down to the programmer to write appropriate code and algorithms.
mov <register>,1
loop:
inc <register>
cmp <register> <limit>
jne loop
mov <register>,1
loop:
add <register>,1
cmp <register> <limit>
jne loop
with no restrictions or limitations.How do I print rdi to screen . I'm on android if that matters.
section .data
hw db "hello world,",0
section .text
global _start
_start:
mov rdi,1
loop:
mov eax,4
mov ebx,1
lea ecx,[hw]
lea edx,[rdi]
int 80H
inc rdi
cmp rdi,13
jne loop
mov eax,1
xor ebx,ebx
int 80H