Anyone able to disassemble this MC9S08AW32CFUE .s19 file?  - Page 1
Forum section: electronics / general

author: Circlotron
author_rank: Super Contributor
timestamp: December 28, 2020, 11:46:15 am
content: I have this small board that I want to mess around with and if someone could disassemble the original s19 file for me it would help in figuring out where the individual IO pins go to, etc. I know that to do a full reconstruction of the source code is a really big job. I don't need that, just need something so I can see things like what the DDRs and other configuration registers are set to, and what IO pins are used.

author: DC1MC
author_rank: Super Contributor
timestamp: December 28, 2020, 02:19:28 pm
content: 32KB of assembly, this is a tall order, even for just minimally sorting out stuff. Even with IdaPro is not that easy, but I can help you a bit, if you want to enjoy yourself:Go get NoIce for HC(S)08, 30 days trial full featured version, in 30 days you'll either solve your issue, or get terminally bored.https://www.noicedebugger.com/68hc08.htmlIs kind of the only somehow freely available simulator/dissasembler except for the gHidra monstrosity form NSAI have attached a .bin translation of your .s19 file, load it in the NoICE at an offset of 0x8000 (where the flash of the MCU is mapped), start disassembly at 0x8106, and in the time you'll be done, you could buy a full RasPi with full HD LCD if your time is worth more then three'fiddy per hour. I even attached a small image on how it's looking.Cheers,DC1MC

author: abyrvalg
author_rank: Frequent Contributor
timestamp: January 03, 2021, 02:28:56 am
content: The init part:Code:ROM:8176 mov #0, ICGC2ROM:8179 mov #$FE, ICGC1ROM:8189 mov #0, PTAD ; Port A Data RegisterROM:818C mov #0, PTBD ; Port B Data RegisterROM:818F mov #$43, PTCD ; 'C' ; Port C Data RegisterROM:8192 mov #0, PTDD ; Port D Data RegisterROM:8195 mov #$60, PTED ; '`' ; Port E Data RegisterROM:8198 mov #0, PTFD ; Port F Data RegisterROM:819B mov #3, PTGD ; Port G Data RegisterROM:819E mov #$FF, PTADD ; Port A Direction RegisterROM:81A1 mov #$FF, PTBDD ; Port B Direction RegisterROM:81A4 mov #$FF, PTCDD ; Port C Direction RegisterROM:81A7 mov #$FF, PTDDD ; Port D Direction RegisterROM:81AA mov #$FC, PTEDD ; Port E Direction RegisterROM:81AD mov #$FF, PTFDD ; Port F Direction RegisterROM:81B0 mov #3, PTGDD ; Port G Direction RegisterROM:81B3 lda #$43 ; 'C'ROM:81B5 sta PTCDSROM:81B8 lda #0ROM:81BA sta PTDDSROM:81BD lda #$84ROM:81BF sta PTEDSROM:81C2 lda #0ROM:81C4 sta PTFDSROM:81C7 lda #0ROM:81C9 sta PTGDSROM:81CC mov #5, KBI1SCROM:81CF mov #$1C, KBI1PEROM:81D2 lda #$1CROM:81D4 sta PTGPEROM:81E9 mov #0, SCI1BDHROM:81EC mov #$40, SCI1BDL ; '@'ROM:81EF mov #0, SCI1C1ROM:81F2 mov #$2C, SCI1C2 ; ','ROM:81F6 mov #0, SCI2BDHROM:81F9 mov #$40, SCI2BDL ; '@'ROM:81FC mov #0, SCI2C1ROM:81FF mov #$C, SCI2C2There is some 8-bit parallel bus (LCD?):PTF0-7 is DATA0-7PTE4 is cmd/data select linePTE5 is nCS ?PTE6 is write strobe (latch cmd/data on negedge)The init code sends cmd38, cmd38, cmd38, cmd0E, cmd06, cmd01

author: Circlotron
author_rank: Super Contributor
timestamp: January 03, 2021, 04:31:56 am
content: Hey, thanks for that. I'll have a bit of a look later .