Noob looking for guidance

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

Join Date: Oct 2009
Posts: 19
Reputation: dylank is an unknown quantity at this point 
Solved Threads: 0
dylank dylank is offline Offline
Newbie Poster

Noob looking for guidance

 
0
  #1
34 Days Ago
Hi, I was using C++ to try to write objects to the screen, and decided to try this in a lower level language. I have searched the web and found some sample code:

  1. name "vga"
  2.  
  3. ; this program draws a tiny rectangle in vga mode.
  4.  
  5. org 100h
  6.  
  7. jmp code
  8.  
  9. ; dimensions of the rectangle:
  10. ; width: 10 pixels
  11. ; height: 5 pixels
  12.  
  13. w equ 10
  14. h equ 5
  15.  
  16.  
  17. ; set video mode 13h - 320x200
  18.  
  19. code: mov ah, 0
  20. mov al, 13h
  21. int 10h
  22.  
  23.  
  24. ; draw upper line:
  25.  
  26. mov cx, 100+w ; column
  27. mov dx, 20 ; row
  28. mov al, 15 ; white
  29. u1: mov ah, 0ch ; put pixel
  30. int 10h
  31.  
  32. dec cx
  33. cmp cx, 100
  34. jae u1
  35.  
  36. ; draw bottom line:
  37.  
  38. mov cx, 100+w ; column
  39. mov dx, 20+h ; row
  40. mov al, 15 ; white
  41. u2: mov ah, 0ch ; put pixel
  42. int 10h
  43.  
  44. dec cx
  45. cmp cx, 100
  46. ja u2
  47.  
  48. ; draw left line:
  49.  
  50. mov cx, 100 ; column
  51. mov dx, 20+h ; row
  52. mov al, 15 ; white
  53. u3: mov ah, 0ch ; put pixel
  54. int 10h
  55.  
  56. dec dx
  57. cmp dx, 20
  58. ja u3
  59.  
  60.  
  61. ; draw right line:
  62.  
  63. mov cx, 100+w ; column
  64. mov dx, 20+h ; row
  65. mov al, 15 ; white
  66. u4: mov ah, 0ch ; put pixel
  67. int 10h
  68.  
  69. dec dx
  70. cmp dx, 20
  71. ja u4
  72.  
  73.  
  74. ; pause the screen for dos compatibility:
  75.  
  76. ;wait for keypress
  77. mov ah,00
  78. int 16h
  79.  
  80. ; return to text mode:
  81. mov ah,00
  82. mov al,03 ;text mode 3
  83. int 10h
  84.  
  85. ret
Again, I did not write this, I found it at http://www.emu8086.com/dr/asm2html/a...phics.asm.html

My question is how would I go about compiling said code?
Reply With Quote Quick reply to this message  
Join Date: Oct 2009
Posts: 102
Reputation: jomanlk is an unknown quantity at this point 
Solved Threads: 18
jomanlk jomanlk is offline Offline
Junior Poster
 
0
  #2
34 Days Ago
This is assembly language.

See these links for more information
Reply With Quote Quick reply to this message  
Join Date: Oct 2009
Posts: 19
Reputation: dylank is an unknown quantity at this point 
Solved Threads: 0
dylank dylank is offline Offline
Newbie Poster

Yea, well, thanks

 
0
  #3
33 Days Ago
Originally Posted by jomanlk View Post
This is assembly language.

See these links for more information
Well, thanks for the help. Better than an STFW or RTFM i guess, I found a compiler (and emu) called emu8086.
Reply With Quote Quick reply to this message  
Reply

Message:



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



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC