GCC vs ASM code size - Help me close the gap

Go To Last Post
104 posts / 0 new

Pages

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

El Tangas,

 

Thanks or the suggestion.  I can live with the push pop.  I was grumbling about it, but it was not the actual question I asked.  That was a derailment and its my own fault as I should learn to ignore posts of negative usefulness.

 

The original question was if there is a more elegant way to get the compiler to access two sequential elements of an array with compile time maths (adding to the displacement).

 

I worked out a kludgy way but I would like to know if there is a better way.  This is about self improvement and me trying to make myself a better C programmer.

 

Sprinter, Sparrow, Skeeve, Joey, Westf and several others have been very helpful in the past.  As I have learnt more things from them I have had to resort to ASM less often in the games/projects I am doing.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Ok, I see the problem. I don't think I have a better solution, maybe I would just write it differently:

 

typedef struct {
    GradLineStruct last_line;
    GradLineStruct next_line;
} GradLineStructX2;
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Logical pairs of 1-byte variables can be placed in a struct without too much kludginess.

With macros and gcc's ({...}) mechanism

one could define a syntax without too much user pain.

"Demons after money.
Whatever happened to the still beating heart of a virgin?
No one has any standards anymore." -- Giles

Pages