Mitsubishi/Renesas 740 Assembler

Programming the 6502 microprocessor and its relatives in assembly and other languages.
Post Reply
RalfK
Posts: 35
Joined: 19 Aug 2017
Location: near Karlsruhe, West-Germany

Mitsubishi/Renesas 740 Assembler

Post 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
User avatar
BitWise
In Memoriam
Posts: 996
Joined: 02 Mar 2004
Location: Berkshire, UK
Contact:

Re: Mitsubishi/Renesas 740 Assembler

Post 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.
Melps-740.zip
(3.51 MiB) Downloaded 151 times
It is very much hot off the press so E&OE (https://en.wikipedia.org/wiki/Errors_an ... s_excepted).
Andrew Jacobs
6502 & PIC Stuff - http://www.obelisk.me.uk/
Cross-Platform 6502/65C02/65816 Macro Assembler - http://www.obelisk.me.uk/dev65/
Open Source Projects - https://github.com/andrew-jacobs
User avatar
Dr Jefyll
Posts: 3525
Joined: 11 Dec 2009
Location: Ontario, Canada
Contact:

Re: Mitsubishi/Renesas 740 Assembler

Post by Dr Jefyll »

RalfK wrote:
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
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html
User avatar
BitWise
In Memoriam
Posts: 996
Joined: 02 Mar 2004
Location: Berkshire, UK
Contact:

Re: Mitsubishi/Renesas 740 Assembler

Post by BitWise »

The coding of the bit instructions is also different from the 65c02.
Andrew Jacobs
6502 & PIC Stuff - http://www.obelisk.me.uk/
Cross-Platform 6502/65C02/65816 Macro Assembler - http://www.obelisk.me.uk/dev65/
Open Source Projects - https://github.com/andrew-jacobs
RalfK
Posts: 35
Joined: 19 Aug 2017
Location: near Karlsruhe, West-Germany

Re: Mitsubishi/Renesas 740 Assembler

Post by RalfK »

BitWise wrote:
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.
Dr Jefyll wrote:
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
User avatar
BitWise
In Memoriam
Posts: 996
Joined: 02 Mar 2004
Location: Berkshire, UK
Contact:

Re: Mitsubishi/Renesas 740 Assembler

Post 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.
Andrew Jacobs
6502 & PIC Stuff - http://www.obelisk.me.uk/
Cross-Platform 6502/65C02/65816 Macro Assembler - http://www.obelisk.me.uk/dev65/
Open Source Projects - https://github.com/andrew-jacobs
RalfK
Posts: 35
Joined: 19 Aug 2017
Location: near Karlsruhe, West-Germany

Re: Mitsubishi/Renesas 740 Assembler

Post by RalfK »

BitWise wrote:
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
User avatar
Mike Naberezny
Site Admin
Posts: 293
Joined: 30 Aug 2002
Location: Northern California
Contact:

Re: Mitsubishi/Renesas 740 Assembler

Post by Mike Naberezny »

RalfK wrote:
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.
Attachments
m74pst.c
Replacement m74pst.c for asxxxx 5.20 sent by Alan Baldwin to fix assembling .byte directives on as740.
(11.79 KiB) Downloaded 105 times
cjb
Posts: 46
Joined: 26 Nov 2010
Location: NSW, Australia
Contact:

Re: Mitsubishi/Renesas 740 Assembler

Post 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...)
User avatar
BillO
Posts: 1038
Joined: 12 Dec 2008
Location: Canada

Re: Mitsubishi/Renesas 740 Assembler

Post by BillO »

RalfK wrote:
"Old" KTM drivers probably know this device developed by West-German Touratech in the 1990s and also sold as http://www.dugasengineering.com/index.htm.
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....
Last edited by BillO on Thu Nov 08, 2018 6:40 pm, edited 2 times in total.
Bill
User avatar
floobydust
Posts: 1394
Joined: 05 Mar 2013

Re: Mitsubishi/Renesas 740 Assembler

Post by floobydust »

BillO wrote:
RalfK wrote:
"Old" KTM drivers probably know this device developed by West-German Touratech in the 1990s and also sold as http://www.dugasengineering.com/index.htm.
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.
Post Reply