1988-10-20 13:06:10 +00:00
|
|
|
#include <system.h>
|
1987-11-20 10:41:03 +00:00
|
|
|
#include "mach.h"
|
1988-10-20 13:06:10 +00:00
|
|
|
#include "back.h"
|
1989-01-26 13:32:57 +00:00
|
|
|
#undef text2
|
|
|
|
#undef con2
|
1988-10-31 15:42:15 +00:00
|
|
|
#ifdef BYTES_REVERSED
|
|
|
|
#define text2(w) { *text++ = ((w) >> 8); *text++ = (w);}
|
|
|
|
#define con2(w) { *data++ = ((w) >> 8); *data++ = (w);}
|
|
|
|
#else
|
|
|
|
#define text2(w) { *text++ = (w); *text++ = ((w)>>8);}
|
|
|
|
#define con2(w) { *data++ = (w); *data++ = ((w)>>8);}
|
|
|
|
#endif
|
1988-10-20 13:06:10 +00:00
|
|
|
|
1988-10-31 15:42:15 +00:00
|
|
|
gen4( l)
|
|
|
|
FOUR_BYTES l;
|
1987-11-20 10:41:03 +00:00
|
|
|
{
|
1988-10-20 13:06:10 +00:00
|
|
|
switch ( cur_seg) {
|
1988-10-31 15:42:15 +00:00
|
|
|
case SEGTXT :
|
1989-01-26 13:32:57 +00:00
|
|
|
if ((text_cnt -= 4) < 0) mem_text();
|
1988-10-31 15:42:15 +00:00
|
|
|
#ifdef WORDS_REVERSED
|
|
|
|
text2( (int) (l>>16));
|
|
|
|
text2( (int) l);
|
|
|
|
#else
|
|
|
|
text2( (int) l);
|
|
|
|
text2( (int) (l>>16));
|
|
|
|
#endif
|
|
|
|
return;
|
|
|
|
case SEGCON :
|
|
|
|
case SEGROM :
|
1989-01-26 13:32:57 +00:00
|
|
|
if ((data_cnt -= 4) < 0) mem_data();
|
1988-10-31 15:42:15 +00:00
|
|
|
#ifdef WORDS_REVERSED
|
|
|
|
con2( (int)(l>>16));
|
|
|
|
con2( (int) l);
|
|
|
|
#else
|
|
|
|
con2( (int) l);
|
|
|
|
con2( (int) (l>>16));
|
|
|
|
#endif
|
|
|
|
return;
|
1989-01-20 14:54:55 +00:00
|
|
|
case SEGBSS : bss( (arith) 4);
|
1988-10-20 13:06:10 +00:00
|
|
|
return;
|
|
|
|
default : fprint( STDERR, "gen4() : bad seg number\n");
|
|
|
|
return;
|
|
|
|
}
|
1987-11-20 10:41:03 +00:00
|
|
|
}
|