944,067 Members | Top Members by Rank

Ad:
  • Assembly Discussion Thread
  • Unsolved
  • Views: 6439
  • Assembly RSS
Oct 27th, 2007
0

MASM int 10h help

Expand Post »
hi Pals,
i have a problem with MASM interrpt 10h.
i want to colour s portion of the screen using the 10h interrupt after changinging to the video mode. Please help
Assembly Syntax (Toggle Plain Text)
  1. .model small
  2. .stack 100h
  3. .386
  4.  
  5. .data
  6. .code
  7. main PROC
  8.  
  9. mov ax,@data
  10. mov ds,ax
  11.  
  12. mov ah, 0
  13. mov al, 3h
  14. int 10h ; set video mode 80*25
  15. mov ah,1
  16. int 21h
  17. ;---- code for colouring the screen
  18. mov ax, 0600h
  19. mov ch, 1 ; size to set colu
  20. mov cl, 1
  21. mov dh, 24
  22. mov dl, 78
  23. mov bh, 100b
  24. int 10h
  25.  
  26. ;-----------------------------------------------
  27. mov ah ,04ch ; exit interrupt
  28. int 21h ; call sys interrupt
  29. main ENDP
  30. END main

Please help;
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
esquared is offline Offline
1 posts
since Oct 2007
Oct 27th, 2007
0

Re: MASM int 10h help

Make sure you are using a good reference when you use interrupts. Also, try to reduce the number of instructions you use.
Assembly Syntax (Toggle Plain Text)
  1. ;set the video mode to CGA 80 x 25, 16-color
  2. mov ax, 0300h
  3. int 10h
  4.  
  5. ;wait for a keypress
  6. mov ah, 1
  7. int 21h
  8.  
  9. ;clear the screen to a specific character attribute
  10. mov ax, 0600h ; scroll all lines up == clear screen
  11. mov bh, 07h ; light gray on black
  12. mov cx, 0 ; upper-left = 0, 0
  13. mov dx, 184Fh ; lower-right = 24, 79
  14. int 10h

Hope this helps.
Last edited by Duoas; Oct 27th, 2007 at 7:31 pm.
Featured Poster
Reputation Points: 1140
Solved Threads: 229
Postaholic
Duoas is offline Offline
2,039 posts
since Oct 2007

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: Load word
Next Thread in Assembly Forum Timeline: lahf()





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


Follow us on Twitter


© 2011 DaniWeb® LLC