Am 11.11.20 um 05:43 schrieb Bill Gaylord: > Hello, > Is there any sort of straight forward guide to adding a new target to > SDCC? > I am working on a homebrew CPU / System and want to "port" C to it. > (I already have a slightly above Assembly like language for it.) > > If you could point me in the right direction that would be greatly > appreciated. > > Thanks, > William Gaylord
What is your CPU like? How many registers are there? Does it have efficient stack acccess (.e.g via a stackpointer-relative addressing mode)? Is it a variant of an exisitng architecture (e.g. a Z80-like with a few instructions added or removed)? Have a look at the subdirectories for some existing ports: src/z80: This has all the compiler-side infrastructure for the classic Z80 and derivatives (Z180, Rabbit, etc). Many general-purpose registers. Locla variables go onto the stack accessed mostly via index registers. src/stm8: The STM8 port. A modern 8-Bit architecture with efficient stack access. Few registers. Local variables on stack. src/pdk: The pdk13, pdk14 and pdk15 ports. A minimal architecture. Accumulator only (though SDCC uses an additional pseudo-register). Local variables by default not on stack due to lack of efficient stack access. Philipp _______________________________________________ Sdcc-user mailing list Sdcc-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sdcc-user