2500AD C compiler for 6502

I'm about to do another project with a Sunplus 6502-compatible microcontroller. Sunplus doesn't offer a C compiler so I've previously written assembly for them, but I'm interested in using C on this project.

Avocet Systems, who now owns the 2500AD tools, says their 2500AD Compiler for 6502 (ADC-65) explicitly supports Sunplus. Here's some info on it:

formatting link

This is the only compiler I know of with Sunplus support. Anyone have recent experience with this development environment? I found some 1995 posts complaining about unnamed bugs and large code sizes.

My goal for a C compiler is to save development time, even if it does swell the code a bit (I've got plenty of ROM). I'm trying to tell if the

2500AD compiler will help towards that goal or wind up slowing things down.

Thanks, Wallace

Reply to
Wallace White
Loading thread data ...

Hi, I used the 2500ad compiler for the 8051 briefly! It has put me off using C for small systems.

Reply to
CBarn24050

I've been very happy with my embedded C experiences in the past (Hi-Tech C for Microchip PIC, gcc for Atmel AVR). I find I make a lot more dumb mistakes in assembly and that I can develop more naturally in C.

- Wallace

Reply to
Wallace White

A couple of years ago I did a lot of assembly on SPC chips, but only used the 2500AD C compiler enough to make sure that my software could be called from their C programs. You should to determine whether your chip is a nearly full 6502 instruction set (everything but BCD instructions), or the reduced instruction set (no Y register).I don't think the compiler supports the reduced version, Aside from that, the only real customization needed for the SPC is to handle bank switching, which I believe 2500AD claimed to do. I didn't use their IDE since I was already using CodeWright.

The compiler was pretty old (pre-ANSI/ISO), and my sense was that it was being sold "as is", with little chance of enhancements in the future. On the other hand, when I asked for technical support on their assembler/linker I was very pleased with how Avocet responded. I expect that they'd be candid about known limitations of this compiler, so if you haven't contacted them yet, you should.

Jim McGinnis

Reply to
Jim McGinnis

I have not used the Avocet compiler, but I wouldn't limit my choice of compilers to ones that give explicit support of Sunplus. If it is 6502 compatible, I would consider other 6502 compilers as well (if there are any). You might ask Sunplus for compiler recommendations. Also, why not consider another micro with better compiler support?

Thad

Reply to
Thad Smith

Luckily, this part (the SPL11A/12A) does support the full 6502 instruction set except BCD. It does have the Y register and all the memory address types.

Sunplus uses different opcodes than the standard 6502; doesn't this require customization of the compiler?

Also I don't think it would be helpful to use C if you couldn't do source-level debugging with an emulator... Avocet has some PROM emulator that uses the Sunplus piggy-back boards, so that _should_ work well.

I just spoke with the sales guy. It is still pre-ANSI, though he says that's their next project (not that that helps me now!). They're going to get back to me about exactly what it does and does not do.

Thanks for the information!

- Wallace

Reply to
Wallace White

The hitch, I think, is that Sunplus uses different opcodes from the standard 6502. Jim mentioned that the BCD instruction is also missing. I'm frankly not sure what else is not true 6502, since I've never developed for another 6502.

IAR has a 6502 compiler too but they haven't replied to my inquiries about Sunplus support.

Sunplus is super cheap. Their 8-bit micro for our application was cheaper than everyone else's 4-bit (which of course don't have C compilers either). They're very aggressive with production lead times, too.

- Wallace

Reply to
Wallace White

In article , CBarn24050 writes

AFAIK that is a very old system. There are plenty of decent 51 compilers out there. /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ \/\/\/\/\ Chris Hills Staffs England /\/\/\/\/\ /\/\/ snipped-for-privacy@phaedsys.org

formatting link
\/\/ \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/

Reply to
Chris Hills

