EASy68K  
It is currently Wed Oct 17, 2018 1:46 am

All times are UTC




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: Disassemble .bin
PostPosted: Tue Oct 02, 2018 10:30 pm 
Offline

Joined: Tue Oct 02, 2018 10:06 pm
Posts: 4
Hi everyone,

I disassembled a .bin file and I use EASy68K to try to understand this assembled code but do you know if it is possible to decompile this code to an higher level like C++ ?

If it is not possible I will continue to try to understand this assembled code. Here below a piece of the subroutine "subroutine_1BBE0". I have two questions about it :
- I don't understand the use of "arg_2 = 6" and "arg_7 = $B" in the code. And I don't succeed in testing this code in EASy68K. Can someone explain the use of them and what "move.w arg_2(sp),d0" does ?
- EASy68K doesn't seem to recognize "tbls" instruction. Is it possible to simulate this instruction with EASy68K ?

Code:
ROM:0001BBE0 subroutine_1BBE0: 
ROM:0001BBE0
ROM:0001BBE0 arg_2           =  6
ROM:0001BBE0 arg_7           =  $B
ROM:0001BBE0
ROM:0001BBE0                 clr.l   d0
ROM:0001BBE2                 clr.w   d1
ROM:0001BBE4                 move.w  arg_2(sp),d0
ROM:0001BBE8                 lsl.w   #3,d0
ROM:0001BBEA                 tbls.w  ($4A0BE).l,d0
ROM:0001BBF2                 move.b  arg_7(sp),d1
ROM:0001BBF6                 cmpi.b  #2,d1
ROM:0001BBFA                 beq.w   loc_1BC1E
........................


Thanks for all,
Vincent


Top
 Profile  
 
 Post subject: Re: Disassemble .bin
PostPosted: Thu Oct 04, 2018 1:05 pm 
Offline
User avatar

Joined: Thu Dec 16, 2004 6:42 pm
Posts: 1083
arg_2 = 6 is probably how the assembler used for this code defined a constant. EASy68K uses EQU:

Code:
arg_2   EQU     6


tbls is an instruction used by the 68331 and 68332 microcontrollers:
https://www.nxp.com/products/processors-and-microcontrollers/additional-processors-and-mcus/coldfire-plus-coldfire/coldfire-microcontrollers-legacy/m683xx/32-bit-microcontroller:MC68331
It is not supported by EASy68K.

_________________
Prof. Kelly


Top
 Profile  
 
 Post subject: Re: Disassemble .bin
PostPosted: Thu Oct 04, 2018 5:56 pm 
Offline

Joined: Tue Oct 02, 2018 10:06 pm
Posts: 4
Ok thank you. I have another instruction that EASy68K doesn't know and I don't understand with what d0 is added :

Code:
add.l   d0,(a0,d1.w*4)


Top
 Profile  
 
 Post subject: Re: Disassemble .bin
PostPosted: Thu Oct 04, 2018 7:08 pm 
Offline
User avatar

Joined: Thu Dec 16, 2004 6:42 pm
Posts: 1083
The address modified is A0 + (D1.W * 4).
D0 is added to the data at that address.

_________________
Prof. Kelly


Top
 Profile  
 
 Post subject: Re: Disassemble .bin
PostPosted: Thu Oct 04, 2018 7:59 pm 
Offline

Joined: Tue Oct 02, 2018 10:06 pm
Posts: 4
Ok thank you but what does "*4" mean in this instruction because EASy68k understands this instruction but without the "*4"


Top
 Profile  
 
 Post subject: Re: Disassemble .bin
PostPosted: Thu Oct 04, 2018 11:23 pm 
Offline
User avatar

Joined: Thu Dec 16, 2004 6:42 pm
Posts: 1083
Multiply by 4. That syntax is not supported by the 68000. It was added to later versions of the 68K family.

_________________
Prof. Kelly


Top
 Profile  
 
 Post subject: Re: Disassemble .bin
PostPosted: Fri Oct 05, 2018 6:20 am 
Offline

Joined: Tue Oct 02, 2018 10:06 pm
Posts: 4
Thank you :)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group