From: Evenbit on
On Jul 19, 5:06 pm, Herbert Kleebauer <k...(a)unibwm.de> wrote:
>
> With this code, Windela shouldn't work properly when compiled
> with GCC on a SUN (but this was my first C program and you only
> learn by making errors).

Dang! You handed *this* in as your "Hello World" assignment?? I bet
all of your instructors HATED to have you as a student! ;)

Nathan.

From: Rod Pemberton on

"Frank Kotler" <fbkotler(a)verizon.net> wrote in message
news:EdHni.5682$bP4.2953(a)trndny01...
> I'll have more to say about Herbert's example. My usual M.O. is to
> disassemble his executable into Nasmese, and work from there. This gives
> *ugly* results. This example is so beautifully formatted and commented
> that it deserves better than that! A "hand translation" will be tedious,
> but I think it may be worth it. Not immediately. Herbert speaks a
> strange language, but he does beautiful work!
>
....

> Herbert speaks a
> strange language, but he does beautiful work!

Well, I've read that repetively from many, but I wouldn't know from anything
he's posted.

> With some recombinant surgery, and a sufficiently powerful jolt, lindela
> and ndisasm might be fused into a "converter"... doubt if it'd be worth
it.

I thought it might be easy to modify for NASM. I figured I could get the
instructions mostly correct on my own. And, IIRC, he showed someone the x86
to "HK asm" register mapping a while back. But, it appears that I'd have to
convert his C into modern C first... No plans to do so for the moment.


Rod Pemberton

From: //o//annabee on
P� Fri, 20 Jul 2007 05:14:21 +0200, skrev Evenbit <nbaker2328(a)charter.net>:

> On Jul 19, 6:59 am, Herbert Kleebauer <k...(a)unibwm.de> wrote:
>> santosh wrote:
>> > IIRC instructions are implemented only uptil the 486, and the compile
>> > crashed for me on Linux.
>>
>> gcc -O2 windela.c -o lindela
>>
>> crashed?????
>
>
> I got that to work and ./lindela runs but when I try to feed it an
> file from /EXAMPLE/LINUX it bombs with what I assume to be some German
> expletives.
>
> Is this thing PD, GPL, or what? Do you mind if I tuck it somewhere
> "safe" on the 'net so it'd be available long after your server "powers
> down" for the last time?

What an absurd level of utter inpoliteness Nathan!
First you think her assembler swear at you, as if the words
are written in german, and you dont understand them, then
they must be swearing at you right? then you
so to say want to copy her work in case she dies....

A _horrible_ display of manners!

> Nathan.



From: santosh on
On Friday 20 Jul 2007 5:41 am, Herbert Kleebauer <klee(a)unibwm.de>
wrote in message <469FFD9D.CAD53F13(a)unibwm.de>:

> santosh wrote:
>> On Friday 20 Jul 2007 2:36 am, Herbert Kleebauer <klee(a)unibwm.de>
>
>> > There is only one real warning:
>> >
>> >> windela.c:5611: warning: operation on ?j? may be undefined
>> >
>> > But this shouldn't be flaged as a warning but as an error.
>> >
>> > case 0x05: {la[--j] = la[j] / la[j+1]; break;}
>>
>> Why should this be an error? This exhibits undefined behaviour,
>> but that doesn't mean compilation should be stopped.
>
> I don't care whether the compilation stops or not. But if the
> behaviour of the generated code not only depends on the C source
> code but also on the concrete implementation of the compiler, then
> the source code is incorrect. And therefore an error and not a
> warning has to be generated.

That's what the Standard terms as Undefined behaviour, i.e. that the
outcome of that construct is not defined by the rules of the
Standard, and implementations are not required to define it either.
Such a construct could produce different results between operating
systems, between implementations, between compilations and even
between two invocations of the program. *Nothing* is guaranteed, and
the worst of it is that, once Undefined behaviour is invoked, the
rest of the behaviour of your program also becomes undefined,
(unless the construct that invoked undefined behaviour happened to
be the very last action of your program).

Conforming compilers are required to stop compilation only if an
active #error preprocessor directive is encountered. Anything else
*can* be successfully compiled, though a diagnostic is mandatory for
each constraint violation.

>> > With this code, Windela shouldn't work properly when compiled
>> > with GCC on a SUN (but this was my first C program and you only
>> > learn by making errors).
>>
>> Why only on the SUN? This code should invoke undefined behaviour
>> on all implementations, since 'j' is modified more than once
>> between sequence points.
>
> It doesn't invoke undefined behaviour but a compiler dependent
> behaviour.

AFAIK, it *does* invoke undefined behaviour, not implementation
defined behaviour.

> I didn't say "only on the SUN". I used a similar
> statement in a program to generate pdf files. It was ok when
> compiled with gcc in DOS and Linux but not when compiled with gcc
> on a SUN. Seems the DOS/Linux version of gcc first evaluates the
> left side and then the right side whereas the opposite is true for
> gcc on a SUN.


From: Herbert Kleebauer on
Evenbit wrote:
> On Jul 19, 6:59 am, Herbert Kleebauer <k...(a)unibwm.de> wrote:


> > crashed?????
>
> I got that to work and ./lindela runs but when I try to feed it an
> file from /EXAMPLE/LINUX it bombs with what I assume to be some German
> expletives.

I ignore warnings of a C compiler but not a crash of my programs.
Can you give me a little bit more information which source you used
and which error message you got.

> Is this thing PD, GPL, or what?

It's an ASCII string, much to short and ugly written to deserve any license.
All I wanted was a debugger/monitor program for DOS and because I only
found this awful Intel syntax assemblers I first had to write an
assembler to be able to write the debugger/disassembler. So there was no
time to make a well designed program, it's only a quick hack written
on an Atari ST (that's the reason why you still have to enter the
source file name after you start the program because the Atari ST didn't
have a command line interface where you could enter parameters. But
in DOS/Windows you can use a batch to start it: echo %1|windela ).

> Do you mind if I tuck it somewhere

I don't think it's of interest for anyone, but you can do with it what ever
you like.

> "safe" on the 'net so it'd be available long after your server "powers
> down" for the last time?

Hey, "mistress" is up and online now for 13 years (maybe one of the
oldest, still running Linux installations) and I hope she will do it
a few more years.
First  |  Prev  |  Next  |  Last
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
Prev: masm linking from console
Next: NASM HelloWorld - DOS