flat assembler
Message board for the users of flat assembler.

Index > DOS > Question about ret.

Author
Thread Post new topic Reply to topic
2



Joined: 26 Sep 2006
Posts: 92
2 18 Dec 2006, 02:57
I assembled this DOS program.

Code:
org $100                 ;start at RAM 100
mov ah,2                 ;putchar call number
mov dl,$32               ;ASCII code of character to write
int $21                  ;run call set by ah
ret
    


And it seemed to terminate the program using ret just as well as int $20.
Is it good practice to do this? It worked fine under NTVDM and DOSBOX.

It's also 1 byte smaller when I use ret instead of int $20.

_________________
There are 10 kinds of people in the world.
Those who know binary and those who haven't met me.
Post 18 Dec 2006, 02:57
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8359
Location: Kraków, Poland
Tomasz Grysztar 18 Dec 2006, 09:42
Post 18 Dec 2006, 09:42
View user's profile Send private message Visit poster's website 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-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.