Skip to main content
2 of 3
Correction in the explanation
m90
  • 12.5k
  • 1
  • 14
  • 51

x86-64 machine code, 17 bytes

B0 41 AA 04 01 3C 4C 74 FA 3C 5A 76 F5 C6 07 00 C3 

Try it online!

Following the standard calling convention for Unix-like systems (from the System V AMD64 ABI), this takes in RDI a memory address at which to place the result, as a null-terminated byte string.

In assembly:

f: mov al, 'A' # Set AL to the first letter, 'A'. r: stosb # Write AL to the output string, advancing the pointer. b: add al, 1 # Add 1 to AL to get the next letter. cmp al, 'L' # Compare it to 'L'... je b # and if it's equal, jump back to add 1 again. cmp al, 'Z' # Compare it to 'Z'... jbe r # and if it's less than or equal, repeat the loop. mov BYTE PTR [rdi], 0 # Add a null terminator to the string. ret # Return. 
m90
  • 12.5k
  • 1
  • 14
  • 51