cross-32 meta-assembler

Does anyone here use the C32 table-driven cross assembler?

I think Peter Aske was selling it but he seems gone.

Reply to
jlarkin
Loading thread data ...

I think the source code is available for download, but do you have the hardware to modify? Unless you are building processor with FPGA.

Reply to
Ed Lee

I need to revise an old 68332 program. My version of the cross-assembler is C32C, which runs under XP but not Windows 7, which is a nuisance. I think there was a C32D version.

A few people seem to sell C32, probably not authorized, but they are not much help.

Reply to
jlarkin

GCC can handle 683XX. I think the assembler can do it also.

"Use this option for microcontrollers with a CPU32 or CPU32+ core, including the 68330, 68331, 68332, 68333, 68334, 68336, 68340, 68341, 68349 and 68360. "

It might have a slightly different mnemonics or syntax. What are the instructions in question?

Reply to
Ed Lee

Slightly different syntax would be a nightmare. It's 7200 lines of code.

I have an old Samsung netbook that runs XP and works, but it's a nuisance, and I'd like a modern solution. We have a number of 68K based products still in production.

After some decades, the MC68332 is still in production! It has outlasted generations of ARMs.

Reply to
jlarkin

But it's one-to-one mapping. I believe there is a translator available also.

You can compile GCC under Window 7/10.

Reply to
Ed Lee

Great reason to keep a couple of old computers around !

OR, possibly run an older OS using a virtual machine.

Reply to
boB

I keep a variety of (hardware) machines around, but mainly to support hardware devices that were only supported on particular OSs.

This. I keep a variety of "generic" OS setups on my ESXi server. When I have a need for some particular old app, I make a copy of the generic machine (for that guest OS) and then add whatever tool(s) I happen to need.

If I am likely to need this environment again, then I save the new machine (coming up with image names gets to be a chore!) in the hope that I'll remember that I have it (and what it's called!) at some later date.

Otherwise, delete the machine when I'm done running the application.

