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
|
|
|
|
1988-10-31 15:42:15 +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) {
|
1988-10-31 15:42:15 +00:00
|
|
|
case SEGTXT :
|
|
|
|
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 :
|
|
|
|
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;
|
|
|
|
case SEGBSS : bss( 2);
|
|
|
|
return;
|
|
|
|
default : fprint( STDERR, "gen2() : bad seg number\n");
|
|
|
|
return;
|
|
|
|
}
|
1987-11-20 10:41:03 +00:00
|
|
|
}
|