From mboxrd@z Thu Jan 1 00:00:00 1970 From: willy meier Subject: Re: DOS assembly questions? Date: Fri, 24 Oct 2003 18:12:44 +0100 Sender: linux-assembly-owner@vger.kernel.org Message-ID: <3F995D8C.5BF018AE@yahoo.co.uk> References: <3F9473D9.8010304@valdosta.edu> <3F957562.7060302@valdosta.edu> <3F961EB4.BE9DB472@yahoo.co.uk> <3F980930.6080207@valdosta.edu> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: List-Id: Content-Type: text/plain; charset="us-ascii" To: michael young Cc: linux-assembly@vger.kernel.org, linux-assembly@mlists.in-berlin.de 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 . apparently (I know nothing about pc-dos specifica), the int-routine requires a character code in 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 code after ? if no other code follows after you could either, use or, delete the call instr, otherwise, in your example, 'myloop' would be run once more, before termination. > > > > > > >> mov dx, donemsg > >> > >> > > [...] best, hp -- Linux,Assembly,Forth: http://www.lxhp.in-berlin.de/index-lx.shtml >> hp -at- lxhp -dot- in-berlin -dot- de <<