Re: A86: Problems compiling


[Prev][Next][Index][Thread]

Re: A86: Problems compiling




As far as the assembler goes, it's hard to point a finger there because what 
it does is relatively simple. However, some assemblers won't be very specific 
as to the nature of the problem, and therefore a line of code that looks 
perfect may be flawed. For example, when I was starting out, I didn't realize 
that "ld hl,de" wasn't a legal command.

> btw this happens with high and lowlevel languages, even in visual basic

> sometimes it wouldnt get this right (if x=-1 then.. and i would have to

> resort to if x+1=0)

This is usually a result of the variable in question being misdefined or 
undefined. Visual Basic, I think, defines "false" as 0 and "true" as nonzero 
(usually -1), and there can sometimes be some confusion if a variable is left 
as a variant rather than specified as a boolean, integer, etc. Regardless of 
how the variable is defined (dimensioned, actually), the example you gave -- 
"x+1=0" -- forces the conditional statement to be evaluated as a numerical 
expression. A more efficient way of writing if-then statements like this is 
to put them in the form of "If x Then" or "If Not x Then".

-- Jonathan Marcus
Appelkore@aol.com



Follow-Ups: