1
Programming with NASM / Re: Learning Assembler
« Last post by Roddy MacPhee on May 25, 2024, 09:39:20 PM »Maybe https://asmtutor.com ?
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
;r9 // sprintf_s + printf
;r8 // by alCoPaUL [GIMO]
;rdx // 5/15/2024
;rcx // Brigada Ocho [b8] Productions
;call // rax
global m
extern printf
extern sprintf_s
section .text
m:sub rsp,28h
lea r8,x
lea rdx,i
lea rcx,b
call sprintf_s
mov r8, rax
lea rdx,b
lea rcx,i
call printf
add rsp,28h
ret
section .data
x:db 'Revelation 13'
......
.....
....
;r9 // sprintf_s + printf
;r8 // by alCoPaUL [GIMO]
;rdx // 5/15/2024
;rcx // Brigada Ocho [b8] Productions
;call // rax
global m
extern printf
extern sprintf_s
section .text
m:sub rsp,28h
lea r8,x
lea rdx,i
lea rcx,b
call sprintf_s
mov r8, rax
lea rdx,b
lea rcx,i
call printf
add rsp,28h
ret
section .data
x:db 'Revelation 13'
....
....
....