Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Portability, C vs Assembler.

8 views
Skip to first unread message

Tore Lund

unread,
Jan 27, 1997, 3:00:00 AM1/27/97
to

Tenie Remmel wrote:
>
> And finally, I would pay up to $2000 for a truely portable assembler.
> Where can I get one? :)

I believe Scott Nudds has this thing called PASM...

Tore
--
Tore Lund <tl...@sn.no>


Kaz Kylheku

unread,
Jan 27, 1997, 3:00:00 AM1/27/97
to

In article <32ECD0...@mail.idt.net>,
Tenie Remmel <tj...@mail.idt.net> wrote:
>Let's get this straight.
>
>1. The C language makes it *possible* to write portable programs.
>
>2. Most C compilers provide extensions to the C language. These
>extensions are not portable, but it is still C, it's just not ANSI C.
>
>3. If you write a program entirely in ANSI C, it will be automatically
>portable to any platform which has an ANSI C compiler. This is just
>about everything, from Alpha to Z80.

This is not necessarily true, strictly speaking. Portability is never
automatic, but requires intent and effort. The standard actually defines
several levels of conformity which correspond to various levels of portability.
The highest level is that of strict conformance, which translates to maximal
portability. A strictly conforming program uses only the features defined by
the standard, is acceptable to any conforming C implementation, and avoids all
implementation defined behaviors. It must not surpass any of the implementation
limits.

You could write a program in conforming ANSI C that will definitely not port to
a conforming implementation on a Z80 simply because it declares objects that
won't fit into the Z80 address space. That would be an instance of exceeding
the minimum limits. You can also write a conforming program (not _strictly_
conforming) which depends on some implementation-defined behavior which will
work on one processor but produce different results on another.

The guidelines for producing a strictly conforming C program are quite clear.
It _is_ possible to write a non-trivial C program which will do the same thing
on everything from a Z80 to an Alpha, but your chances of success are greater
if you know right from the start that the program is to be maximally portable.

Asbjørn

unread,
Jan 28, 1997, 3:00:00 AM1/28/97
to

And to be able to be portable, it would be just like C, perhaps with a diffrent look. (Just think about it, SN)

- Asbjørn

Ben Sauvin

unread,
Jan 28, 1997, 3:00:00 AM1/28/97
to

Tore Lund wrote:
>
> Tenie Remmel wrote:
> >
> > And finally, I would pay up to $2000 for a truely portable assembler.
> > Where can I get one? :)
>
> I believe Scott Nudds has this thing called PASM...
>
> Tore
> --
> Tore Lund <tl...@sn.no>

Got any bridges to sell?

--


Benoit A Sauvin
Anti-junk/spam device: underscore.

"It should be clear however, that with a sufficiently
complex preprocessor, it is entirely possible to exactly
emulate any compiled language. Compilers are exactly this
kind of preprocessor." - Scott Nudds

Asbjørn

unread,
Jan 28, 1997, 3:00:00 AM1/28/97
to

Tenie Remmel wrote:
>
> And there is no C conspiracy, either. The reason people write programs
> in C is because it is faster to write them in C:
>
> 1. An expert C programmer can write 100 lines of code a day.
>
> 2. An expert assembler programmer can write 100 lines of code a day.

Hmm.. I've written 1500 lines in about four days. But, that was pascal (and just for a school project), so I
guess that doesn't count.

> 3. Each line of C compiles to about 10-20 bytes of machine code.
>
> 4. Each line of assembler compiles to about 1-2 bytes of machine code.

Erhm.. That strongly depends, but I think it's more like 3-4 (not that it really matters that much)

- Asbjørn

Kaz Kylheku

unread,
Jan 28, 1997, 3:00:00 AM1/28/97
to

In article <32EDC9...@sn.no>, Asbjørn <bh...@sn.no> wrote:
>Tore Lund wrote:
>>
>> Tenie Remmel wrote:
>> >
>> > And finally, I would pay up to $2000 for a truely portable assembler.
>> > Where can I get one? :)
>>
>> I believe Scott Nudds has this thing called PASM...

Scott's Portable Assembler: SPASM.

Tudor

unread,
Jan 28, 1997, 3:00:00 AM1/28/97
to Asbjørn

Asbjørn wrote:
>
> Tore Lund wrote:
> >
> > Tenie Remmel wrote:
> > >
> > > And finally, I would pay up to $2000 for a truely portable assembler.
> > > Where can I get one? :)
> >
> > I believe Scott Nudds has this thing called PASM...
> >
> > Tore
> > --
> > Tore Lund <tl...@sn.no>
>
> And to be able to be portable, it would be just like C, perhaps with a diffrent look. (Just think about it, SN)
Well if I think about it that's EXACTELY why C was created in the first
place.
Unfortunately I'm not SN...
--
tudor 'at' cam 'dot' org
'This is Scott Nudds of the Borg. C is irrelevant.'

