Re: ///Wannabee Rants




//\\o//\\annabee <Free" wrote:

How could type-checking make any sense in asm?

mov edi D$esi + Objects.Current

What if Objects.Current is a byte, word, real64, or real80 object?
Indeed, what if it is anything other than a 32-bit object? Wouldn't it
be nice if the assembler actually *caught* this problem? The fact that
you've coerced it to 32 bits with the crazy RosAsm D$ syntax simply
means that you're missing the opportunity to catch errors in your code.
Even FASM can do better than that.


In this case I know that "Object.Current" is an equate, pointing at a
Paragraph object, or an object part of the "tree" that Paragraph object
belongs too.

But *you* could be mistaken. Or the code could change in the future. Or
you could simply be mistaken in what you think you now about the
object. Or it could be someone else who is not as intimately familiar
with this code as you are trying to make changes to it. Or...



It close to impossible for me to try to parse a list containing objects
not allready compatible, unless I make an error.

Duh! "...unless I make an error."
What do you think the purpose of type checking is all about? It's there
to help catch the errors you make.

So therefore, in the
event I could make a bug that cases ESI to point at some villain memory,
how could type-checking be of any use?

You don't seem to understand the purpose of type-checking. It has
nothing to do with what ESI is pointing at and everything to do with
the value (in EDI) that you intend to store at Object.Current. I would
have thought that someone with all the Delphi experience you claim to
have would understand this concept.


Suppose ESI was written by a bug, like this : "pop esi", how could RosAsm
detect that the correct type has present in the stack, at compiletime?

Actually, if it had data flow analysis (which no assembler I'm aware of
has), it *could* catch some of those errors. But again, you're not
talking about type checking here. Perhaps you should first learn what
the term "type checking" means before you go off talking about how it
doesn't belong in an assembler.




?

I do not understand this type-cheching thing, or why and how it could be
any advantage in asm.

Obviously you don't understand it. And that's why you don't understand
its advantages (in any language, not just assembly).



In addition, if i make a procedure :

Proc SaveObject:
Argument @BaseObject
mov edi D@BaseObject
BaseObject.vCall vSaveObject
EndP

And if I then called it like this:

push edi | call SaveObject

and edi was (because of a bug) containing a perverted pointer, maybe the
bug was done a lot earlier.

Again, you don't know what type checking is. And giving examples that
have nothing to do with type checking only further demonstrates your
ignorance.

Now suppose you have an HLA procedure declared thusly:

procedure someProc( aParameter:int32 );

and you call it thusly:

someProc( 1.5 );

Type checking *will* report an error that you've attempted to pass a
real value in an int32 parameter. *That's* an example of what type
checking can do for you.

Also (though this has little to do with typechecking), it's nice when
the assembler can report that you're passing an incorrect number of
parameters to a procedure.



How could RosAsm detect this ?

Ha!
Just get a better assembler.

Cheers,
Randy Hyde

.



Relevant Pages

  • Re: Can a C compiler compete with assembler ?
    ... you are not the normal assembler programmer. ... > cmp esi, edi ...
    (comp.lang.asm.x86)
  • Can a C compiler compete with assembler ?
    ... I have kept hearing that assembler programmers cannot compete with a C ... mov edi, ... lea esi, ... cmp esi, ...
    (comp.lang.asm.x86)
  • Re: US Military Dead during Iraq War
    ... The save of two characters reduces the readability. ... (but then I don't understand why the assembler doesn't know ... In the generated assembler code edi is use for the variable j ... and esi for the variable i. Does your assembler register allocation ...
    (alt.lang.asm)
  • Re: US Military Dead during Iraq War
    ... >>> an C programmer and the 10 assembler lines to an assembly ... mov edi, 'A' ... xor esi, esi ...
    (alt.lang.asm)
  • Re: ///Wannabee Rants
    ... mov edi D$esi + Objects.Current ... event I could make a bug that cases ESI to point at some villain memory, ... doesn't belong in an assembler. ...
    (alt.lang.asm)