Small-C

Small-C
Developer(s)Ron Cain, James E. Hendrix
Initial release1980; 44 years ago (1980)
Written inC programming language
TypeCompiler
LicenseCopyrighted but sharable

Small-C is both a subset of the C programming language, suitable for resource-limited microcomputers and embedded systems, and an implementation of that subset. Originally valuable as an early compiler for microcomputer systems available during the late 1970s and early 1980s, the implementation has also been useful as an example simple enough for teaching purposes.

The original compiler, written in Small-C for the Intel 8080 by Ron Cain, appeared in the May 1980 issue of Dr. Dobb's Journal. James E. Hendrix improved and extended the original compiler, and wrote The Small-C Handbook. Ron bootstrapped Small-C on the SRI International PDP 11/45 Unix system with an account provided by John Bass for Small C development. The provided source code was released with management permission into the public domain.[citation needed] Small-C was important for tiny computers in a manner somewhat analogous to the importance of GCC for larger computers. Just like its Unix counterparts, the compiler generates assembler code, which then must be translated to machine code by an available assembler.

Small-C is a retargetable compiler. Porting Small-C requires only that the back-end code generator and the library to operating system interface calls be rewritten for the target processor.

Language subset

"In May of 1980 Dr. Dobb's Journal ran an article entitled "A Small C Compiler for the 8080s" in which Ron Cain presented a small compiler for a subset of the C language. The most interesting feature of the compiler besides its small size was the language in which it was written—the one it compiled. It was a self-compiler! (Although this is commonplace today, it was a fairly novel idea at the time.) With a simple, one-pass algorithm, his compiler generated assembly language for the 8080 processor. Being small, however, it had its limitations. It recognized only characters, integers, and single dimension arrays of either type. The only loop controlling device was the while statement. There were no Boolean operators, so the bitwise logical operators & (AND) and | (OR) were used instead. But even with these limitations, it was a very capable language and a delight to use, especially compared to assembly language.

Recognizing the need for improvements, Ron encouraged me to produce a second version, and in December 1982 it also appeared in Dr. Dobb's Journal. The new compiler augmented Small C with (1) code optimizing, (2) data initializing, (3) conditional compiling, (4) the extern storage class, (5) the for, do/while, switch, and goto statements, (6) combination assignment operators, (7) Boolean operators, (8) the ones' complement operator, (9) block local variables, and (10) various other features. Then in 1984 Ernest Payne and I developed and published a CP/M compatible run-time library for the compiler. It consisted of over 80 functions and included most of those in the UNIX C Standard I/O Library—the ones that pertained to the CP/M environment. This became version 2.1 and the subject of The Small C Handbook.[1]

See also

  • BDS C (1979) – C compiler for Z80 and 8080 systems
  • MISOSYS C (1985) - C compiler for TRS-80 (Z80 CPU)
  • Tiny C (2002) – C compiler for slow x86 and ARM computers having little disk space

Small-C variants

References

  1. ^ James E. Hendix. "Introduction". A Small-C Compiler: Language, Usage, Theory, and Design. M & T Books 1988 / Dr. Dobb's Journal Developer Network 2005.
  2. ^ "C compilers for the BBC Computer". Mdfs.net.

Notes

  • Ron Cain, "A Small C Compiler for the 8080's", Dr. Dobb's Journal, April–May 1980, pp. 5–19
  • James E. Hendrix, The Small-C Handbook, Reston 1984, ISBN 0-8359-7012-4
  • James E. Hendrix, A Small C Compiler: Language, Usage, Theory, and Design, M & T Books 1988, ISBN 0-934375-88-7
  • James E. Hendrix, Small C Compiler, M & T Books 1990, ISBN 1-55851-124-5

Read other articles:

Chemical structures of erinacines A-I Erinacines are natural substances isolated from Hericium erinaceus. They belong to the group of cyathin diterpenoids (erinacines A-K, P, and Q) and are subjects of pharmacological research. Erinacine A Erinacine A, isolated from the cultured mycelia of Hericium erinaceus, the main representative of this compounds group, has an enhancing effect on nerve growth factor synthesis in vitro.[1] It also increases catecholamine in the central nervous system …

