assembly in future C standard HCF Gerry Wheeler


    Sponsored Links


  • 1. Output of the printf(a,*a,**a) where a is of type int [][][]
    #include<stdio.h> int main() { int a[3][3][3]; printf("%d %d %d %d",a,*a,**a,&a); } I tried the above code and got the same value for a, *a , **a and &a. Can anyone please tell me the reason behind such a behavior?
  • 2. Problem with pointers, require some help
    Hello, I am getting some problems with C and how it handles the pointers. I will tell more about the situation: I have created my own structure for making one way linked list. I have procedure int createList(child *root) [child is that structure] and before that I create pointer child *rootA, and then I invoke createList(rootA) [*rootA holds the value, and rootA is the pointer, holds the address as I remember]. And this function creates dynamic list, but the problem is that rootA does not point to it. After creating list function returns the length of it. The question is, how should I send to function a pointer, create a list in heap and then make that pointer to point to it? It would be something like this: int main { int *item; func(*item); printf("%d", *item); return 0; } func(int *num) { num = malloc(sizeof(int)); *num = 8; printf("%d", *num); printf in func gives "8", but item still does not point to the same memory where that number is located. But I want it to point. How? }
  • 3. 4 BITS RLE IN BMP
    hi I need BI_RLE4 bit BMP image for testing. How can we create 4 bits RLE BMP image. Which tool can be used to create 4 bits RLE BMP image. If you know please tell me or give me reference . Regards:- -Gurjant Singh
  • 4. make content's of file in binary form to zero and convert them back
    On Tue, 05 Feb 2008 20:33:09 -0800, checoo wrote: > I am trying to change the content's of a file in binary form to zero and > then again change them back. > > Can anyone help me with this. Sure: 1) Make copy of file 2) Determine number of bytes to write 3) Write 0 bytes to original file 4) Copy duplicate file back to original file 5) Optionally remove duplicated file Sum total effect of operation: spin the disk a while. Assuming the file is on a disk.

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 98 guest