From: SourceForge.net <no...@so...> - 2012-09-09 19:15:03
|
Bugs item #3566114, was opened at 2012-09-09 12:10 Message generated for change (Comment added) made by You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100599&aid=3566114&group_id=599 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: z80 port Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: gp2k00 () Assigned to: Nobody/Anonymous (nobody) Summary: z80 memset bug Initial Comment: With two calls to memset() in the same function using constant expressions one of them will get the incorrect address. In fact, it appears to re-use the address of the first call. ---------------------------------------------------------------------- >Comment By: gp2k00 () Date: 2012-09-09 12:15 Message: membug.c contains build instructions, compiler version and more specifics of the problem which I'd meant to put in the description. This excerpt from membug.asm shows HL loaded with 0x8000 in both instances rather than 0x9000 in second as it should. ;membug.c:9: memset((char *)0x8000, 1, 0x1000); ld hl,#0x8000 ; Correct ld (hl), #0x01 ld e, l ld d, h inc de ld bc, #0x0FFF ldir ;membug.c:10: memset((char *)0x8000 + 0x1000, 2, 0x1000); ld hl,#0x8000 ; WRONG ld (hl), #0x02 ld e, l ld d, h inc de ld bc, #0x0FFF ldir ret _main_end:: ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100599&aid=3566114&group_id=599 |