ack/mach/m68020/ce/mach.c

75 lines
1.3 KiB
C
Raw Normal View History

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>
#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;
{
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
#define FL_MSL_AT_LOW_ADDRESS 1
#define FL_MSW_AT_LOW_ADDRESS 1
#define FL_MSB_AT_LOW_ADDRESS 1
#include <con_float>
__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);
}