>
> Suppose you want to produce a literate version of a program that uses
> both C code and assembler code (i.e. .S files), to be compiled with GCC
> under Linux. Can CWEB handle the .S files, both for cweave and ctangle?
> For example, ctangle might not observe formatting conventions that the
> assembler might insist on. Is that really a problem and, if so, how does
> one get around it with CWEB?
You can probably use the @= control code (along with @( to extract to a
file named with a .S extension), but it won't be pretty. You'll have to
enclose each assembly language statement in @=...@> with an @/ at the end
of each line to ensure that cweave puts each statement on a separate line.
For example,
@(foo.S@>=
@= MOV x,y @>@/
@= ADD y,z @>@/
@= JMP there @>
You'll also have to filter out the /*...*/ section comments and #line
directives inserted by ctangle in the resulting .S file(s).
-- Lee
------------------------------------------------------------------------
Lee Wittenberg <le...@samson.kean.edu> Department of Mathematics & Computer
Science Kean University, Union, NJ 07083
My Father's house hath many central processors. It matters not what a
man does with his life if his software is mine, sayeth the Lord.
-- Richard Condon, "The Vertical Smile" (1971)
------------------------------------------------------------------------