Re: A86: No memory
[Prev][Next][Index][Thread]
Re: A86: No memory
Or...
call subroutine
end:
...
subroutine:
...
ret z
...
ret z
...
ret z
You save a bit of code when you call it, plus since it's a subroutine you can
call it from more than one place.
In a message dated 3/4/00 1:14:37 AM Eastern Standard Time, david@acz.org
writes:
> This link was posted on the gbdev list:
>
> http://www.jdm.homepage.dk/nomem.htm
>
> I've never seen this used anywhere before, but it's quite an interesting at
> programming. A variation that I have used allows a smaller way of
returning
> from a large case type structure. Instead of doing this:
>
> ...
> jr z,end
> ...
> jr z,end
> ...
> end:
>
>
> Something like this:
>
> ld hl,end
> push hl
> ...
> ret z
> ...
> ret z
> ...
> end:
>
----
Jonah Cohen
<ComAsYuAre@aol.com>
http://linux.hypnotic.org/~jonah/ (down)