assembly in future C standard HCF Gerry Wheeler

c

    Sponsored Links

    Next

  • 1. "does not give a valid preprocessing token"... Why?
    Hi All, I have a piece of code (not written by me) that is failing on compile with the error: pasting "xdr_ndmp_connect_open_request" and "," does not give a valid preprocessing token The relevant line from the header is: #define XDR_AND_SIZE(func) (bool_t(*)(XDR*, ...))xdr_##func##,sizeof(func) Any and all help greatly appreciated.
  • 2. [OT] Performance Programming
    "Kelsey Bjarnason" < XXXX@XXXXX.COM > wrote in message news: XXXX@XXXXX.COM ... > [snips] <SNIP> > 1) Decent profiling, to identify hot spots > 2) Improved algorithms > 3) When _absolutely_ necessary, tossing in a little ASM code > > No reason you can't do 1 and 2 in Java, and 3 is completely irrelevant to > C; I suspect Java has a way to call routines in other languages. Not that > the third option is the one to use, generally. Yep - it's called the Java Native Interface (JNI), and it provides a framework to call libraries written in other languages (although usually C, as this is what it is geared towards). I've always found it works pretty well, and it even allows two-way communication between the Java and C code. Bit off-topic I suppose, but perhaps the OP could just use C for the parts that are too slow. Having said that, I think 99% of the time your algorithms are the place to invest the effort. Java isn't THAT slow! <SNIP> Rowland.
  • 3. Timer in a C Program
    Dear All, main() { int num; printf("Enter a number "); scanf("%d",&num); } In the above C program, I would like the user to allow only 20 seconds to enter any number. Just after 20 seconds, the program must terminate even if the user has not entered any number. How can I set such a timer in the above program. Also the decrementing time should be displayed on the screen, along with other output, Please suggest me a code in C to fullfill the above requirement. Margee S

Re: assembly in future C standard HCF Gerry Wheeler

Postby Walter Banks » Sat, 04 Nov 2006 22:35:39 GMT

As this thread wanders off topic this industry was introduced to a new
mnemonic in Byte article about decoding the undocumented
Motorola 6800 instructions. The HCF (Halt Catch Fire) opcode $DD
or $D9. HFC locked up the processor and cycled the address bus
The author of that article was Gerry Wheeler.

Gerry Wheeler, 54, died October 15, 2006, advanced non-Hodgkins
lymphoma cancer. Gerry made significant contributions to the technology
of the embedded systems world and was a key part of the development
of many household name products.

Programmer, Ham KG4NBB, author, father, husband, active commuity
participant Gerry will be missed by all.

w..


Similar Threads:

1.assembly in future C standard

Peter Nilsson < XXXX@XXXXX.COM > wrote:

(Crossposted to comp.std.c, with followups directed there, hopefully
 appropriately.  The original post discussed the possibility of whether
 __asm or something similar to it would be added to the C standard.)

> Contrary to Richard Heathfield's categorical statement, it is not an
> absolute given that there will never be an asm keyword in C. But it
> is unlikely because it's already clear that the asm keyword in C++ has
> not served to truly standardise the syntax of inline assembly.

One idea that was not mentioned in the original thread (I imagine for
good reason, because it's a half-baked and probably stupid idea that
occurred to me reading your post) would be to allow for some kind of
conditional assembly, just perhaps something like

#pragma assemble
#pragma X86 /* Inner pragma's implementation-defined */
  /* Inline assembly, which the implementation can ignore or not */
#pragma no-assemble
  /* Stock C code for implementations that can't or won't accept the
   * assemble pragma: */
  for( i=1; i < 10; i++ ) {
    foo();
    /* ... */
  }
#pragma end-assemble

The end result would be something like "If the implementation attempts
to inline the assembly code contained within a #pragma assemble
directive, the behavior is implementation-defined.  Otherwise the
assembly code shall be ignored and the C code contained within any
corresponding #pragma no-assemble directive shall be compiled as
though no directives were present."  It would require adding some
duties to the #pragma directive, but it would allow implementors to
take a reasonable shot at using targetted assembly instructions when
appropriate and available, and reverting to ordinary C otherwise.

I'm sure there are reasons why this is stupid and/or impossible, or it
would have been done already :-)

> At the end of the day, the committee could probably spend many man
> weeks deciding issues on an __asm keyword, but for what? Most
> implementations will keep their existing syntax, and most programmers
> who use inline assembly will no doubt continue to prefer the localised
> syntax because it's less cumbersome than any standard syntax.

Indeed, but it's an interesting thought experiment to consider how the
committee *might* add assembly to C if they chose to do so.  (Well,
interesting to me, at least.)

-- 
C. Benson Manica           | I *should* know what I'm talking about - if I
cbmanica(at)gmail.com      | don't, I need to know.  Flames welcome.



Return to c

 

Who is online

Users browsing this forum: No registered users and 91 guest