Commit graph

3 commits

Author SHA1 Message Date
George Koehler c95bcac91d Correct the stack pointer when i80 shrinks an integer.
The code used `sphl` to set the stack pointer, but the correct value
was in de, not hl.  Fix by swapping the values of de and hl, so `sphl`
is now correct.  When we shrink an integer from 4 to 2 bytes, both
registers de and hl point to copies of the result, but only one
register preserves the stack below the result.

This fixes writehex() in tests/plat/lib/test.c, when I compile it with
ack -mcpm, so it preserves the pointer to "0123456789abcdef", so it
writes hexadecimal digits and not garbage.

This bug goes back to commit 157b243 of Mar 18, 1985, so the bug is
32 years old, and probably the oldest bug that I ever fixed.
2017-12-07 15:39:41 -05:00
ceriel 0bbda61037 adapted to new assembler 1987-01-28 18:57:04 +00:00
em 157b243956 *** empty log message *** 1985-03-18 12:46:51 +00:00