Let there be color

[Inspired by this article on Bob’s 8-bit blog]

Misleading title! There is no color on a ZX81, except for black, white and grey… More on this in the next post.

Our first ZX81 program will draw a black square at the top left of the screen. Open your editor, and create a new file – call it zx81001.asm. Now type the following lines:

ld HL, (D_FILE)
ld a, 128
inc HL
ld (HL), a
RET

Save your file, and compile it with pasmo:

pasmo -v zx81001.asm zx81001.p

The -v option stands for verbose and will give you additional information when things go wrong.

Now, execute your program with the emulator:

zesarux zx81001.p

If all goes well, you should see a black square at the top left of your screen!

zx81001

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s