A89: Re: Re: quick question... opps, another one also... ( /label and e


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

A89: Re: Re: quick question... opps, another one also... ( /label and equ )




ill just answer both questions.

the /label notation is just a convention.  That way, in looking at code, one
can tell right away whether a symbol is a code segment, a data label, an
equate, a macro, etc.  /foobar is the notation for a code segment label.

as for the other question:

number dc.b 5

is an actual byte of memory being taken up in your program.  Basically you
are defining a variable in your program with an initial value of 5.  There
are other ways to do this, such as stack frames and such, but this way is
common and easy to do.  It does increase program size, however.  But it also
allows the program to contain static values that stay the same between
executions of the program.  Pros and Cons.


number equ 5

is actually just an assembler equate symbol.  Basically, everytime the
preprocessor sees the symbol 'number' in your program, it will replace it
with a '5'  This all occurs before the assembling actually takes place.  Its
sort of like a macro, but rather than make things shorter, it makes things
longer in some cases.  The reason it is used at all is simply for program
code legibility.  If you define an equate symbol with a descriptive name to
take the place of a cryptic 8 digit hex value or some such, your program
becomes much easier to read and understand, both for you while debugging,
and for others learning from your code.

--kaus


----- Original Message -----
From: "Alloy Gaming" <webmaster@alloygaming.com>
To: <assembly-89@lists.ticalc.org>
Sent: Thursday, April 20, 2000 7:45 PM
Subject: A89: Re: quick question... opps, another one also...


cant seem to find this one either, but seen it in some source codes...
what is the difference between doing these 2 things...

number    dc.b    5
number    equ    5

i guess what im asking, is what the hell does equ mean? and how is it
used/what for?
thanks for all your help :) after 3 dasy im learning alot more then i ever
thought i would...

Neticule
    -----Original Message-----
    From: Alloy Gaming <webmaster@alloygaming.com>
    To: assembly-89@lists.ticalc.org <assembly-89@lists.ticalc.org>
    Date: Thursday, April 20, 2000 4:26 PM
    Subject: A89: quick question...


    Hey, just a quick question. cant seem to find it in tutorials or
anything...
    but what is the use of putting a / before a label?
    such as

    /label:

    i see it alot in source code... just wondering

    Regards,
    Neticule





Follow-Ups: References: