1989-01-27 12:41:43 +00:00
|
|
|
#define CODE_EXPANDER
|
1988-08-18 14:33:57 +00:00
|
|
|
#include "mach.h"
|
|
|
|
#include <back.h>
|
1988-11-10 13:46:53 +00:00
|
|
|
#include <system.h>
|
1988-08-18 14:33:57 +00:00
|
|
|
|
|
|
|
|
1989-02-02 12:49:21 +00:00
|
|
|
#ifdef DEBUG
|
1988-08-18 14:33:57 +00:00
|
|
|
arg_error( s, arg)
|
|
|
|
char *s;
|
|
|
|
int arg;
|
|
|
|
{
|
1988-11-10 13:46:53 +00:00
|
|
|
fprint( STDERR, "arg_error %s %d\n", s, arg);
|
1988-08-18 14:33:57 +00:00
|
|
|
}
|
1989-02-02 12:49:21 +00:00
|
|
|
#endif
|
1988-08-18 14:33:57 +00:00
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
do_open( filename)
|
|
|
|
char *filename;
|
|
|
|
{
|
|
|
|
if ( filename == (char *)0 || !sys_open( filename, OP_WRITE, &codefile))
|
|
|
|
return( 0);
|
|
|
|
|
|
|
|
fprint( codefile, ".sect .text; .sect .rom; .sect .data; .sect .bss\n");
|
|
|
|
return( 1);
|
|
|
|
}
|
|
|
|
*/
|
1988-09-14 14:06:31 +00:00
|
|
|
|
1989-10-24 15:08:27 +00:00
|
|
|
#define IEEEFLOAT
|
1989-10-26 11:04:53 +00:00
|
|
|
#define FL_MSL_AT_LOW_ADDRESS 1
|
|
|
|
#define FL_MSW_AT_LOW_ADDRESS 1
|
|
|
|
#define FL_MSB_AT_LOW_ADDRESS 1
|
1989-11-01 10:57:04 +00:00
|
|
|
#include <con_float>
|
1991-01-22 12:01:25 +00:00
|
|
|
|
|
|
|
__instr_code(code, reg, off)
|
|
|
|
{
|
|
|
|
if (off <= 32767 & off >= -32768) {
|
|
|
|
text2(code|0x28|reg);
|
|
|
|
text2(off);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
text2(code|0x30|reg);
|
|
|
|
text2(0x0170);
|
|
|
|
text4(off);
|
|
|
|
}
|
|
|
|
|
|
|
|
__move_X(code, reg, off)
|
|
|
|
{
|
|
|
|
if (off <= 32767 & off >= -32768) {
|
|
|
|
text2(code|(reg<<9)|0x140);
|
|
|
|
text2(off);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
text2(code|(reg<<9)|0x180);
|
|
|
|
text2(0x0170);
|
|
|
|
text4(off);
|
|
|
|
}
|
|
|
|
|
|
|
|
__moveXX(code, srcreg, srcoff, dstreg, dstoff)
|
|
|
|
{
|
|
|
|
if (srcoff <= 32767 && srcoff >= -32768) {
|
|
|
|
__move_X(code|0x28|srcreg, dstreg, dstoff);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (dstoff <= 32767 && dstoff >= -32768) {
|
|
|
|
__instr_code(code|0x140|(dstreg<<9), srcreg, srcoff);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
text2(code|(dstreg<<9)|srcreg|0x180|0x30);
|
|
|
|
text2(0x0170);
|
|
|
|
text4(srcoff);
|
|
|
|
text2(0x0170);
|
|
|
|
text4(dstoff);
|
|
|
|
}
|