donbrae / blog-comments

Comments for https://www.jamieonkeys.dev
https://www.jamieonkeys.dev
0 stars 0 forks source link

posts/til-z80-asm-hello-world/ #6

Open utterances-bot opened 1 month ago

utterances-bot commented 1 month ago

TIL: ‘Hello, world’ in Z80 assembly language on the ZX Spectrum - jamieonkeys

I finally had a go at creating a machine code program and running it on a Speccy.

https://www.jamieonkeys.dev/posts/til-z80-asm-hello-world/

Tertullian85 commented 1 month ago

This Hello World is not quite complete if you want it to be bulletproof. First you need to initialise channel 2 for output, which is the screen channel. The simplest way to do this is to CALL CLS (clear screen) in the ROM, where CLS EQU $0DAF. Additionally, the z80 Return instructions can be conditional, so you can simply write RET Z on line 7 instead of JR Z, END_PROGRAM

donbrae commented 1 month ago

@Tertullian85 Thank you for that optimization 🙂