Calculator Community > ASM

GAME: Optimize this! (z80 assembly)

<< < (2/4) > >>

Fallen Ghost:
Using TASM syntax, not including timings or bytes (sorry, too lazy). But what the hell is that code doing? I'm assuming that you are looking for only 1 arrow at a time being pressed. I'm also assuming you want to optimize for speed, but not enough to uber-speed loop decompression. And I also noticed you kinda made a mistake by either not letting us know what the equates were for the 'x' (where x is the number) or by treating them as litteral and not including cpl. I'm assuming that 'x' is an equate of value less than 128 (you can't get more than that from a cpl'ed port 1 anyway).

Did you want me to throw that in or just say it is a code used on a hardware with other port settings (so let the port thing away and giving us the equates)? I'm assuming no. I'm also assuming that the no_labelX are not equally spaced/not in order in memory.

c1-->CODE ec1
ret
c2ec2

And it may not be very speedy though, but I'm kinda too tired to do better.

Please answer my questions and you'll get better code, as now it wouldn't work for arrow keypress detection.

But as you see, the code, as you put it, has no output other than adding, and then does nothing with it, so for overall usefulness, then my code is the best (can't really beat 10T / 1Byte).

DJ Omnimaga:
idk what he meant to do really, iirc it was meant to be a piece of code like the basic code samples in the 83+ manual, which does nothing, since its just some kind of excercise anyway  

Fallen Ghost:
Yeah, but I need to know if he made errors in his above code or only optimize it. And also if the 'X' things are equates (reread my code now)

DJ Omnimaga:
I'm trying to ask him on IRC atm but he seems idle hopefully he'll check this topic again soon

Halifax:
Just optimize it. It is just an exercise. Do high-level and algorithm optimization. Nothing on how memory is accessed.'

It is all pretty simple although I am sure that there is one optimization people may not find.

EDIT: Actually there are 2 optimizations that I think won't be found.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version