Re: ///Wannabee Rants
- From: "rhyde@xxxxxxxxxx" <rhyde@xxxxxxxxxx>
- Date: 8 Jan 2007 18:53:50 -0800
//\\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
.
- Follow-Ups:
- Re: ///Wannabee Rants
- From: //\\\\o//\\\\annabee <Free\"
- Re: ///Wannabee Rants
- References:
- Re: C# programmer wants to learn assembly?? plz help
- From: Frank Kotler
- Download counts of assemblers.
- From: rhyde@xxxxxxxxxx
- Re: Download counts of assemblers.
- From: Herbert Kleebauer
- Re: Download counts of assemblers.
- From: rhyde@xxxxxxxxxx
- Re: Download counts of assemblers.
- From: David Jones
- Re: Download counts of assemblers.
- From: //\\\\\\\\o//\\\\\\\\annabee <Free\"
- Re: Download counts of assemblers.
- From: Frank Kotler
- Re: Download counts of assemblers.
- From: //\\\\\\\\o//\\\\\\\\annabee <Free\"
- ///Wannabee Rants
- From: rhyde@xxxxxxxxxx
- Re: ///Wannabee Rants
- From: //\\\\\\\\o//\\\\\\\\annabee <Free\"
- Re: ///Wannabee Rants
- From: Frank Kotler
- Re: ///Wannabee Rants
- From: //\\\\\\\\o//\\\\\\\\annabee <Free\"
- Re: ///Wannabee Rants
- From: sevag.krikorian@xxxxxxxxx
- Re: ///Wannabee Rants
- From: sevag.krikorian@xxxxxxxxx
- Re: ///Wannabee Rants
- From: //\\\\o//\\\\annabee <Free\"
- Re: ///Wannabee Rants
- From: sevag.krikorian@xxxxxxxxx
- Re: ///Wannabee Rants
- From: //\\\\o//\\\\annabee <Free\"
- Re: ///Wannabee Rants
- From: sevag.krikorian@xxxxxxxxx
- Re: ///Wannabee Rants
- From: //\\\\o//\\\\annabee <Free\"
- Re: C# programmer wants to learn assembly?? plz help
- Prev by Date: Re: An HLA question...
- Next by Date: Re: An HLA question...
- Previous by thread: Re: ///Wannabee Rants
- Next by thread: Re: ///Wannabee Rants
- Index(es):
Relevant Pages
|