GNU/Linux xterm-256color bash 161 views

/*
Autor: Victor Manuel Madrid Lugo
Fecha: 08/04/2025
Descripción: Imprime el alfabeto en orden de la A a la Z
Demostración: [https://asciinema.org/a/LxB34JItRsRqt7TvoNdSo31KE]
*/

/*
java

public class Alfabeto {
  public static void main(String[] args) {
    for (char c = 'A'; c <= 'Z'; c++) {
      System.out.print(c + " ");
    }
    System.out.println();
  }
}
*/

.global _start       // Punto de entrada global

.data
alphabet:    .ascii "ABCDEFGHIJKLMNOPQRSTUVWXYZ\n"
len = . - alphabet

.text
_start:
    // Abrir syscall para write
    mov x0, #1       // stdout file descriptor
    adr x1, alphabet // dirección del alfabeto
    mov x2, #len     // longitud del string
    mov x8, #64      // syscall write
    svc #0           // invocar syscall

    // Exit syscall
    mov x0, #0       // código de salida 0
    mov x8, #93      // syscall exit
    svc #0           // invocar syscall