Niedziała INT1 w AT90s8515

Nov 02, 2004 22 Replies

A jakie miejsce masz na myśli? Pytam ponieważ ja w sam raz używam pól bitowych właśnie do definiowania struktur SFR-ów. :-)

Regards, /J.D.

Standard ISO C99, ustep 6.7.2.1:

"An implementation may allocate any addressable storage unit large enough to hold a bit-field. If enough space remains, a bit-field that immediately follows another bit-field in a structure shall be packed into adjacent bits of the same unit. The order of allocation of bit-fields with a unit (high-order to low-order or low-order to high-order) is implementation defined. The alignment of the addressable storage unit is unspecified."

No to korzystasz z niezdefiniowanego zachowania. :-) Standard nie gwarantuje Ci, ze bity zostana przydzielone polom w kolejnosci np. od najmniej znaczacego do najbardziej znaczacego. Taka rzecz musi byc jasno okreslona w dokumentacji kompilatora (jako rozszerzenie/doprecyzowanie standardu); w przeciwnym przypadku nie wolno na niej opierac wiary w poprawna konstrukcje programu. :-)

Pozdrawiam Piotr Wyderski

W sumie to nie tylko rejestry, ale wszystkie zmienne zadeklarowane jako volatile

pzdr. j.

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required