Re: stricmp

From: Frank Kotler (fbkotler_at_comcast.net)
Date: 03/12/05


Date: Sat, 12 Mar 2005 07:32:17 -0500

Sevag Krikorian wrote:
>
> Frank Kotler wrote:
> > Evenbit wrote:
> >
> > ...
> >>Here is my current code for that procedure:
> >
> > Well, I can't get HLA to assemble this as-is - wants a
> > "DoOneValStmt"... Honestly, the more I try to use HLA, the
> > less I like it!
>
> HLA Linux has more bugs due to a smaller user base reporting
> them :)

Well, my dislike of HLA centers around syntax - the fact
that some of the Linux routines are buggy is merely an
"interesting project". My inability to assemble it "as-is"
was solved by getting my Pascal in order and putting "begin"
and "end" in the right places... (haven't got an actual
working file, but I can see what HLA is generating)

> >>procedure processFile( filename:string );
> >>
> >>var
> >>myBuff :dword;
> >>fOpen :dword;
> >>size :dword;
> >>curlocat :dword;
> >>prelocat :dword;
> >>
> >>begin processFile;
> >>
> >> if( filename = NULL ) then
> >>
> >> stdout.put( "processFile: NULL" nl );
> >>
> >> else
> >>
> >> stdout.put( "processFile: """, filename, """" nl );
> >> fileio.open( filename, fileio.rw );
> >> mov( eax, fOpen );
> >> fileio.position( fOpen );
> >> mov( eax, prelocat );
> >> mem.alloc((type dword 1024));
> >> mov( eax, myBuff );
> >> while( !fileio.eof( fOpen ) ) do
> >> fileio.read( fOpen, myBuff, 1024 );

...
> Humm, I thought I covered that when I mentioned fileio.read
> expects a pointer to byte. Sorry if I wasn't clear.

Well, yes and no... I wasn't certain whether we were going
to end up passing "offset myBuff" or "[myBuff]" (if you know
what I mean). Since "myBuff" is a "stack variable", it
doesn't really have an "offset", so I figured [contents] was
more likely, but nooo... [contents] of fOpen (the "handle"
or "file descriptor") get pushed as expected, but HLA
generates this code to attempt to "push offset myBuff"...

        push dword ptr [ebp-16] /* fOpen */
        push ebp
        add dword ptr [esp], -12
        pushd 0x400
        call STDIO_FREAD /* read */

To me, this seems "unexpected"! Is going through a register
the only way to generate the intended code? There must be
some way to get "push dword ptr [ebp - 12]" out of it!
(besides "#asm"!)... "[myBuff]" doesn't work... Cryptic,
this high level assembler!

> >>I guess I'll just
> >>suffer the consequences when Beth the quantom sourcerous causes that
> >>elephant to appear over my head. ;-)
> >
> > ... "sourceress", you mean :)
>
> Methinks somebody has been curling up with a Douglas Adams novel.

Why are there chunks of whale meat lying all about?

Best,
Frank