Need help interfacing Gnu "as" to fpc (very specific)
- From: Anthony <anthonyh63@xxxxxxxxxxx>
- Date: Wed, 01 Mar 2006 05:09:07 -0500
The question I have now is a little complicated.
I may not even have to write the code I'm thinking about
to accomplish my goal. (i.e there may be another way)
1. I would like the ability to link an arbitrary binary
file into an executable as a data object i.e. Variable or Constant.
(final result: a cgi app that contains its own small icons either
gif/png or jpeg
would even work with flash or sound though large files would be
impractical)
(Under Turbo I could do this with bin2obj)
2. Under windows I can probably use resource files but the syntax is
a little to complex for my tastes. I would like to employ the same
approach under windows and linux if possible (the pascal web unit
is cross platform from the start)
3. I used to do some work in MASM years ago. For a couple of
days I have been looking at AT&T syntax for the Gnu assembler
and looking at the .s output of a couple of fpc compiles.
4. PLAN
1. write pascal program bin2o_gnu
// possibly exists already ??
that
a. parses an arbitrary binary file into a series of
.byte statements in an assembler file
(with the appropriate header information first)
// I don't need help here I am sufficiently
skilled to do this. The header is the problem
b. passes this information to Gnu "as" to create .o
file
(write out text file for development so I can
inspect .s headers and change them if
necessary until it works, uses shell() to
call 'as' when fully working use
Assignstream or POpen
and pipe it the code.)
c. Since the thrust of this is for a development
library Next step is to auto generate a
Pascal unit .pp/.pas file
That supplies a public pointer to the linked in
buffer.
// Once I get the asm done
// this will probably be simple.
(In the spirit of free software the generated unit will also
have the procedure Recreate_Original_File)
5. ACTUAL QUESTION:
I'm a little confused about the .global directives and naming
conventions I need to use under the assembler to make the
buffer visible in fpc. The prepending and casing is
confusing me somewhat. Also though I am familiar
with the pascal syntax for external procedures I'm not sure
if the 'external' keyword works for variables.
I would really like 3 public identifiers in the asm/ .s file
The size of the original binary : LongWord
The original filename (no path) : string; (Pchar ???)
The buffer itself.
Any help here would be appreciated. The problem right now
is to much information. I have no desire to become a Gnu
"as" expert but I'm starting to feel that way after wading
through the huge amounts of info Google is feeding me,
without finding the specifics I need.
Thank You,
Tony
.
- Follow-Ups:
- Re: Need help interfacing Gnu "as" to fpc (very specific)
- From: Jonas Maebe
- Re: Need help interfacing Gnu "as" to fpc (very specific)
- Prev by Date: Re: UCSD Pascal I.4. and I.5 sources available
- Next by Date: Re: Need help interfacing Gnu "as" to fpc (very specific)
- Previous by thread: Re: UCSD Pascal I.4. and I.5 sources available
- Next by thread: Re: Need help interfacing Gnu "as" to fpc (very specific)
- Index(es):
Relevant Pages
|