On 7/7/2022 8:54 PM, dmccunney wrote:
On Thu, Jul 7, 2022 at 8:30 PM Daniel <codehunte...@gmail.com> wrote:
I am unfamiliar woththe C languages, but does it also allow one to mix both
assembly in with the C source code? Are there any other languages that allows
mixing of assembly in with the language code?
Not in the manner you are thinking of.
<snip>
A key point here was that programs were modular. There would be more
than one C source file making up the completed program, so there
wasn't really a need for inline assembler. If performance wasn't what
was hoped for, you profiled the C code to see where the problems were,
and rewrote the offending C code, or coded it in assembler as needed.
Pretty much all actual C compilers I have worked with in the last 40
years supported at least to some degree inline assembler to be used. The
ways how to do that were however always implementation dependent and
there never was some kind of standard on how to do that...
High level language development on DOS in BASIC or Pascal tended to be
in one big file, so being able to have Assembler inline was a boon.
Also not correct, by a long shot. First of all, BASIC was in most cases
an interpreter, so yes, there was most of the time just "one big file",
if you disregard things like CHAIN in most MS BASIC derivatives. Pretty
much all BASIC compilers (at least on a "real" OS) allowed for separate
development, compilation and then linking for those separate modules.
The same goes for old style DOS compilers like FORTRAN or COBOL.
For Pascal, this is +95% wrong. The first widespread version of Pascal,
UCSD Pascal, also sold for example under names like "Apple Pascal" (on
Apple II/III) did introduce the concept of "units", which allowed not
only for modular development, but also for code reuse, as well as basic
data and code encapsulation, which are all part of the core
functionality of object oriented programming (before that term and its
use was totally perverted to today's levels). That was also introduced
starting with Turbo Pascal 4.0 and is a staple of later Turbo/Borland
Pascal versions as well Object Pascal implementations like Delphi and
FreePascal.
The exception was kind of only the very early versions of Turbo Pascal
(up to 3.0), which by the overall design of the compiler used "one big
file" (though you could "include" many different source files). A lot of
pther compilers, like Digital Research Pascal MT+ 86 or Microsoft Pascal
allowed for development, compilation and linking of separate modules. As
far as the various Microsoft compilers of the DOS days are concerned,
,while observing a handful of rules, it was even possible to link for
example FORTRAN, C, Pascal and assembler modules together to one program
executable. Beside that a lot of compilers allowed for modular
development and use of such modules via the use of overlays.
Ralf
_______________________________________________
Freedos-user mailing list
Freedos-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-user