Post History
Z80 Assembler, 50 bytes org 256 ld de,m ld c,9 jp 5 m:db"Hello, world!\r$" With assembler there's usually the problem which machine or operating system the program is for. I've chosen CP/M ...
Answer
#1: Initial revision
# Z80 Assembler, 50 bytes ```z80asm org 256 ld de,m ld c,9 jp 5 m:db"Hello, world!\r$" ``` With assembler there's usually the problem which machine or operating system the program is for. I've chosen CP/M here as it runs on a variety of different machines with a Z80 processor. CP/M programs start at address 0x100, but the decimal representation 256 is shorter. The program loads the address of the $-terminated string into the D & E register pair, then the number of the print text subroutine (9) into the C register, and jumps to the BDOS entry. It uses the `RET`urn of that routine to end itself, instead of `CALL`ing the BDOS and needing an own `RET` instruction in the program.