Created
April 8, 2025 06:53
-
-
Save ulisetrejo250/dd16730c3e9846352fd0f4c99c87a377 to your computer and use it in GitHub Desktop.
Codigo Assembly ARM64 Hola Mundo para RaspbianOS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.global _start | |
.section .data | |
mensaje: .asciz "Esperando.\n" | |
timespec: | |
.quad 2 // tv_sec = 2 segundos | |
.quad 0 // tv_nsec = 0 nanosegundos | |
.section .text | |
_start: | |
loop: | |
// Escribir mensaje | |
mov x0, #1 // stdout | |
ldr x1, =mensaje // puntero al mensaje | |
mov x2, #9 // longitud del mensaje | |
mov x8, #64 // syscall: write | |
svc #0 | |
// Esperar 2 segundos usando nanosleep | |
ldr x0, =timespec // struct timespec * | |
mov x1, #0 // NULL (no remaining time) | |
mov x8, #35 // syscall: nanosleep | |
svc #0 | |
b loop // Volver a imprimir | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment