MAMEWorld >> Programming
View all threads Index   Flat Mode Flat  

60dBm
MAME Fan
Reged: 12/03/05
Posts: 4
Send PM
Help with Code disassembly
12/20/08 08:13 AM


Could someone please help me with understanding code disassembly? More specifically, why are there differences between disassembled code and whats in the debug window?

I have been wrestling with the Gunsmoke (U.S. Set 1) roms. Here is what I did and what I am seeing.

First, I combined the three program roms:


copy /b 9n_gs03.bin + 10n_gs04.bin + 12n_gs05.bin gscombined.bin

Then I disassembled gscombined.bin

The following the routine is ok:

0159: ld a,($C003) ; -- Read dipswitch 1
015C: and $80
015E: jp nz,$016C ; -- Check for service mode - Jump if not in service
0161: ld a,$0C
0163: ld ($C804),a
0166: ld ($E285),a
0169: jp $8000 ; -- Jump to service mode routines


Ok, now heres where things are different. On my disassembled code, the start of the service mode routines look like this:

8000 ld hl,$81ea
8003 ld de,$f780
8006 ld iy,$f780
800a call $0300
800d call $06c3
8010 call $0657
8013 ret


However, the dump from the debugger shows this code:


8000: ld sp,$E840
8003: di
8004: call $04C5
8007: ld hl,$865C
800A: call $03AF
800D: ld d,$FF
800F: ld hl,$E000
8012: ld bc,$2000
8015: ld (hl),d
8016: inc hl
8017: dec bc
8018: ld a,b
8019: or c
801A: jr nz,$8015


I must not be disassembling the roms properly. What am I doing wrong?

Thanks







Entire thread
Subject Posted by Posted on
* Help with Code disassembly 60dBm 12/20/08 08:13 AM
. * Re: Help with Code disassembly Vas Crabb  12/20/08 11:43 AM
. * Re: Help with Code disassembly 60dBm  12/20/08 02:23 PM
. * Re: Help with Code disassembly Vas Crabb  12/20/08 03:11 PM
. * Re: Help with Code disassembly 60dBm  12/20/08 04:20 PM
. * Found at C000 60dBm  12/21/08 10:49 PM
. * Re: Found at C000 Vas Crabb  12/21/08 11:38 PM

Extra information Permissions
Moderator:  Pi 
0 registered and 44 anonymous users are browsing this forum.
You cannot start new topics
You cannot reply to topics
HTML is enabled
UBBCode is enabled
Thread views: 5102