From: michael young <mhyoung@valdosta.edu>
To: linux-assembly@vger.kernel.org
Subject: Re: DOS assembly questions?
Date: Tue, 21 Oct 2003 14:05:22 -0400 [thread overview]
Message-ID: <3F957562.7060302@valdosta.edu> (raw)
In-Reply-To: <3F9473D9.8010304@valdosta.edu>
Hello,
Thanks to everyone for responding.
I'm sorry for not giving enough info.
What I want to do is starting at 10 (or some number).
1. print the number.
2. dec the number.
3. loop back to step 1.
4. when number reaches 0 print "All done" (or something).
5 end program
my code for this is:
BITS 16
ORG 0x0100
SEGMENT .text
START:
mov cx, 10
call myloop
myloop:
mov dx, cx
mov ah, 9
int 21H
dec cx
jnz myloop
mov dx, donemsg
mov ah, 9
int 21H
mov ah, 4CH
int 21H
SEGMENT .data
donemsg db "All done!", 13, 10, "$"
########### end of program ################
the output should be:
10
9
8
7
6
5
4
3
2
1
All done!
Yall say I can't print the numbers that way.
And sure enough that does not work.
How would yall suggest I go about this?
Also, I does loop the correct number of times but,
it prints "All done!" after every iteration.
Can you tell me why that is?
Mr. Burt, don't worry about offending me.
Tell me what I need to hear.
A sharp knife cuts the quickest and hurts the least.
Mr. Hyde, wonderful site. What does IIRC mean?
Again, thank you to all of you for your responses and links.
Michael
BTW: i'm using nasm16 and I'm reading "Assembly Language Step-by-Step
2ed." by Jeff Duntemann.
I'm in DOS now but hope to move to LINUX assembly some day.
next prev parent reply other threads:[~2003-10-21 18:05 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-10-20 23:46 DOS assembly questions? michael young
2003-10-21 6:05 ` Fekete Gabor
2003-10-21 18:05 ` michael young [this message]
2003-10-22 6:07 ` willy meier
2003-10-23 17:00 ` michael young
2003-10-24 17:12 ` willy meier
2003-10-28 22:19 ` michael young
2003-10-24 5:22 ` FernanBolando
2003-10-28 22:11 ` michael young
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3F957562.7060302@valdosta.edu \
--to=mhyoung@valdosta.edu \
--cc=linux-assembly@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).