Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How Do I Create a Variable In Z80 Assembly?

I'm trying to create a simple variable containing the hex value 0xffff. I've been able to do it as a macro with SET, but I haven't been able to get it working with something like ld _time,$ffff. How do I load a value into _time?


1 Answers

My problem was I wasn't initializing _time. The following worked:

_time SET $ff
ld hl, $ffff
ld (_time),hl