help with some homework plz!

Please support our Assembly advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved

Join Date: Nov 2008
Posts: 8
Reputation: xenocide001 is an unknown quantity at this point 
Solved Threads: 0
xenocide001 xenocide001 is offline Offline
Newbie Poster

help with some homework plz!

 
0
  #1
Sep 10th, 2009
hi all i have some homework that i cant finish cuz i dont know how to print it the way my teacher wants it.. here's the thing

*Print this in debugger
  1. hello
  2. .
  3. .
  4. .
  5. 25 times
in the right of the screen.... this is what i have so far

  1. Microsoft Windows [Versión 6.0.6002]
  2. Copyright (c) 2006 Microsoft Corporation. Reservados todos los derechos.
  3.  
  4. C:\Users\MAURO>cd workspace
  5.  
  6. C:\Users\MAURO\workspace>debug prue.com
  7. -u100
  8. 1841:0100 BA2006 MOV DX,0620
  9. 1841:0103 B402 MOV AH,02
  10. 1841:0105 CD10 INT 10
  11. 1841:0107 B80002 MOV AX,0200
  12. 1841:010A 48 DEC AX
  13. 1841:010B 4F DEC DI
  14. 1841:010C 4C DEC SP
  15. 1841:010D 41 INC CX
  16. 1841:010E 0D0A24 OR AX,240A
  17. 1841:0111 B409 MOV AH,09
  18. 1841:0113 BA0A01 MOV DX,010A
  19. 1841:0116 B91900 MOV CX,0019
  20. 1841:0119 CD21 INT 21
  21. 1841:011B E2FC LOOP 0119
  22. 1841:011D CD20 INT 20
  23. 1841:011F 0000
at 010a (12 row) its my chain HOLA
e10a 'hola',0d,oa,'$'

i'm using Windows vista HP and a intel core2 procesor


i dunno how to put the rest of the chains in the same position as the first one... i thought about an increment or printing the interruption with the chain.. plz help i dunno what to do.
and excuse my english i'm not a native english speaker i'm mexican
Last edited by xenocide001; Sep 10th, 2009 at 6:58 pm.
Reply With Quote Quick reply to this message  
Join Date: Jun 2009
Posts: 830
Reputation: wildgoose is a name known to all wildgoose is a name known to all wildgoose is a name known to all wildgoose is a name known to all wildgoose is a name known to all wildgoose is a name known to all 
Solved Threads: 94
wildgoose's Avatar
wildgoose wildgoose is offline Offline
Practically a Posting Shark

Re: help with some homework plz!

 
0
  #2
Sep 11th, 2009
You need to keep the ASCII text ouside the code flow or it will be treated like code, which it isn't!

You need to modify your code as to something as follows!

  1. MOV AH,9 ; Write String to STDOUT
  2. mov DX,Hola
  3. mov CX,25
  4.  
  5. prt: int 21h ; DOS -Interrupt
  6. loop prt
  7.  
  8. int 20h
  9.  
  10. Hola: db 'hola',0dh,0ah,'$'
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 8
Reputation: xenocide001 is an unknown quantity at this point 
Solved Threads: 0
xenocide001 xenocide001 is offline Offline
Newbie Poster

Re: help with some homework plz!

 
0
  #3
Sep 11th, 2009
well thnx for the answer but i can't put the string in the dx i tried ur code and pops and error at
  1. mov dx,hola
the error is in the string..
Reply With Quote Quick reply to this message  
Join Date: Jun 2009
Posts: 830
Reputation: wildgoose is a name known to all wildgoose is a name known to all wildgoose is a name known to all wildgoose is a name known to all wildgoose is a name known to all wildgoose is a name known to all 
Solved Threads: 94
wildgoose's Avatar
wildgoose wildgoose is offline Offline
Practically a Posting Shark

Re: help with some homework plz!

 
0
  #4
Sep 11th, 2009
then try offset Hola

or use LEA or something similar!

The idea is the data has to not be in the code flow, and you need to load its address into ds:dx.

Watch the spelling!
Are you doing this in the debugger or an assembler?

If the debugger then you need to mov dx, ####
where #### is the hard coded address of the string!
Last edited by wildgoose; Sep 11th, 2009 at 9:34 pm.
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 8
Reputation: xenocide001 is an unknown quantity at this point 
Solved Threads: 0
xenocide001 xenocide001 is offline Offline
Newbie Poster

Re: help with some homework plz!

 
0
  #5
Sep 12th, 2009
in ms-dos debugger .. and i think i get it.. save the string and cal its addres in dx right?..
Reply With Quote Quick reply to this message  
Join Date: Jun 2009
Posts: 830
Reputation: wildgoose is a name known to all wildgoose is a name known to all wildgoose is a name known to all wildgoose is a name known to all wildgoose is a name known to all wildgoose is a name known to all 
Solved Threads: 94
wildgoose's Avatar
wildgoose wildgoose is offline Offline
Practically a Posting Shark

Re: help with some homework plz!

 
0
  #6
Sep 12th, 2009
I'm not sure why you aren't using one of the many free assemblers available instead of the ancient 1980 DOS debugger but yes. You'll have to enter your code instructions, then in adjacent memory (or following the code) store the data and set the DX register to point at that string data in memory!
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 8
Reputation: xenocide001 is an unknown quantity at this point 
Solved Threads: 0
xenocide001 xenocide001 is offline Offline
Newbie Poster

Re: help with some homework plz!

 
0
  #7
Sep 12th, 2009
lol ty man u helped me a lot.. and i'm using the old debugger cuz the teacher said we'll be using that until we move to *nix based systems
Reply With Quote Quick reply to this message  
Reply

Tags
assembler, debug, int10h

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Assembly Forum
Thread Tools Search this Thread



Tag cloud for assembler, debug, int10h
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC