A83: Unsquish joke


[Prev][Next][Index][Thread]

A83: Unsquish joke




Hehe, I just checked the source code of the unsquish program recently posted
here... Let's see what it does:

         xor b

This does not, as the programmer probably intended, clear register b. Doh!
Result: ldir might trash op2-op6 and beyond them. It might trash the whole
memory actually.

Before the realtime unsquish engine (c00l coding term, eh?), which
effectively _insertmems one byte at a time, you find two of the three
commented lines in the whole program. They are incorrect (as they say hl
instead of de).

Finally, instead of shifting the accumulator 4 times to the right to obtain
the most significant bits, this piece of contemporary art is used:

 add    a, 16
 ld     c, -1
unsquishdata:
 inc    c
 add    a, -16
 cp     16
 jp     nc, unsquishdata
 ld     b, a
 ld     a, c

I know this was hacked together rather quickly, but you still would expect
it to perform its task _somewhat_ more efficient.

No offense. =)

Linus

                                                           \\//
                                                          [o][O]
.-->                                           .-------mm--(__)--mm--------.
| Linus Akesson                                | http://fly.to/linus.world |
`---------------^-- ----- --- --  -- -  -   -  `---------ooO--Ooo----------'
      After I cook the vegetables, what do I do with the wheelchairs?



Follow-Ups: