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 [thread overview]
Message-ID: <85016g$7ma$1@nnrp1.deja.com> (raw)
Message-ID: <20000401000000.a6xEwGmVBby936qIFHWtmRBYRRY5V_DxMdbZLqWOoRo@z> (raw)
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.
next reply other threads:[~2000-04-01 0:00 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-01-05 10:27 d_cary [this message]
2000-04-01 0:00 ` d_cary
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='85016g$7ma$1@nnrp1.deja.com' \
--to=d_cary@my-deja.com \
--cc=help-gcc@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).