AFAIK the SPC parts with Y registers use standard 6502 opcodes. (Of course, the fine folks at Spectrum Rep should be able to say if that's so for your chips :>) Even if the opcodes are different, translation is done by a Sunplus post-processing tool, not by the compiler or assembler. This tool, whose name I've forgotten, looks at the listing file to figure out which bytes are opcodes, so it's probably only usable with the 2500AD assembler output. In that case you'd want to make sure that the compiler could emit an assembly source file.

I used the Sunplus SICE emulators, much more capable than a PROMulator. Depending on how much your debugging requires real I/O, I'd try using Visual Studio as much as you can.

For most of the apps where you'd consider using a Sunplus, I think the differences between ANSI/ISO and K&R C aren't very important.

Jim McGinnis

Reply to
Jim McGinnis

From the looks of the Sunplus 6502 instruction manual, every instruction uses a different opcode than the standard 6502.

Oh right--I forgot about the x2s patch tool or whatever it's called. It's been a few years.

Still, to get source-level debugging with C, I'd need a development environment with a Sunplus-compatible emulator... right?

I've never used Visual Studio, except for VisualBasic; what can you do with it for embedded projects?

The PROM emulator sounds fine--it can do breakpoints, you can change variable and register values. It just doesn't do trace, but that's okay. I've got to check whether this micro has the PROM piggy-back, though...

I agree. Avocet just sent me a list of where they fall short of ANSI C, and they're all pretty minor issues.

- Wallace

Reply to
Wallace White

I should elaborate: I couldn't find a micro with an LCD controller and an available C compiler for less than a dollar and a half in quantity. NEC and TI were the closest I found. The Sunplus part is around a quarter.

- Wallace

Reply to
Wallace White

Wallace!

The 2500ad compiler was pretty stable when I tested it on a project about 7 years ago. Hopefully they haven't "improved" it to much since then. It produced nice reliable code that was a bit bloated. I tested the compiler that Avocet was selling just after they bought 2500ad.

I've also developed code for a couple of projects using Manx Systems Aztec65 C compiler. It is very efficient if you can live with it's stack model (uses the 6502 native stack). It does not support 65C02 extensions, but was still produced much tighter code than the 2500ad compiler. The last address I can find for them is: Manx Software Systems Inc., P.O. Box 55, Shrewsbury, NJ 07701, USA; Phone: 201

530-7997, email: snipped-for-privacy@bix.com. I suspect they may no longer be in business.

Western Design Center also makes a C compiler. I heard a rumor that the compiler wizzard who wrote Aztec65 also wrote this one. You can find them at:

formatting link

I'm curious, what sort of design are you using a 6502 in?

Mark

snipped-for-privacy@hvc.rr.comTOAVOIDSPAM

Reply to
mark hahn

The idea is to write and test most of your software using the fine tools available from Microsoft C and Visual Studio (or some other PC-based tool set). The first step is to separate hardware-dependent parts of your software from the modules that can be independent of hardware. These modules can be written and unit tested on a PC, and should then work the same on your target chip, assuming that you've restricted yourself to a compatible subset of C. (Gimpel's PC-Lint helps a lot with this.)

In many cases I've found that I can write PC-based replacements for I/O to permit nearly complete development in the friendly PC environment. For example, instead of reading and debouncing key switches, you can use PC keycodes to invoke various functions. If you are outputting to a display, which the SPLxx seem to be designed for, you can instead draw into a bitmap on the PC. To minimize changes between the PC and target execution environments, I'd define some functions to encapsulate the simulated functions (get_keypress() and draw_pixel(), for example). Each of these functions would have two versions, one for the PC and one for the target.

An advantage is that you can develop software for hardware that doesn't exist or isn't debugged yet, and you can distribute demos without having to build prototypes. A danger is that if the hardware you're replacing is more complicated to simulate than a switch or a bitmap display (eg, a motor and encoder), then you may end up building in any misunderstanding you have about it.

Reply to
Jim McGinnis

I see. Most of my projects are highly dependent on external hardware, like the motor-encoder situation you mention. But this one isn't. Still, I'd be reluctant to buy a PC development tool (we don't have Visual Studio or any other PC IDE) just for this purpose...

Sunplus does have a simulator for the SPL series which simulates a custom LCD as well as switch inputs. If I wind up using assembly, I'll certainly use that while we wait for custom LCD glass.

Thanks, Wallace

Reply to
Wallace White

Glad to hear that!

Thanks, I'll give them a try.

Looks like all their tools are geared towards their micros, though.

I'm not free to say, but if you ask again in a year I could tell you. :) I've previously used Sunplus micros for radio-control toys for Mattel's Tyco division.

- Wallace

Reply to
Wallace White

In article , Wallace White writes: |> My goal for a C compiler is to save development time, even if it does |> swell the code a bit (I've got plenty of ROM). I'm trying to tell if the |> 2500AD compiler will help towards that goal or wind up slowing things down.

For a decent 6502 C compiler have a look at

formatting link

And it's even free.

Rainer

Reply to
Rainer Buchty

It does look interesting. cc65's owner says that he doesn't have permission from Sunplus, however, to release a version that outputs Sunplus code.

I also can't imagine developing in C and having to debug only in assembly. The 2500AD compiler is part of a toolkit that allows source-level debugging.

But, it sounds like that Cactus Logic PROM emulator isn't compatible with this Sunplus part. Darn. Back to assembly...

- Wallace

Reply to
Wallace White

Why would he need their permission?

--
Grant Edwards                   grante             Yow!  WHY are we missing
                                  at               KOJAK?
 Click to see the full signature
Reply to
Grant Edwards

No one needs permission to emit object code. And if the issue is emitting assembly source, then even if SunPlus copyright their assembler mnemonics, nothing prevents altering the syntax to take them out of conflict.

Sounds more like the author doesn't *want* to do it.

--
Bill
Posted with XanaNews Version 1.15.7.4
Reply to
William Meyer

That's one question.

Assuming that they actually refused this permission, though, a much more important one is this: what on earth does Sunplus' management think it's doing? And: can I afford to rely on a seriously broken-minded company like that to supply an important part to me?

Telling a compiler maker to *not* make code for your hardware is a completely crazy position. Being programmed by your customers is what a CPU is supposed to be made for. Restricting your customer's applications of your product like this is just a slightly obfuscated way of saying: "we never wanted to actually sell those chips in the first place".

Would you buy paper from a maker trying to keep you from writing on it using an ordinary pencil?

--
Hans-Bernhard Broeker (broeker@physik.rwth-aachen.de)
Even if all the snow were burnt, ashes would remain.
Reply to
Hans-Bernhard Broeker

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.