sarnau / Z80DisAssembler

I created this small disassembler for a Z80 cpu in one afternoon. It is a commandline tool.
20 stars 5 forks source link

Wrong output for IM 0 #6

Closed Ho-Ro closed 2 months ago

Ho-Ro commented 3 months ago

Hi Marcus, Disassembling produces wrong text for IM 0:

        ORG     $0000
0000    ED 46           IM      /
0002    ED 56           IM      1
0004    ED 5E           IM      2

caused by this code section: https://github.com/sarnau/Z80DisAssembler/blob/c7da819a1fce8c76d887b2d6c629a58daff7e1e4/z80_disassembler.c#L655-L659

Fix for line 657:

stemp[ 0 ] = d ? d + '0' - 1 : '0'; stemp[ 1 ] = 0;