home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!spool.mu.edu!sgiblab!cs.uoregon.edu!news.uoregon.edu!nntp.uoregon.edu!stevev
- From: stevev@miser.uoregon.edu (Steve VanDevender)
- Newsgroups: comp.sys.hp48
- Subject: Re: C compiler for HP48
- Date: 21 Jan 93 10:54:29
- Organization: University of Oregon Chemistry Stores
- Lines: 48
- Message-ID: <STEVEV.93Jan21105429@miser.uoregon.edu>
- References: <C15xss.1H6@nvcc.uucp> <books.196.0@fsunuc.physics.fsu.edu>
- <1jmjcfINN1cb@emmental.csv.warwick.ac.uk>
- NNTP-Posting-Host: miser.uoregon.edu
- In-reply-to: phudl@csv.warwick.ac.uk's message of 21 Jan 1993 16:35:27 -0000
-
- In article <1jmjcfINN1cb@emmental.csv.warwick.ac.uk>
- phudl@csv.warwick.ac.uk (Mr S J Liddicott) writes:
-
- One advantage of the 48 is that its ROM routines would be the
- C library/kernal, so code needn't be that big.
-
- Every so often, someone thinks of the idea of writing a C
- compiler for the HP 48. I think it's not worth the effort, for
- several reasons.
-
- The Saturn is not a processor that would be easy to write a code
- generator for. Register usage is non-orthogonal. There are lots
- of register fields, few of which correspond well to traditional C
- data types. The hardware stack is limited to 8 20-bit values, so
- a parameter-passing stack would have to be implemented in
- software. As a consequence, it would be difficult for a C
- compiler to generate efficient Saturn code, and typical C
- programs wouldn't be easily portable to the Saturn architecture.
-
- The ROMs don't have that many routines that correspond to
- standard C library routines. You'd still have to write a C
- runtime library, a task complicated by the need for an HP 48 C
- system to interface with the normal RPL environment.
-
- Perhaps the biggest problem with any C development environment
- for the HP 48 is that it would be at odds with the fundamentally
- interactive nature of the HP 48. C is a reasonably good language
- for developing larger applications, but it is also difficult,
- arcane, and not designed for interactive, incremental program
- development. C has its place, but not on the HP 48. System RPL
- is by necessity the systems programming language of the HP 48,
- and Saturn assembler the language of choice for the low-level and
- time-critical applications. You could write a C-like compiler
- for the HP 48, but I do't think you could really implement ANSI C
- well on its architecture.
-
- Just because a machine can be programmed in assembly language
- doesn't mean that it can or should have a C compiler. C is not
- the be-all and end-all of programming languages, and any serious
- programmer should be able to work in a variety of languages.
-
- It would be cool to see a Scheme interpreter/compiler for the
- HP 48, though. :-)
- --
- Steve VanDevender stevev@greylady.uoregon.edu
- "Bipedalism--an unrecognized disease affecting over 99% of the population.
- Symptoms include lack of traffic sense, slow rate of travel, and the
- classic, easily recognized behavior known as walking."
-