This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Is it possible to use the content of a file in binary format in C and assembly file? thanks
- From: "Qiang Huang" <jameshq at liverpool dot ac dot uk>
- To: "Ecos-Discuss" <ecos-discuss at sources dot redhat dot com>
- Date: Wed, 26 Feb 2003 14:55:15 -0000
- Subject: [ECOS] Is it possible to use the content of a file in binary format in C and assembly file? thanks
Hi all:
Is it possible to use the content of another file in pure binary format
in C file?(ARM target)
for example I have a data file as: data.dat
In the usefile.S assembly file I would like to import the content of
data.dat file in a section as:
datasection_start
// how to tell the assembler to import the content of data.dat (in
pure binary format)
datasection_end
// use the content in assembly code as:
ldr r0, =datasection_start
ldr r1, [r0]
... etc
and in C file how can I import a file and use the content of the file in
pure binary format? ( any directive can do this kind of job in GNUPro
tools?) can anybody give me some example code thanks a lot.
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss