| 10 |
|
|
| 11 |
int DopiszBajt (unsigned char bajt) |
int DopiszBajt (unsigned char bajt) |
| 12 |
{ |
{ |
| 13 |
|
DaneAlign(&wyrownanieAdresow); |
| 14 |
|
|
| 15 |
if (fprintf(plikWynikowyDanych, "%c", bajt) <= 0) |
if (fprintf(plikWynikowyDanych, "%c", bajt) <= 0) |
| 16 |
{ |
{ |
| 17 |
yyerror(E_IODATA); |
yyerror(E_IODATA); |
| 23 |
|
|
| 24 |
int DopiszHalf (unsigned short half) |
int DopiszHalf (unsigned short half) |
| 25 |
{ |
{ |
| 26 |
// if (wyrownanieAdresow && wyrownanieAdresow < HALF_ALIGN) |
DaneAlign(&wyrownanieAdresow); |
|
// DaneAlign(HALF_ALIGN); |
|
| 27 |
|
|
| 28 |
if (fprintf(plikWynikowyDanych, "%c%c", WORD_2B(half), WORD_1B(half)) <= 0) |
if (fprintf(plikWynikowyDanych, "%c%c", WORD_2B(half), WORD_1B(half)) <= 0) |
| 29 |
{ |
{ |
| 38 |
{ |
{ |
| 39 |
int wynik; |
int wynik; |
| 40 |
|
|
| 41 |
// DaneAlign(WORD_ALIGN); |
DaneAlign(&wyrownanieAdresow); |
| 42 |
|
|
| 43 |
wynik = fprintf(plikWynikowyDanych, "%c%c%c%c", |
wynik = fprintf(plikWynikowyDanych, "%c%c%c%c", |
| 44 |
WORD_4B(slowo), WORD_3B(slowo), |
WORD_4B(slowo), WORD_3B(slowo), |
| 54 |
|
|
| 55 |
int DopiszAscii(char *ciag, int ile) |
int DopiszAscii(char *ciag, int ile) |
| 56 |
{ |
{ |
| 57 |
|
DaneAlign(&wyrownanieAdresow); |
| 58 |
|
|
| 59 |
if (fwrite(ciag, ile, 1, plikWynikowyDanych) <= 0) |
if (fwrite(ciag, ile, 1, plikWynikowyDanych) <= 0) |
| 60 |
{ |
{ |
| 61 |
yyerror(E_IODATA); |
yyerror(E_IODATA); |
| 65 |
return(0); |
return(0); |
| 66 |
} |
} |
| 67 |
|
|
| 68 |
int DaneAlign (int ile) |
int DaneAlign (int *ile) |
| 69 |
{ |
{ |
| 70 |
int i, j; |
int i, j; |
| 71 |
|
|
| 72 |
if (ile && (daneOffset % ile)) |
if (*ile && (daneOffset % *ile)) |
| 73 |
{ |
{ |
| 74 |
j = ile - (daneOffset % ile); |
j = *ile - (daneOffset % *ile); |
| 75 |
|
|
| 76 |
|
//wyrównujemy tylko raz |
| 77 |
|
*ile = 0; |
| 78 |
|
|
| 79 |
for (i = 0; i < j; i++) |
for (i = 0; i < j; i++) |
| 80 |
if (DopiszBajt(0)) |
if (DopiszBajt(0)) |
| 81 |
return(1); |
return(1); |
| 82 |
} |
} |
| 83 |
|
else |
| 84 |
|
*ile = 0; |
| 85 |
|
|
| 86 |
return(0); |
return(0); |
| 87 |
} |
} |