This is an excellent way to test-drive applications without having to muck up your "real" machines (I don't completely trust "uninstall")

Reply to
Don Y

John - if you find the c32 assembler, especially if you get the source too, let it be known. I'm working on an assembler mostly taken from a 68k assembler from the eighties. I've found 2 and one is working. Dedicated types though; not a table driven style.

Hul

snipped-for-privacy@highlandsniptechnology.com wrote:

Reply to
Hul Tytus

lørdag den 17. april 2021 kl. 21.56.30 UTC+2 skrev snipped-for-privacy@highlandsniptechnology.com:

install virtualbox and download a winxp image for it

Reply to
Lasse Langwadt Christensen

If it's still in production, I'd bet that NXP has or knows of a suitable toolchain that will handle the legacy C code. It may be built into gcc these days.

I recall programming the Motorola 68030 back in the day, in assembler and f77. But it's been a long while.

Joe Gwinn

Reply to
Joe Gwinn

It's ASM -- hence the issue of worrying about mnemonics, syntax, macro language, pseudo-ops, etc. Assemblers are far less "standardized" than HLLs.

Reply to
Don Y

Motorola had different assembly language syntax. I knew someone working on a translator to GCC before.

Reply to
Ed Lee

We modified the 68K definition table to add some 68332 opcodes, and made a few other tweaks. It would be a nightmare to edit the source code for some other assembler.

I can run the whole tool chain on the old Samsung XP netbook, but that involves memory sticks and such, and it may not last forever.

I can recompile all of the tool chain (mostly in PowerBasic) for Win7, but the C32C cross assembler won't run. I think there was a D version that would run under Win7.

The Brat just spun the product PCB layout to replace the old Maxim digital cap, and I need to change the code for that. We plan to build another thousand boxes, then do a full redesign, with a Zynq or something, in a year or so.

Several people sell C32C, and one claims to have C32D, but haven't told me how to order it.

Reply to
jlarkin

But Motorola 68000 assembler was standardized, as I recall.

If not, recode the assembler code in C, being line-by-line literal. C was always accused of being the moral equivalent of assembler, and now it's a feature, not a bug.

Joe Gwinn

Reply to
Joe Gwinn

Source code looks like this:

.SBTTL . RTEMP : READ THE LM71 TEMP SENSOR

; WE READ 14 BITS FROM THE LM71, INTO D4 13:0, AND SIGN-EXTEND ; BIT 13 INTO 15:14. THE RESULT IS A 2'S COMP TEMPERATURE IN ; DEGREES C * 32, WHICH WE THEN SCALE TO DEGC * 10

; PORT D BITS ARE B5 LM71 CS- PIN 70 RUNTIME = 53 USEC ; B2 SCLOCK PIN 67 ; B0 SDIN PIN 65

RTEMP: MOVEM.L D1 D4 D5 D7 A0, -(SP) ; SAVE GOODIES

MOVEA.W # PORTD, A0 ; NAVIGATE TO PORT, MATEY MOVE.W # 2, D1 ; NAME THE SPI CLOCK BIT BCLR.B D1, (A0) ; AND MAKE SURE CLOCK LINE IS LOW.

BCLR.B # 5, (A0) ; CHIP SELECT THE NASTY LITTLE BEAST

CLR.L D4 ; NUKE FUTURE DATA MOVE.W # 14-1, D7 ; NEED A BIT COUNTER, TOO

LMOP: MOVE.B (A0), D5 ; READ THE PORT AND SHIFT RIGHT 1 BIT LSR.B # 1, D5 ; WHICH PUTS SERIAL DATA INTO X-BIT ROXL.W # 1, D4 ; SHIFT THAT INTO DATA REG

BSET.B D1, (A0) ; PUMP CLOCK UP BCLR.B D1, (A0) ; AND DOWN.

DBF D7, LMOP ; - DO 14 BITS -

BSET.B # 5, (A0) ; CHIP DESELECT

BTST.L # 13, D4 ; WAS SIGN BIT SET? BEQ.S TSCAT ; NO, GO SCALE ORI.W # B15+B14, D4 ; YES, SIGN EXTEND

TSCAT: MOVE.W D4, TEMPR.W ; SAVE RAW DEGC * 32

; NOW FRACTIONAL MULTIPLY D4 BY 10/32 TO GET DEGS C * 10

K10 = 20480 ; 10/32, AS A FRACTIONAL

MULS.W # K10, D4 ; DO MULT SWAP.W D4 ; AND MAKE THAT FRACTIONAL MOVE.W D4, TEMPC.W ; AND STASH IN RAM

MOVEM.L (SP)+, D1 D4 D5 D7 A0 ; UNSAVE GOODIES RTS

Reply to
jlarkin

But assembler vendors used their own pseudo-ops, macro languages, etc. This seemed to be especially true of "lower level" (simpler to build!) tools like assemblers -- every vendor would try to add value by augmenting the "language" with their own brand of hooks.

[I used to craft ASLs using the macro language facilities of many of those tools. Moving to a different vendors tool would "break" my code (cuz I was relying on the assembler to *generate* the code for me!)]

I've always found "porting" ASM to be more tedious (not harder, just tedious) than any other HLL.

7000 lines of ASM is probably less than 1000 lines of C so a reasonable assumption. If the code already is known to work, then its probably less than a two week job. Esp as it lets more folks support the codebase, going forward.

And, gives a cleaner framework in which to add/modify the functionality.

OTOH, I suspect there are lots of assumptions "between the lines" in the ASM code that would have to be made more explicit in a C implementation. I'm considerably "safer" when writing in a HLL than in ASM (cuz I have to allow for the code generator's flexibility)

Reply to
Don Y

That surprises me. I used the 68332 in 2000, it was a nice cpu, but after 20years?

However, you can probably use your compiler/assembler in a virtual machine. For example I have a complete development-system with WinXP for Renesas M16C/HEW in a virtual machine and another one for some older FPGA design. In both cases it is also possible to flash/burn with the USB-Tools.

BTW: Even the Bullshitsoftware from Xilinx runs on a modern Ryzen7, well not fast, but acceptable. :-)

Olaf

Reply to
olaf

If you have Win7 pro then you should be able to create an enviroment close enough for an XP only programme to be quite happy. The other way would be create a virtual XP machine on your Win 7 box. I have found the odd installer that won't work at all on Win7 but generally I have been able to coddle old 'doze software into running OK on a Win7 box.

Control Panel Programs and features Run programs made for previous versions of windows

It isn't perfect but it should be good enough.

Reply to
Martin Brown

The GNU toolset (gcc, binutils) knows of M68k, including CPU32.

I don't know if there are already built toolchains for Windowses, but it should be doable from the GNU sources.

Reply to
Tauno Voipio

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.