Craig Franck

unread,
Jan 29, 1997, 3:00:00 AM1/29/97
to

k...@vision.crest.nt.com (Kaz Kylheku) wrote:

>In article <32EDC9...@sn.no>, Asbjørn <bh...@sn.no> wrote:
>>Tore Lund wrote:
>>>
>>> Tenie Remmel wrote:
>>> >
>>> > And finally, I would pay up to $2000 for a truely portable assembler.
>>> > Where can I get one? :)
>>>
>>> I believe Scott Nudds has this thing called PASM...
>
>Scott's Portable Assembler: SPASM.

It is truely portable, because it is defined as running on a "virtual
microprocessor" known as Scott's Portable Assmebler Microprocessor".
You see, Scott's PASM runs on SPAM.

--
Craig
clfr...@worldnet.att.net
Manchester, NH
Some languages are designed to solve a problem; others
are designed to prove a point. -- Dennis M. Ritchie

Scott Nudds

unread,
Feb 3, 1997, 3:00:00 AM2/3/97
to

Asbjørn <bh...@sn.no> wrote:
: And to be able to be portable, it would be just like C, perhaps with a

: diffrent look. (Just think about it, SN)

Why not just like basic or just like fortran, or just like Pascal?

The statement "just like C" excluding all the other languages formats
is proof that your eyes are closed to alternatives that you are
unfamiliar with.

This is not a good thing.

--
<---->


Scott Nudds

unread,
Feb 3, 1997, 3:00:00 AM2/3/97
to

Tenie Remmel <tj...@mail.idt.net> wrote:
: Let's get this straight.
: 1. The C language makes it *possible* to write portable programs.

It is possible to write portable command line driven toys in C or any
other language.


: 2. Most C compilers provide extensions to the C language. These


: extensions are not portable, but it is still C, it's just not ANSI C.

C pushers continue to insist that programs that use such features are
not written in C, but rather some "bastard" language.


: 3. If you write a program entirely in ANSI C, it will be automatically


: portable to any platform which has an ANSI C compiler. This is just
: about everything, from Alpha to Z80.

Unfortunately no useful programs can be practically written in ANSI C.


: 4. Most C programs are not written entirely in ANSI C, as the extensions
: that most compilers provide are very useful. But only about 10% to 20%
: of the code uses the extensions directly.

Hence they are not written in ANSI C. Hence they are not portable.
Hence the claim of C portability is a myth and a scam.


: 5. Assembly languages are almost completely different on different
: processors.

Currently this is true, but it need not be true.


: 6. It is not possible to write a program in assembly language that is
: portable between systems without a LOT of very specific machine code
: knowlegde, and even then it's just two programs rolled into one.

Incorrect, there are a number of portable assemblers that allow
exactly this.


: 7. Assembly language programs can be ported, but only by changing at
: least 90% of the code, usually 99-100%.

An assembly language program written in portable assembler need only
be reassembled for the new target platform, just as a C program only
need be recompiled.


: Most C programs are about 80-90% portable.

Then most C programs are not portable. I have long stated that 90% of
the C programs I have on file will not compile. Your estimate confirms
my observation.


: And there is no C conspiracy, either. The reason people write programs


: in C is because it is faster to write them in C:

It is faster to write slop in C than assembler.


: 1. An expert C programmer can write 100 lines of code a day.

Alicia Carla Longstreet claims to write 900 lines of C code per day in
her spare time. She has a problem with the truth.


: 2. An expert assembler programmer can write 100 lines of code a day.

Easily.


: 3. Each line of C compiles to about 10-20 bytes of machine code.

Most of which is slop.


: 4. Each line of assembler compiles to about 1-2 bytes of machine code.

Nope. The average would probably be 4 bytes for most modern CPU's.


: 5. Assembly language programs compile to about 2-5 times smaller than
: equivalent C programs.

This is true.

: Therefore, assembly language programs have between 1 and 10 times as
: many lines as C programs, and so they take longer to develop.

Unless the syntax is augmented. Terse provides such augmentation.


: And finally, I would pay up to $2000 for a truly portable assembler.


: Where can I get one? :)

This question has been answered multiple times. http://www.tao.co.uk/

Have your check book ready.

--
<---->


0 new messages