Page 1 of 1
Mitsubishi/Renesas 740 Assembler
Posted: Mon Oct 22, 2018 9:13 am
by RalfK
Hi!
Actually my personal task (hobby

) is understanding a small device which is a tripmaster on my motobike. Really it's a bit more than just the odometer because it can be used on rallies. "Old" KTM drivers probably know this device developed by West-German Touratech in the 1990s and also sold as IMO R300.
It's based on a Mitsubishi 50747 with an external 32kB EPROM. This EPROM is full of code. And there is a bug in the firmware. But that's another story ...
First I wrote a disassembler. This one is modular for a lot of 8bit CPUs. Actually I've implemented the instruction sets of 6502 NMOS, CMOS, Rockwell and the 740 family beside the 6800, next will be the 65802, RCA1802 and more.
I found a strange detail: the instruction DEC A, which was new to the 6502 CMOS instruction sets, is $3A in the typical 65C02 cores from Rockwell and WDC. But it's $1A in the 740 family. The code $1A is INC A at Rockwell and WDC. But INC A is $3A in the 740 family. So Mitsubishi changed the coding to the opposite. What did they do?
Now I'm looking for an assembler. Is there any assembler which understands the 740 family? My old data book from Mitsubishi, printed in 1989, lists some development tools like asm745, sasm745 and some other tools. 29 years ago ... very specialized tools ... probably lost forever.
I found AS here:
http://john.ccac.rwth-aachen.de:8000/as/download.html. Any other?
Regards
Ralf
Re: Mitsubishi/Renesas 740 Assembler
Posted: Mon Oct 22, 2018 3:00 pm
by BitWise
I added a 740 mode to my assembler package. Example and support files for Windows include. You need Java to run this. It will run under other operating systems (OS X, Linux, etc.) that support Java.
It is very much hot off the press so E&OE (
https://en.wikipedia.org/wiki/Errors_an ... s_excepted).
Re: Mitsubishi/Renesas 740 Assembler
Posted: Mon Oct 22, 2018 5:09 pm
by Dr Jefyll
So Mitsubishi changed the coding to the opposite.
Interesting, Ralf. I'm inclined to wonder if this is simply a documentation error, and the actual silicon
does in fact match the behavior adopted by other manufacturers. What sort of evidence have you been able to collect so far? Certainly documentation errors are not unheard of in this industry!
cheers,
Jeff
Re: Mitsubishi/Renesas 740 Assembler
Posted: Mon Oct 22, 2018 6:29 pm
by BitWise
The coding of the bit instructions is also different from the 65c02.
Re: Mitsubishi/Renesas 740 Assembler
Posted: Mon Oct 22, 2018 7:25 pm
by RalfK
I added a 740 mode to my assembler package.
Thank you very much:-) I will try to use your assembler, and I will report. I saw that you considered this DEC-INC "anomaly". What's the difference concerning the BIT instruction you mentioned in your other posting? BIT ZP is $24, BIT ABS is $2C, the behavior of the flags seems to be the same: N, V, Z may be changed, the others not. Both instructions are also present in the NMOS core.
I'm inclined to wonder if this is simply a documentation error, and the actual silicon does in fact match the behavior adopted by other manufacturers.
Last night I configured the instruction sets for my disassembler software, and first I was a bit confused. Error in documentation was also my first idea. I took my old Mitsubishi data book from 1990 and compared the data to the latest docs from Renesas. Several of them. All identical.
I try to understand the firmware code of my device. So it's important to see the real meaning of every instruction. Thanks for the confirmation of that "anomaly".
Regards
Ralf
Re: Mitsubishi/Renesas 740 Assembler
Posted: Mon Oct 22, 2018 7:29 pm
by BitWise
Not BIT. The 740's BBC, BBS, CLB and SEB are arranged in a more interleaved pattern than the 65C02's BBR, BBS, SMB and RMB instructions.
Re: Mitsubishi/Renesas 740 Assembler
Posted: Mon Oct 22, 2018 7:34 pm
by RalfK
Not BIT. The 740's BBC, BBS, CLB and SEB are arranged in a more interleaved pattern than the 65C02's BBR, BBS, SMB and RMB instructions.
Yes, I realized this.
Regards
Ralf
Re: Mitsubishi/Renesas 740 Assembler
Posted: Thu Nov 08, 2018 7:46 am
by Mike Naberezny
Now I'm looking for an assembler. Is there any assembler which understands the 740 family?
As I
mentioned in another thread, I've recently been working with the 740 series. I am using Alan Baldwin's as740 assembler, which is part of his
asxxxx package.
I wrote a
disassembler that emits an assembly language file in as740 format. As part of that, I
tested assembling every legal 740 opcode under as740. I found one bug in as740: assembling a ".byte" directive with an odd number of bytes would add an extra byte of 0. I wrote to Alan and he sent me a fix the next day. I confirmed it worked and asked Alan to include the fix in the next release of asxxxx. Otherwise, it worked very well.
I was able to disassemble a
56K ROM from a car radio and reassemble it to an identical binary using as740. I had previously done
another disassembly project and reassembled using asf2mc8, the asxxxx assembler for the Fujitsu F2MC8-L series. I found no bugs in asf2mc8. In general, I've found the asxxxx package to be high quality and I now look there first when I need an assembler for a processor I haven't used before.
Re: Mitsubishi/Renesas 740 Assembler
Posted: Thu Nov 08, 2018 11:00 am
by cjb
I've encountered this CPU as well-- it's the 10MHz 6502 in the Commodore MPS-1250 printer. The great Lee Davidson helped me figure out the instructions, and then we disassembled the '1250 ROM. From that effort, I submitted a patch to the cc65 maintainer, and da65 does support this CPU.
The best I've found in regards to a datasheet was for the M50734 device..
Interestingly, the '740 adds a "T" CPU status bit, which modifies a few X & Y related instructions, and (not surprisingly for a MCU) makes its bit-twiddling instructions work in ZP as much as it can. (If you map your I/O devices into ZP, it makes a lot of sense...)
Re: Mitsubishi/Renesas 740 Assembler
Posted: Thu Nov 08, 2018 6:34 pm
by BillO
Hey, I'm and old KTM rider. Both me and my KTM are old (1957 - me, 2005 - my KTM 450 EXC)
When I rode enduro I used the WatchDog -
http://www.dugasengineering.com/index.htm
Sorry, I can't be any help wrt an assembler....
Re: Mitsubishi/Renesas 740 Assembler
Posted: Fri Nov 09, 2018 3:50 pm
by floobydust
Hey, I'm and old KTM rider. Both me and my KTM are old (1957 - me, 2005 - my KTM 450 EXC)
When I rode enduro I used the WatchDog -
http://www.dugasengineering.com/index.htm
Sorry, I can't be any help wrt an assembler....
Ha.. still OT, but we have something in common... I'm also old (1957) and rode a KTM 250MX (1984) back in the 80's... great bike, was water-cooled with CDI ignition. In Moto-X, no gauges or instruments of any kind.