943,742 Members | Top Members by Rank

Ad:
  • Assembly Discussion Thread
  • Marked Solved
  • Views: 1149
  • Assembly RSS
Sep 10th, 2009
0

help with some homework plz!

Expand Post »
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
Assembly Syntax (Toggle Plain Text)
  1. hello
  2. .
  3. .
  4. .
  5. 25 times
in the right of the screen.... this is what i have so far

Assembly Syntax (Toggle Plain Text)
  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.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
xenocide001 is offline Offline
8 posts
since Nov 2008
Sep 11th, 2009
0

Re: help with some homework plz!

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!

Asm Syntax (Toggle Plain Text)
  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,'$'
Reputation Points: 546
Solved Threads: 99
Practically a Posting Shark
wildgoose is offline Offline
891 posts
since Jun 2009
Sep 11th, 2009
0

Re: help with some homework plz!

well thnx for the answer but i can't put the string in the dx i tried ur code and pops and error at
Assembly Syntax (Toggle Plain Text)
  1. mov dx,hola
the error is in the string..
Reputation Points: 10
Solved Threads: 0
Newbie Poster
xenocide001 is offline Offline
8 posts
since Nov 2008
Sep 11th, 2009
0

Re: help with some homework plz!

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.
Reputation Points: 546
Solved Threads: 99
Practically a Posting Shark
wildgoose is offline Offline
891 posts
since Jun 2009
Sep 12th, 2009
0

Re: help with some homework plz!

in ms-dos debugger .. and i think i get it.. save the string and cal its addres in dx right?..
Reputation Points: 10
Solved Threads: 0
Newbie Poster
xenocide001 is offline Offline
8 posts
since Nov 2008
Sep 12th, 2009
0

Re: help with some homework plz!

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!
Reputation Points: 546
Solved Threads: 99
Practically a Posting Shark
wildgoose is offline Offline
891 posts
since Jun 2009
Sep 12th, 2009
0

Re: help with some homework plz!

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
Reputation Points: 10
Solved Threads: 0
Newbie Poster
xenocide001 is offline Offline
8 posts
since Nov 2008

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Assembly Forum Timeline: plz help me
Next Thread in Assembly Forum Timeline: help





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC