flat assembler
Message board for the users of flat assembler.

Index > Main > End block

Author
Thread Post new topic Reply to topic
Joey



Joined: 02 Jul 2004
Posts: 4
Location: England, UK
Joey
I have just started learning assembler today and i have a problem.

when i define a label do i have to initialize a block statement? or do i have to atleast close off a label that houses multiple commands?

i have:

Code:
Same:
     mov ax, 9
     mov dl, str_same
     int 21h
    


but this comes up with an error on the int 21h and in object-pascal i get this error when i forget to close off the block :S

could n e one please help??

thanks a bunch ^__^ Very Happy

_________________
Joey ^__^
Post 02 Jul 2004, 01:25
View user's profile Send private message MSN Messenger Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3502
Location: Bulgaria
JohnFound
Joey wrote:
when i define a label do i have to initialize a block statement?


No, you don't have to close block statements. Actually there are block statements only in preprocessor directives, such as "if - end if". In assembler itself, there is no block statements at all.

Your code looks ok for me. The only problem can be "str_same" label that you didn't define in the code posted above.

Regards.
Post 02 Jul 2004, 04:42
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
btw, label were too in pascal (at least in turbo/borland), declared with "label" statement at variables definition place, and defined with name followed by ":", like

procedure a;
label x
begin
if something>0 goto x
write('a');
x:
write('b');
end;

Only difference is that in assembly you don't have to declare labels (like listing all labels with "label" statement in pascal), you only have to define them (name followed by colon).
Post 02 Jul 2004, 19:56
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on YouTube, Twitter.

Website powered by rwasa.