6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sun Sep 29, 2024 5:19 am

All times are UTC




Post new topic Reply to topic  [ 11 posts ] 
Author Message
PostPosted: Mon Oct 22, 2018 9:13 am 
Offline

Joined: Sat Aug 19, 2017 1:42 pm
Posts: 35
Location: near Karlsruhe, West-Germany
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


Top
 Profile  
Reply with quote  
PostPosted: Mon Oct 22, 2018 3:00 pm 
Offline
User avatar

Joined: Tue Mar 02, 2004 8:55 am
Posts: 996
Location: Berkshire, UK
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.

Attachment:
Melps-740.zip [3.51 MiB]
Downloaded 133 times


It is very much hot off the press so E&OE (https://en.wikipedia.org/wiki/Errors_and_omissions_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


Top
 Profile  
Reply with quote  
PostPosted: Mon Oct 22, 2018 5:09 pm 
Offline
User avatar

Joined: Fri Dec 11, 2009 3:50 pm
Posts: 3367
Location: Ontario, Canada
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


Top
 Profile  
Reply with quote  
PostPosted: Mon Oct 22, 2018 6:29 pm 
Offline
User avatar

Joined: Tue Mar 02, 2004 8:55 am
Posts: 996
Location: Berkshire, UK
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


Top
 Profile  
Reply with quote  
PostPosted: Mon Oct 22, 2018 7:25 pm 
Offline

Joined: Sat Aug 19, 2017 1:42 pm
Posts: 35
Location: near Karlsruhe, West-Germany
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


Top
 Profile  
Reply with quote  
PostPosted: Mon Oct 22, 2018 7:29 pm 
Offline
User avatar

Joined: Tue Mar 02, 2004 8:55 am
Posts: 996
Location: Berkshire, UK
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


Top
 Profile  
Reply with quote  
PostPosted: Mon Oct 22, 2018 7:34 pm 
Offline

Joined: Sat Aug 19, 2017 1:42 pm
Posts: 35
Location: near Karlsruhe, West-Germany
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


Top
 Profile  
Reply with quote  
PostPosted: Thu Nov 08, 2018 7:46 am 
Offline
Site Admin
User avatar

Joined: Fri Aug 30, 2002 1:08 am
Posts: 281
Location: Northern California
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:
File comment: Replacement m74pst.c for asxxxx 5.20 sent by Alan Baldwin to fix assembling .byte directives on as740.
m74pst.c [11.79 KiB]
Downloaded 94 times

_________________
- Mike Naberezny (mike@naberezny.com) http://6502.org
Top
 Profile  
Reply with quote  
PostPosted: Thu Nov 08, 2018 11:00 am 
Offline

Joined: Fri Nov 26, 2010 6:03 pm
Posts: 46
Location: NSW, Australia
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...)


Top
 Profile  
Reply with quote  
PostPosted: Thu Nov 08, 2018 6:34 pm 
Offline
User avatar

Joined: Fri Dec 12, 2008 10:40 pm
Posts: 1005
Location: Canada
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....

_________________
Bill


Last edited by BillO on Thu Nov 08, 2018 6:40 pm, edited 2 times in total.

Top
 Profile  
Reply with quote  
PostPosted: Fri Nov 09, 2018 3:50 pm 
Offline
User avatar

Joined: Tue Mar 05, 2013 4:31 am
Posts: 1383
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.

_________________
Regards, KM
https://github.com/floobydust


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 11 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: