ack/util/ceg/ce_back/obj_back/gen2.c

36 lines
628 B
C
Raw Normal View History

1988-10-20 13:06:10 +00:00
#include <system.h>
1987-11-20 10:41:03 +00:00
#include "mach.h"
#include "back.h"
1988-10-20 13:06:10 +00:00
gen2( w)
TWO_BYTES w;
1987-11-20 10:41:03 +00:00
{
1988-10-20 13:06:10 +00:00
switch ( cur_seg) {
case SEGTXT :
1989-01-26 13:32:57 +00:00
if ((text_cnt -= 2) < 0) mem_text();
#ifdef BYTES_REVERSED
*text++ = w>>8;
*text++ = w;
#else
*text++ = w;
*text++ = w>>8;
#endif
return;
case SEGCON :
case SEGROM :
1989-01-26 13:32:57 +00:00
if ((data_cnt -= 2) < 0) mem_data();
#ifdef BYTES_REVERSED
*data++ = w>>8;
*data++ = w;
#else
*data++ = w;
*data++ = w>>8;
#endif
1988-10-20 13:06:10 +00:00
return;
1989-01-20 14:54:55 +00:00
case SEGBSS : bss( (arith) 2);
1988-10-20 13:06:10 +00:00
return;
default : fprint( STDERR, "gen2() : bad seg number\n");
return;
}
1987-11-20 10:41:03 +00:00
}