linux-assembly.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: michael young <mhyoung@valdosta.edu>
To: willy meier <wklux@yahoo.co.uk>
Cc: linux-assembly@vger.kernel.org, linux-assembly@mlists.in-berlin.de
Subject: Re: DOS assembly questions?
Date: Tue, 28 Oct 2003 17:19:20 -0500	[thread overview]
Message-ID: <3F9EEB68.9040309@valdosta.edu> (raw)
In-Reply-To: <3F995D8C.5BF018AE@yahoo.co.uk>

Hi willy,
    I think, with help from you and everyone else
on this list, I'm understanding where I'm going
wrong. Many thanks for your help.

Michael



willy meier wrote:

>michael young wrote:
>  
>
>>Hi willy,
>>thank you for your response.
>>a question below.
>>
>>willy meier wrote:
>>
>>    
>>
>>>michael young wrote:
>>>
>>>apparently, a common 'problem':
>>>if ah:=9 and int 21 is supposed to send text,
>>>the binary counter data can't appear visibly.
>>>
>>>
>>>      [...]
>>>
>>>
>>>      
>>>
>>>>START:
>>>>
>>>>
>>>>        
>>>>
>>>  mov cx, 10  =>      mov cx,"9"
>>>
>>>
>>>      
>>>
>>>> call myloop
>>>>
>>>>myloop:
>>>> mov dx, cx
>>>> mov ah, 9
>>>> int 21H
>>>> dec cx
>>>>
>>>>
>>>>        
>>>>
>>>                      cmp cx,"0"
>>>  jnz myloop  =>      jc myloop	(<----- false, use 'jnc')
>>>
>>>      
>>>
>>Here, wouldn't the 'dec' instruction set the 'ZF' if cx hit 0?
>>    
>>
>
>right but, binary value 0 would (if the rsp. terminal permits) just be
>the control code of <nul>. apparently (I know nothing about pc-dos
>specifica), the int-routine requires a character code in <dx> thus you
>either count and compare by chars codes or, add the byte value
>48(decimal) to the counter value to sending the rsp char.
>much simplified, useable only for single digits (characters).
>
>  
>
>>where am I going wrong on this?
>>    
>>
>
>correction: the added opr should read 'jnc myloop'.
>loop terminates after cx was counted down to code("0")-1
>(assuming that int 21 won't modify cx value)
>
>did you forget the <ret> code after <call myloop>?
>if no other code follows after <call myloop> you could either, use <jmp>
>or, delete the call instr, otherwise, in your example, 'myloop' would be
>run once more, before termination.
>
>  
>
>>>      
>>>
>>>> mov dx, donemsg
>>>>
>>>>
>>>>        
>>>>
>>>      [...]
>>>      
>>>
>
>best,
>       hp
>
>  
>


  reply	other threads:[~2003-10-28 22:19 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
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 [this message]
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=3F9EEB68.9040309@valdosta.edu \
    --to=mhyoung@valdosta.edu \
    --cc=linux-assembly@mlists.in-berlin.de \
    --cc=linux-assembly@vger.kernel.org \
    --cc=wklux@yahoo.co.uk \
    /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).