This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
8086 backend and stack problem
- From: Erdem Guven <zuencap at yahoo dot com>
- To: gcc at gcc dot gnu dot org
- Date: Thu, 20 Jul 2006 03:31:12 -0700 (PDT)
- Subject: 8086 backend and stack problem
Hi,
I'm writing an 8086 backend.
Short info about backend:
Basicly I converted m32c backend for 8086.
For the moment, it can compile 16-32 bits integer &
16-32 bits pointer codes.
16 bits pointer codes can be assembled with as but for
32 bits I convert at&t assembly output to intel and
use nasm to compile.
Problem:
I'm using the backend in a project. I want to compile
some codes in 16 bits int mode and others in 32 bits
int. I figured out that gcc uses int sized blocks to
store arguments, passed to a function, in stack. I
mean if function get a short (16 bits) as a parameter
it pushes 4 bytes to stack in 32bits integer mode and
just 2 bytes in 16 bits mode. Is there an easy way to
force gcc to use another size?
Some defines in i86.h that I think may help for an
answer:
#define BITS_PER_UNIT 8
#define UNITS_PER_WORD 2
#define POINTER_SIZE (TARGET_PTR32 ? 32 : 16)
#define PARM_BOUNDARY 8
#define STACK_BOUNDARY 8
#define FUNCTION_BOUNDARY 8
#define BIGGEST_ALIGNMENT 8
#define STRICT_ALIGNMENT 0
#define SLOW_BYTE_ACCESS 1
#define INT_TYPE_SIZE (TARGET_INT32 ? 32 : 16)
#define SHORT_TYPE_SIZE 16
#define LONG_TYPE_SIZE 32
#define LONG_LONG_TYPE_SIZE 64
Thanks
Erdem Guven
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com