EmbeddedRelated.com
Forums

Making Fatal Hidden Assumptions

Started by CBFalconer March 6, 2006
Flash Gordon wrote:

> > I'll give some attributes that I consider essential to an assembler, and > whether or not C has them: > - The ability to write Interrupt Service Routines > - Not possible in C since there is no mechanism to specify that a > routine is an ISR and some processors use different calling > conventions for IRSs.
Every C compiler I've used for the last 2exp(N) years (apart from perhaps the ones for specific OSs like Windows, where I've simply not looked) has had this facility. It's not C- it's an extension, and it's very annoying that they are all different- but it's there.
> - The ability to access IO ports on the processor > - Not possible in C. You can access memory mapped devices, but not IO > mapped devices.
Same as above. Plus necessary constructs to direct unchanging objects to ROM, again all compilers different. But you're right (whoever said it), it's nowt like an assembler. It's just a quick and dirty middle- level language, and to use it you really need to know the hardware yoiu're operating on in many cases. It seems that the little embedded stuff is considered simply below the radar for the standards committees. Perhaps that's a good thing. Paul Burke
* Flash Gordon:
> Alf P. Steinbach wrote: >> * Keith Thompson: >>> >>> You claim that C is, in some sense, an assembly language >> >> Nope, as you know I haven't claimed that. Whenever you're referring >> to a claim, be sure to quote that claim. Especially when your >> previous attempt at making the claim-making stick has been shown as >> fallacious. >> >> >>> (specifically, a "portable assembly language"). >>> I'm assuming here that any "portable assembly language" is an >>> "assembly language". >> >> That assumption does not hold. > > Then tell us what you *do* mean.
If you can quote whatever passage is mystifying to you, I'll try to clear that up, but I can't clear up an unlimited amount of things: be specific.
> So in your world the definition of what a computer is has no relevance > to the meaning of the term "portable computer?"
Huh? -- A: Because it messes up the order in which people normally read text. Q: Why is it such a bad thing? A: Top-posting. Q: What is the most annoying thing on usenet and in e-mail?
* Flash Gordon:
 > [snipped anonymous babble]

What is the question?

-- 
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
Flash Gordon wrote:

