Author Topic: PRIZM Disassembler  (Read 34102 times)

0 Members and 1 Guest are viewing this topic.

Offline bsl

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 157
  • Rating: +14/-0
    • View Profile
Re: PRIZM Disassembler
« Reply #60 on: February 05, 2011, 12:32:51 pm »
bsl, your disassembler doesn't support output files larger than 128 MB. I found it out the hard way :P
I would not believe everthing it dissasembles beyond a certain output size.
Its a simple linear top-down disassembler, which means it will do things it should't - like
disassembling data instead of leaving it as data.
You have to disassemble small blocks instead and identify subroutines.
I will think of some way to make this easier.....
I have yet to finish the rest of the transfer instructions, up till now I put in enough just too look at add-ins
« Last Edit: February 11, 2011, 03:03:18 am by bsl »

Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Re: PRIZM Disassembler
« Reply #61 on: February 05, 2011, 01:10:54 pm »
It's not such a big problem since it's a RISC processor, right? All instructions are the same size, so I think it'd be fine to show both the hex data and the instruction mnemonics at the same time.
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: PRIZM Disassembler
« Reply #62 on: February 05, 2011, 01:15:25 pm »
I wonder if the hex equivalent would be similar to the hex equivalent of z80 ASM?

Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Re: PRIZM Disassembler
« Reply #63 on: February 05, 2011, 02:28:43 pm »
The Prizm OS binary is about 12 MB. The disassembled version becomes much larger - two bytes in the binary is equal to one row of text in the disassembly.

You don't exactly need those 5 MB of $FFFF :P
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: PRIZM Disassembler
« Reply #64 on: February 05, 2011, 11:22:19 pm »
Wait, do you imply the OS is filled with 5 MB of $FFFF's? ???

Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Re: PRIZM Disassembler
« Reply #65 on: February 05, 2011, 11:23:15 pm »
Give or take.
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline z80man

  • Casio Traitor
  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 977
  • Rating: +85/-3
    • View Profile
Re: PRIZM Disassembler
« Reply #66 on: February 05, 2011, 11:38:00 pm »
If it's not OS storage space a program could be written to add this as user space.

List of stuff I need to do before September:
1. Finish the Emulator of the Casio Prizm (in active development)
2. Finish the the SH3 asm IDE/assembler/linker program (in active development)
3. Create a partial Java virtual machine  for the Prizm (not started)
4. Create Axe for the Prizm with an Axe legacy mode (in planning phase)
5. Develop a large set of C and asm libraries for the Prizm (some progress)
6. Create an emulator of the 83+ for the Prizm (not started)
7. Create a well polished game that showcases the ability of the Casio Prizm (not started)

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: PRIZM Disassembler
« Reply #67 on: February 06, 2011, 03:04:02 am »
Give or take.
What does Give or take mean? ???
* DJ Omnimaga is confused...

If it's not OS storage space a program could be written to add this as user space.
inb4 OS update that uses that space. D:
« Last Edit: February 06, 2011, 03:04:18 am by DJ Omnimaga »

Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Re: PRIZM Disassembler
« Reply #68 on: February 06, 2011, 03:07:31 am »
Give or means that it could be 5 MB plus a few MB or Minus a few MB. I'm not sure exactly how much space is actually taken up by it.
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: PRIZM Disassembler
« Reply #69 on: February 06, 2011, 03:25:42 am »
Ah ok. I was more shocked at how much useless stuff is stuffed in the OS. X.x

We could use that stuff to store data, but then if Casio releases a new OS that uses it... (like TI did with OS 2.55MP)

Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Re: PRIZM Disassembler
« Reply #70 on: February 07, 2011, 11:00:48 am »
I suspect it actually does have a purpose, such as SafeRAM or something.
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline fxdev

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 177
  • Rating: +34/-6
    • View Profile
Re: PRIZM Disassembler
« Reply #71 on: February 07, 2011, 02:19:17 pm »
Even on the fx-9860G the RAM backup is only 128k (twice the user RAM, written alternately). So I guess, it's just unused.
For instance, the fx-9750GII is sold without add-in capability, meaning there is about 1.9 MB of unused flash memory!

But luckily, we made it run add-ins. ;D
« Last Edit: February 07, 2011, 02:23:48 pm by cfxm »

Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Re: PRIZM Disassembler
« Reply #72 on: February 10, 2011, 07:53:48 pm »
Bsl, would it be possible to add an option for endian-ness? For example, C:Users\>sh3_disass.py -p 0 -s 100 -e -4 -n 1 file.txt > filedump.txt would disassemble in little endian mode. -n 0 would disassemble in big endian mode.
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline bsl

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 157
  • Rating: +14/-0
    • View Profile
Re: PRIZM Disassembler
« Reply #73 on: February 11, 2011, 03:02:22 am »
Sure, but I simply use -n to toggle the endianness.
This is a minor update - fixed the MOV.W @($%s*2+PC) instruction so it reports correctly.
Added python style hex/ascii dump to the output - makes ascii/unicode strings easier to identify:
Code: [Select]
003000E6: '\xe4\x01'  MOV $01, R4
003000E8: 'J\x0b'     JSR @R10 = #300154
003000EA: 'f\xb3'     MOV R11, R6
003000EC: '\x7f\x04'  ADD $04,R15
003000EE: '/\xe6'     MOV.L R14,@-R15
003000F0: '{\x01'     ADD $01,R11
003000F2: '\xe7 '     MOV $20, R7
003000F4: '\xe5\x05'  MOV $05, R5
003000F6: '\xe4\x01'  MOV $01, R4
003000F8: 'J\x0b'     JSR @R10 = #300154
003000FA: 'f\xb3'     MOV R11, R6
003000FC: '\x7f\x04'  ADD $04,R15
003000FE: '/\xe6'     MOV.L R14,@-R15
00300100: '{\x01'     ADD $01,R11
Whats next ?
 Disassembling large files like prizm3064 requires more interaction with the user.
As JosJuice found out you quickly run out of memory filling out the dictionaries in the program.
So saving that to a file and adding another option to the program is in order.
Reloading this saved mapping file simply tells the program as it disassembles the next pass whether its in code,data or reverse endianness (or other commands suggested) very similar to IDA's idc file , but not the same.
A user can edit this file in Textpad , run the disassembler in another window and use other utilities like sorting, already
found on Windows/*NIX to make it more interactive.
I will have to give it more thought.

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: PRIZM Disassembler
« Reply #74 on: February 13, 2011, 10:17:33 am »
Nice bsl!

I also have to say that if anyone wants to take up my Disassembler, go ahead, I don't wanna learn PRIZM Assembly :D