From mboxrd@z Thu Jan 1 00:00:00 1970 From: d_cary@my-deja.com To: help-gcc@gnu.org Subject: share constants between C and assembly ? Date: Wed, 05 Jan 2000 10:27:00 -0000 Message-id: <85016g$7ma$1@nnrp1.deja.com> X-SW-Source: 2000-01/msg00056.html I'm going through my include files one more time to make sure they are consistent. My assembly language files mention INCLUDE hardware_h.s while my C language files mention #include "hardware.h" As I compare these files to make sure that whenever I change PWM0 EQU 0xFFFF1000 in hardware_h.s, I remember to change #define PWM0 0xFFFF1000 in hardware.h to match. I keep thinking "There must be a Better Way". Couldn't I somehow define these things in one place that can be accessed by both C and assembly code ? I already pass the locations of variables and functions that I share between C and asm with EXPORT fast_fft IMPORT _main EXPORT atm_buffer IMPORT version_string and extern void fast_fft( float * time, float * frequency ); extern int atm_buffer[256]; extern const char version_string[] = "SpiffyProg " __DATE__ __TIME__; . It would be really cool if I could just reference C language definitions INCLUDE hardware.h in my assembly language file, or alternatively, reference assembly- language equates #include "hardware_h.s" in my C language file. Then everything would be defined in one place, self-consistent with itself, and I would save a lot of time manually consistency checking (and getting weird errors when I miss an inconsistency). Sent via Deja.com http://www.deja.com/ Before you buy. From mboxrd@z Thu Jan 1 00:00:00 1970 From: d_cary@my-deja.com To: help-gcc@gnu.org Subject: share constants between C and assembly ? Date: Sat, 01 Apr 2000 00:00:00 -0000 Message-ID: <85016g$7ma$1@nnrp1.deja.com> X-SW-Source: 2000-q1/msg00056.html Message-ID: <20000401000000.a6xEwGmVBby936qIFHWtmRBYRRY5V_DxMdbZLqWOoRo@z> I'm going through my include files one more time to make sure they are consistent. My assembly language files mention INCLUDE hardware_h.s while my C language files mention #include "hardware.h" As I compare these files to make sure that whenever I change PWM0 EQU 0xFFFF1000 in hardware_h.s, I remember to change #define PWM0 0xFFFF1000 in hardware.h to match. I keep thinking "There must be a Better Way". Couldn't I somehow define these things in one place that can be accessed by both C and assembly code ? I already pass the locations of variables and functions that I share between C and asm with EXPORT fast_fft IMPORT _main EXPORT atm_buffer IMPORT version_string and extern void fast_fft( float * time, float * frequency ); extern int atm_buffer[256]; extern const char version_string[] = "SpiffyProg " __DATE__ __TIME__; . It would be really cool if I could just reference C language definitions INCLUDE hardware.h in my assembly language file, or alternatively, reference assembly- language equates #include "hardware_h.s" in my C language file. Then everything would be defined in one place, self-consistent with itself, and I would save a lot of time manually consistency checking (and getting weird errors when I miss an inconsistency). Sent via Deja.com http://www.deja.com/ Before you buy.