> If you can't define what a term means, then it is meaningless
I don't think that's true, if only because you have to start with /some/ terms that don't have definitions. Meaning is prior to definition.
> and so it is pointless to use that term with reference to anything.
Clarity and/in communication, that's the ticket. -- Chris "sparqling" Dollin "Who do you serve, and who do you trust?"
Paul Burke wrote:
> Flash Gordon wrote: > >> I'll give some attributes that I consider essential to an assembler, >> and whether or not C has them: >> - The ability to write Interrupt Service Routines >> - Not possible in C since there is no mechanism to specify that a >> routine is an ISR and some processors use different calling >> conventions for IRSs. > > Every C compiler I've used for the last 2exp(N) years (apart from > perhaps the ones for specific OSs like Windows, where I've simply not > looked) has had this facility. It's not C- it's an extension, and it's > very annoying that they are all different- but it's there. > >> - The ability to access IO ports on the processor >> - Not possible in C. You can access memory mapped devices, but not IO >> mapped devices. > > Same as above. > > Plus necessary constructs to direct unchanging objects to ROM, again all > compilers different.
You snipped the part where I pointed out that you can do all this in the various forms of extended Pascal I've used, so if you allow extensions Pascal is just as low a level language as C ;-)
> But you're right (whoever said it), it's nowt like an assembler. It's > just a quick and dirty middle- level language, and to use it you really > need to know the hardware yoiu're operating on in many cases.
Agreed. Despite my comment above, I would say that Pascal was a higher level language than C.
> It seems that the little embedded stuff is considered simply below the > radar for the standards committees. Perhaps that's a good thing.
Well, those odd little corners in my experience are only a small fraction of the code, so I don't see it as a big issue. -- Flash Gordon, living in interesting times. Web site - http://home.flash-gordon.me.uk/ comp.lang.c posting guidelines and intro: http://clc-wiki.net/wiki/Intro_to_clc
Alf P. Steinbach wrote:
> * Flash Gordon: >> Alf P. Steinbach wrote: >>> * Keith Thompson: >>>> >>>> You claim that C is, in some sense, an assembly language >>> >>> Nope, as you know I haven't claimed that. Whenever you're referring >>> to a claim, be sure to quote that claim. Especially when your >>> previous attempt at making the claim-making stick has been shown as >>> fallacious. >>> >>> >>>> (specifically, a "portable assembly language"). >>>> I'm assuming here that any "portable assembly language" is an >>>> "assembly language". >>> >>> That assumption does not hold. >> >> Then tell us what you *do* mean. > > If you can quote whatever passage is mystifying to you, I'll try to > clear that up, but I can't clear up an unlimited amount of things: be > specific.
What do you mean by "portable assembly language". A question you have already been asked.
>> So in your world the definition of what a computer is has no relevance >> to the meaning of the term "portable computer?" > > Huh?
You claim the definition of "assembly language" has no bearing on the definition of "portable assembly language". By this argument the definition of "computer" should not have anything to do with the definition of "portable computer." -- Flash Gordon, living in interesting times. Web site - http://home.flash-gordon.me.uk/ comp.lang.c posting guidelines and intro: http://clc-wiki.net/wiki/Intro_to_clc
Alf P. Steinbach wrote:
> * Flash Gordon: > > [snipped anonymous babble]
I don't know why you call it anonymous, since I am not posting anonymously. Or if I am, it is about the worst attempt ever at being anonymous.
> What is the question?
I wasn't asking a question, I was refuting points you raised and pointing out why C is not any form of assembler, including a portable assembler. It's not my fault if you don't understand a lot of the things I spent many years using assembler for, or the various things you cannot do in C that you can easily do in assembler. -- Flash Gordon, living in interesting times. Web site - http://home.flash-gordon.me.uk/ comp.lang.c posting guidelines and intro: http://clc-wiki.net/wiki/Intro_to_clc
Flash Gordon wrote:
> > BTW, I've done embedded programming, including writing interrupt service > routines, accessing IO ports (as opposed to memory mapped devices), > accessing memory mapped devices etc all in a few different extended > versions of Pascal. So from my perspective Pascal is about as close to > assembler as C is.
Just about any language than isn't pure OO (I'm not 100% sure on that point, I just can't imaging pure Java in this role) can be extended to do this. DEC even sold an operating system written in BASIC. So what is the point of this discussion? No language can replace assembler without extensions, any attempt to standardise a hardware layer would be doomed. If C was intended as an assembler, the original PHP UNIX would have been pure C, which it wasn't. -- Ian Collins.
Flash Gordon wrote:
> Alf P. Steinbach wrote: > > * Flash Gordon: > >> Alf P. Steinbach wrote: > >>> * Keith Thompson: > >>>> (specifically, a "portable assembly language"). > >>>> I'm assuming here that any "portable assembly language" is an > >>>> "assembly language".
Seems resonable enough, but since "portable assembly language" taken literally is an oxymoron, I assume the originators of the term were being metaphorical.
> >>> That assumption does not hold. > >> > >> Then tell us what you *do* mean. > > > > If you can quote whatever passage is mystifying to you, I'll try to > > clear that up, but I can't clear up an unlimited amount of things: be > > specific.
Hee hee hee. I've enjoyed this discussion.
> What do you mean by "portable assembly language". A question you have > already been asked.
I'll try. I'd say "portable assembly language" is a sort of short-hand, semi-metaphorical way of saying a language has certain properties that make it (more so than other HLLs) a viable alternative to assembly language in many cases. I also think it says as much about how the language is used, or intended to be used, as about the language itself. For example, if some assembly language programmers switch to C purely for the sake of portability (as opposed to, say, increased productivity) then they're using C as a sort of portable assembly language. For an example of use of the term by people who presumably know what "assembly language" means, see http://www.cminusminus.org/
Flash Gordon wrote:
> Alf P. Steinbach wrote: >
... snip ...
>> >> If you can quote whatever passage is mystifying to you, I'll try >> to clear that up, but I can't clear up an unlimited amount of >> things: be specific. > > What do you mean by "portable assembly language". A question you > have already been asked. >
... snip ...
> > You claim the definition of "assembly language" has no bearing on the > definition of "portable assembly language". By this argument the > definition of "computer" should not have anything to do with the > definition of "portable computer."
How about knocking it off. I am on the edge of plonking both of you for this ridiculous argument. -- "If you want to post a followup via groups.google.com, don't use the broken "Reply" link at the bottom of the article. Click on "show options" at the top of the article, then click on the "Reply" at the bottom of the article headers." - Keith Thompson More details at: <http://cfaj.freeshell.org/google/> Also see <http://www.safalra.com/special/googlegroupsreply/>