assembly in future C standard HCF Gerry Wheeler


    Sponsored Links


  • 1. Different data types when working with JPEG image buffers (beginner)
    Dear all, I guess this is a basic question with an easy answer but I am a beginner and I would much apreciate your feedbacks. Let's say I have a library with some functionality to perform some image processing on jpeg images. One of functions in the library is similar to this: myfunction_effect (&out_instance, &mysettings, I8 *buf_in, I32 size_in_buffer, I32 *progress_status); where I8 is char data type (1 byte), I32 is int data type (4 bytes), buf_in is the JPEG image buffer and size_in_buffer is the size of the JPEG buffer. Then I want to use this function in some other source code, let's call it mycode, but mycode uses something like this typedef struct { u16 *jpegImage; u32 jpegLength; } MY_JPEG_STRUCT; Where u16 is unsigned short (2 bytes) and u32 is unsigned int The problem is that the data types for the JPEG buffer pointer are different from myfunctions_effect() and mycode where this library will be used. Also, I cannot change the definition for MY_JPEG_STRUCT in mycode. Do you have any suggestion on what is the easiest way to solve this problem? (either at the library side (provided I have access to the library sources) or in mycode? I hope I have explained clearly enough. I would really apreciate your help. Thank you in advance. Regards, R.
  • 2. Mixing doubles and integers?
    In the below example a double is initialized with an integer. Afterwards another double is added: int mini = 0; double dd = 7; double a = mini; double res = a + dd; printf("res = %d\n", res); res equals 0, but why does it not equal 7?
  • 3. array[x][y] with dynamic elements struct as list
    How to write? I have write program in C language. This program contain 1 array[20][20] with struct. Every element of table must be dynamic list LIFO (stack). Adding and removing struct variable from list array[x][y]. My question: How to declare this table? How to begining, any ideas? struct list { int *type; struct list *next_elem; }element; Example: I add new element to array[20][1] next i adding next elemtent do array[20][[1] A remove first from array[20][1] - LIFO
  • 4. Lightweight RPC framework
    I am looking for a lightweight RPC framework for communicating between C and Java. Does anyone have experience of any good frameworks? Thanks Andrew
  • 5. portable typeof macro
    Hi, Is there an equivalent typeof macro/method to determine the type of a variable in runtime & most importantly that works well with most known C compilers? gcc compiler supports typeof() macro, but the same code is not getting compiled in solaris forte compiler and in microsoft VS 2003 compiler. I tried something like below: #include <stdio.h> int main() { int i; typeof(i) j = 10; i = j + 1; printf("%d,%d\n",i,j); return 0; } The above code is just a test to see if the compiler supports typeof macro/method. But only gcc supports it. I then tried __typeof__ which is described in ISO standards I hope (I'm not sure btw), but again supported by gcc and not by other compilers. How does this typeof macro work? Or is there any equivalent method/macro which is portable or that can be made portable to work with all well known compilers. Thanks in advance. Best Regards RKK

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.


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++ ) {
    /* ... */
#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)      | don't, I need to know.  Flames welcome.

Return to c


Who is online

Users browsing this forum: No registered users and 28 guest