French actor and director Daniel AuteuilDaniel Auteuil in 2011Born (1950-01-24) 24 January 1950 (age 74)Algiers, French AlgeriaOccupation(s)Actor, film director, screenwriterYears active1974–presentSpouses Anne Jousset (?–?) Emmanuelle Béart ​ ​(m. 1993⁠–⁠1995)​ Aude Ambroggi ​(m. 2006)​ PartnerMarianne DenicourtChildren3; including Aurore Auteuil Daniel Auteuil (French: [danjɛl otœj]; bo…

31st season of top-tier football league in Russia Football league seasonRussian Premier LeagueSeason2022–23Dates15 July 2022 – 3 June 2023ChampionsZenitRelegatedKhimkiTorpedoMatches played240Goals scored730 (3.04 per match)Top goalscorerMalcom(23 goals)Biggest home winZenit 8–0 Orenburg11 September 2022Biggest away winKhimki 0–6 Krasnodar2 April 2023Highest scoringZenit 8–0 Orenburg11 September 2022Longest winning run7 matchesZenitLongest unbeaten run15 matchesZenitLongest winless…

1957 novel by Philip K. Dick The Cosmic Puppets First edition (paperback)AuthorPhilip K. DickCountryUnited StatesLanguageEnglishGenreScience fictionPublisherAce BooksPublication date1957Media typePrint (hardback & paperback)Pages127 The Cosmic Puppets originally appeared in the December 1956 issue of Satellite Science Fiction as A Glass of Darkness. The Cosmic Puppets is a science fiction novel by American author Philip K. Dick, published in 1957. It is a revision of A Glass of Darkness…

Culey-le-Patrycomune (dettagli) Culey-le-Patry – Veduta LocalizzazioneStato Francia Regione Normandia Dipartimento Calvados ArrondissementCaen CantoneThury-Harcourt TerritorioCoordinate48°57′N 0°32′W / 48.95°N 0.533333°W48.95; -0.533333 (Culey-le-Patry)Coordinate: 48°57′N 0°32′W / 48.95°N 0.533333°W48.95; -0.533333 (Culey-le-Patry) Superficie7,89 km² Abitanti348[1] (2009) Densità44,11 ab./km² Altre informazioniCo…

Сибирский горный козёл Научная классификация Домен:ЭукариотыЦарство:ЖивотныеПодцарство:ЭуметазоиБез ранга:Двусторонне-симметричныеБез ранга:ВторичноротыеТип:ХордовыеПодтип:ПозвоночныеИнфратип:ЧелюстноротыеНадкласс:ЧетвероногиеКлада:АмниотыКлада:СинапсидыКласс:…

Dunfermline Athletic 2021–22 football seasonDunfermline Athletic2021–22 seasonChairmanRoss McArthur[1]ManagerPeter Grant[2](until 31 October)Greg Shields & Steven Whittaker[3] (interim managers)(31 October to 12 November)John Hughes[4](from 12 November)StadiumEast End ParkDunfermline, Scotland(Capacity: 11,480)ChampionshipNinth(Relegated via play-off)League CupSecond round, lost to RangersChallenge CupSecond round, lost to Elgin CityScottish CupThird round…

Voce principale: Società Sportiva Calcio Napoli. AC NapoliStagione 1942-1943 Sport calcio Squadra Napoli Allenatore Antonio Vojak (1ª-17ª) Paolo Innocenti (18ª-34ª) Presidente Luigi Piscitelli Serie B3º[1] Coppa ItaliaSedicesimi di finale Maggiori presenzeCampionato: Sentimenti, Gramaglia, Busani (32) Miglior marcatoreCampionato: Viani (16) StadioArturo Collana 1941-1942 1944 Si invita a seguire il modello di voce Questa voce raccoglie le informazioni riguardanti l'Associa…

Railway line in India Delhi–Kalka lineKalka railway station the last station on Delhi–Kalka lineOverviewStatusOperationalOwnerIndian RailwaysLocaleDelhi, Haryana, ChandigarhTerminiDelhiKalkaServiceOperator(s)Northern RailwayHistoryOpened1891TechnicalTrack length267 km (166 mi)Track gauge5 ft 6 in (1,676 mm) broad gaugeElectrification25 kV 50 Hz AC OHLE in 1992–2000Operating speedup to 130 km/h Route map Legend km planned link toBilaspur–Leh line&#…

Yehoshua MatzaLahir(1931-08-08)8 Agustus 1931Tempat lahirYerusalem, Mandat PalestinaMeninggal dunia30 Desember 2020(2020-12-30) (umur 89)Tempat meninggalYerusalem, IsraelKnesset11, 12, 13, 14, 15Faksi yang diwakili di Knesset1984–2002LikudJabatan menteri1996–1999Menteri Kesehatan Yehoshua Matza (Ibrani: יהושע מצא, 8 Agustus 1931 – 30 Desember 2020) adalah seorang figur politik Israel serta presiden dan CEO State of Israel Bonds, sebuah wirausaha global yang m…

Кача — етап історії вітчизняної авіації УкраїнаНомінал 5 гривеньМаса 16,54 гДіаметр 35 ммГурт рифленийМетал нейзильберРоки карбування 2012Аверс Реверс «Ка́ча — ета́п істо́рії вітчизня́ної авіа́ції» — ювілейна монета номіналом 5 гривень, випущена Національн…

Danish handballer (born 1986) For the Norwegian footballer, see Mads Hedenstad Christiansen. Mads Christiansen Personal informationBorn (1986-05-03) 3 May 1986 (age 38)Næstved, DenmarkNationality DanishHeight 1.97 m (6 ft 6 in)Playing position Right backClub informationCurrent club Aarhus HCSenior clubsYears Team2004–2006 GOG2006–2008 TMS Ringsted2008–2011 Aalborg Håndbold2011–2013 Team Tvis Holstebro2013–2016 Bjerringbro-Silkeborg2016–2019 SC Magdeburg2019–20…

This article needs additional citations for verification. Please help improve this article by adding citations to reliable sources. Unsourced material may be challenged and removed.Find sources: Tarık Buğra – news · newspapers · books · scholar · JSTOR (June 2020) (Learn how and when to remove this message) Statue of Tarık Buğra in front of the National Library of Turkey Süleyman Tarık Buğra (2 September 1918 – 26 February 1994) was a Turkish jou…

House flag used by Houlder Line The first of four Houlder ships to be called Oswestry Grange. This one was a refrigerated cargo ship built in 1902 and sold in 1912 Houlder Line was a number of related British shipping companies originally established by the Houlder brothers.[1] History Drayton Grange in Brisbane. She was built for Houlder Brothers in 1901 and sold in 1912. Houlder Brothers & Co was formed in London 1856 and operated in the market for chartered tonnage. In 1861 the co…

Chinese admiral (born 1957) In this Chinese name, the family name is Qin. Qin Shengxiang秦生祥Political Commissar of the People's Liberation Army NavyIn officeSeptember 2017 – January 2022CommanderShen JinlongPreceded byMiao HuaSucceeded byYuan HuazhiDirector of the General Office of the Central Military CommissionIn officeOctober 2012 – August 2017Preceded byWang GuanzhongSucceeded byZhong Shaojun Personal detailsBornFebruary 1957 (age 67)Jianli, Hubei, ChinaP…

Anti-semitic laws passed by the German government in the late 1930s The Nuremberg Laws of 1935 as published in the Reichsgesetzblatt. Anti-Jewish legislation in pre-war Nazi Germany comprised several laws that segregated the Jews from German society and restricted Jewish people's political, legal and civil rights. Major legislative initiatives included a series of restrictive laws passed in 1933, the Nuremberg Laws of 1935, and a final wave of legislation preceding Germany's entry into World War…

For other uses, see Canyon City. Home rule municipality in Colorado, United StatesCañon City, ColoradoHome rule municipality[1]Downtown Cañon City, 2010 FlagNicknames: Climate Capital of ColoradoMotto: Gateway to the Authentic WestLocation of the City of Cañon City in Fremont County, Colorado.Cañon CityLocation of the City of Cañon City in the United States.Coordinates: 38°26′35″N 105°13′13″W / 38.44306°N 105.22028°W / 38.44306; -105.220…

Shell or sea snails For the Indian ritual conch, see Shankha. For other uses, see Conch (disambiguation). Apertural view of an adult queen conch Lobatus gigas with the foot, eyes and snout visible A shell of a dead Florida crown conch Melongena corona inhabited by a hermit crab Conch (/kɒŋk, kɒntʃ/)[1] is a common name of a number of different medium-to-large-sized sea snails. Conch shells typically have a high spire and a noticeable siphonal canal (in other words, the shell comes to…

This article needs additional citations for verification. Please help improve this article by adding citations to reliable sources. Unsourced material may be challenged and removed.Find sources: Tiruchirappalli Fort – news · newspapers · books · scholar · JSTOR (November 2018) (Learn how and when to remove this message) Historic site in Trichirapalli, IndiaTiruchirappalli Fort (Trichinopoly Fort)Broken Ramparts of Tiruchirapalli FortLocationTrichirapalli,…

Badan PengembanganInfrastruktur Wilayah Kementerian Pekerjaan Umumdan Perumahan RakyatRepublik IndonesiaGambaran umumDasar hukumPeraturan Presiden Nomor 27 Tahun 2020Bidang tugasmelaksanakan penyusunan kebijakan teknis dan strategi keterpaduan antara pengembangan kawasan dengan infrastruktur pekerjaan umum dan perumahan rakyatSusunan organisasiKepala BadanRachman Arief DienaputraSitus webbpiw.pu.go.id Badan Pengembangan Infrastruktur Wilayah merupakan unsur pendukung pada Kementerian Pekerj…