WaveyDipole
Experienced Member
I am trying to use f9dasm to decompile code from a 4051 cartridge. The code is in a file in binary format that can be loaded and veiwed in a hex editor. Since cartridges load at address 8000, I have used the -offset parameter to specify that as the start address. I want to decompile code between offset 03E and 151 so have specified a command like like so:
The output begins at address 8000 as expected, but starts at the beginning of the code:
I expected the output to start at offset 803E and finish at offset 8151. Instead, it starts at offset 0 and runs all the way to the end of the file. I have also tried specifying the offsets as 3E/151 803E/8151, but same result. The whole file is de-compiled. What am I missing?
BTW, is there a detailed reference to the 4051 System ROM space anywhere including entry points to various functions? I think I am already seeing anomalous instructions, for example:
Looking at the JSR instruction at label Z8047, there is no code to jump to at address 8F 64. There are only FF bytes to the end of the dump. I did wonder whether the dis-assembler might have mi-interpreted due to the wrong starting point, but accoreding to the M6800 Programming Guide, 39 is indeed an RTS and logically the the next address would be the start of a new block of instructions. Its probably me who is mis-interpreting, but in my defence, it has been a very long time since I looked at any assembly language and that was for the 6502.
Code:
./f9dasm -begin 003E -end 0151 -offset 8000 -6800 bpl.bin
The output begins at address 8000 as expected, but starts at the beginning of the code:
Code:
;****************************************************
;* Program Code / Data Areas *
;****************************************************
ORG $8000
NEGA ;8000: 40 '@'
FCB $51 ;8001: 51 'Q'
FCB $00 ;8002: 00 '.'
FCB $00 ;8003: 00 '.'
FCB $00 ;8004: 00 '.'
FCB $00 ;8005: 00 '.'
FCB $00 ;8006: 00 '.'
FCB $00 ;8007: 00 '.'
FCB $00 ;8008: 00 '.'
FCB $00 ;8009: 00 '.'
......
I expected the output to start at offset 803E and finish at offset 8151. Instead, it starts at offset 0 and runs all the way to the end of the file. I have also tried specifying the offsets as 3E/151 803E/8151, but same result. The whole file is de-compiled. What am I missing?
BTW, is there a detailed reference to the 4051 System ROM space anywhere including entry points to various functions? I think I am already seeing anomalous instructions, for example:
Code:
LDX M003D ;803E: DE 3D '.='
BNE Z8047 ;8040: 26 05 '&.'
LDAA #$3B ;8042: 86 3B '.;'
STAA M004B ;8044: 97 4B '.K'
RTS ;8046: 39 '9'
Z8047 JSR Z8F64 ;8047: BD 8F 64 '..d'
BEQ Z804D ;804A: 27 01 ''.'
RTS ;804C: 39 '9'
Looking at the JSR instruction at label Z8047, there is no code to jump to at address 8F 64. There are only FF bytes to the end of the dump. I did wonder whether the dis-assembler might have mi-interpreted due to the wrong starting point, but accoreding to the M6800 Programming Guide, 39 is indeed an RTS and logically the the next address would be the start of a new block of instructions. Its probably me who is mis-interpreting, but in my defence, it has been a very long time since I looked at any assembly language and that was for the 6502.
Last edited: