Page 1 of 1
GNU assembler for HC11
Posted: Thu Aug 27, 2009 1:43 pm
by antus
Ive been trying to figure out how to disassemble and reassemble 128kbit bins. Ive got a good disassembly now in GNU Assembler format. I can assemble the code to an elf file.
On linux, do this to get the toolchain (windows after installing cygwin is probably pretty similar, but i cant help with that):
Code: Select all
wget http://ftp.gnu.org/pub/gnu/binutils/binutils-2.19.tar.gz
tar xzvf binutils-2.19.tar.gz
cd binutils-2.19
./configure --target=m6811-elf --program-prefix=m6811-elf-
make
su -c 'make install'
Re: GNU assembler for HC11
Posted: Thu Aug 27, 2009 7:14 pm
by antus
Heres a disassembly for the lower 64k half of the VS BSTK.bin. Kudos to anyone who can get it to assemble and match the lower half of the original BSTK1451.BIN, and post some instructions here. It does appear to assemble with the m6811-elf- toolchain, but all the locations referenced by symbol name come out pointing to 0x0000. Not sure if im missing an assembler or a linker switch, or if its the result of a bug!
Im running:
$ m6811-elf-as --version
GNU assembler (GNU Binutils) 2.19
Copyright 2007 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or later.
This program has absolutely no warranty.
This assembler was configured for a target of `m6811-elf'.
Re: GNU assembler for HC11
Posted: Fri Aug 28, 2009 5:45 pm
by antus
Close now. assemble with:
create a file, memory.x with:
Code: Select all
MEMORY
{
page0(rwx) : ORIGIN = 0x0000, LENGTH = 0x03FF
text(rwx) : ORIGIN = 0x0000, LENGTH = 0x10000
data(rwx) : ORIGIN = 0x0000, LENGTH = 0x10000
bss(rwx) : ORIGIN = 0x0000, LENGTH = 0x10000
eeprom(r) : ORIGIN = 0x0E00, LENGTH = 0x1FF
}
The linker seems to crash when creating binary files, but creating srec works around it so:
Code: Select all
m6811-elf-ld a.out -m m68hc11elfb --oformat srec -o bstk.srec
m6811-elf-objcopy -I srec bstk.srec -O binary bstk.bin
This gives a pretty correct looking lower half binfile.. so thats it for this part of the project... hopefully some doors are now open, and i'll crawl back in to my cave and keep delco hacking
BSTKlow.bin is the lower original half of the file, bstk.bin was created from the above
Code: Select all
[ant@media vs]$ md5sum bstk.bin BSTKlow.bin
2e39bffede15f1a4db2f5b1f3956e3eb bstk.bin
2e39bffede15f1a4db2f5b1f3956e3eb BSTKlow.bin
Re: GNU assembler for HC11
Posted: Fri Aug 28, 2009 6:47 pm
by Holden202T
you make good progress when you talk to yourself

Re: GNU assembler for HC11
Posted: Fri Aug 28, 2009 7:14 pm
by antus
Yep, them voices in my head must be good for something
So how do you deal with 128k bins? thats how! the door is open.... watch this space... you saw it here on delco hacking first

Re: GNU assembler for HC11
Posted: Sat Aug 29, 2009 12:10 am
by VL400
Nicely done antus, this should get the 128k bin development started.
Re: GNU assembler for HC11
Posted: Sat Aug 29, 2009 12:04 pm
by antus
Code: Select all
[ant@media bstk]$ make
m6811-elf-as BSTKhigh.asm -o BSTKhigh.o
m6811-elf-ld -m m68hc11elfb --oformat srec BSTKhigh.o -o BSTKhigh.srec
m6811-elf-ld: warning: cannot find entry symbol _start; defaulting to 00000000
m6811-elf-objcopy -I srec BSTKhigh.srec -O binary BSTKhigh.bin
m6811-elf-as BSTKlow.asm -o BSTKlow.o
m6811-elf-ld -m m68hc11elfb --oformat srec BSTKlow.o -o BSTKlow.srec
m6811-elf-objcopy -I srec BSTKlow.srec -O binary BSTKlow.bin
cat BSTKlow.bin BSTKhigh.bin > BSTK.bin
[ant@media bstk]$ ls -lh *.bin
-rw-rw-r-- 1 ant ant 128K 2009-08-29 11:37 BSTK.bin
-rw-rw-r-- 1 ant ant 64K 2009-08-29 11:37 BSTKhigh.bin
-rw-rw-r-- 1 ant ant 64K 2009-08-29 11:37 BSTKlow.bin

Re: GNU assembler for HC11
Posted: Tue Sep 01, 2009 10:00 am
by delcowizzid
i go away for a week and you bust out the brilliance nice work mate
Re: GNU assembler for HC11
Posted: Thu Jan 14, 2010 1:12 am
by sabercatpuck
I know when I dissasembled the code on my Saturn 128k bin I had to do it in 4 parts. treating each quadrent of the the bin file seperatly. Had alot of jumps outside of code, but got a clean dissasembly out of it. I know on mine there are several routines arround $5666 that the system loads the x register with the jump address, calls the appropriate routine to change a couple pins on port g of the 68hc11F1 and that in turn changes the addressing to the chip's upper memory half banking in 3 different halves.