pastebin - collaborative debugging tool
kpaste.net RSS


Untitled
Posted by Anonymous on Mon 14th Jan 2013 18:54
raw | new post
view followups (newest first): Untitled by Anonymous

  1. START:
  2.         MOV AH,00h                      ;get into video mode.  00 = Set Video Mode
  3.     MOV AL,13h                      ;13h = 320x240x16
  4.     INT 10h
  5. SET_VSEGMENT:                       ;set up video segment
  6.     MOV AX,0A000h                   ;point ES to VGA segment
  7.     MOV ES,AX
  8. VALUES:                             ;various values used for plotting later on
  9.     MOV CX,15                      ;length of line.  used for REP    
  10. %macro get_offset 2             ;%1 = X and %2 = y . calculates the offset location
  11.     PUSH AX
  12.     PUSH BX
  13.     MOV AX,%1                       ;copy X location passed to macro to AX
  14.     MOV BX,%2                       ;copy Y location passed to macro to BX
  15.         MOV DI,AX                       ;put X location into DI
  16.     MOV DX,BX                       ;and Y into DX
  17.     SHL BX,8                        ;Y * 2^8.  same as saying Y * 256
  18.     SHL DX,6                        ;Y * 2^8.  same as saying Y * 64
  19.     ADD DX,BX                       ;add the two together
  20.     ADD DI,BX                       ;and add the X location
  21.         POP BX
  22.         POP AX
  23. %endmacro                       ;end macro
  24.  
  25.  
  26.  
  27.  
  28.  
  29. ; starting Y location.
  30. MOV BX,100              
  31. LOOP_LABEL:
  32. get_offset AX,BX
  33. MOV AL,0  
  34. STOSB  
  35. MOV AX,102                      ;X location
  36. get_offset AX,BX
  37. MOV AL,1  
  38. STOSB
  39. MOV AX,104                      ;X location
  40. get_offset AX,BX
  41. MOV AL,2  
  42. STOSB  
  43. MOV AX,106                      ;X location
  44. get_offset AX,BX
  45. MOV AL,3  
  46. STOSB  
  47. MOV AX,108                      ;X location
  48. get_offset AX,BX
  49. MOV AL,4  
  50. STOSB  
  51. MOV AX,110                      ;X location
  52. get_offset AX,BX
  53. MOV AL,5  
  54. STOSB  
  55. MOV AX,112                      ;X location
  56. get_offset AX,BX
  57. MOV AL,6  
  58. STOSB  
  59. MOV AX,114                      ;X location
  60. get_offset AX,BX
  61. MOV AL,7  
  62. STOSB  
  63. MOV AX,116                      ;X location
  64. get_offset AX,BX
  65. MOV AL,8  
  66. STOSB  
  67. MOV AX,118                      ;X location
  68. get_offset AX,BX
  69. MOV AL,9  
  70. STOSB  
  71. MOV AX,120                      ;X location
  72. get_offset AX,BX
  73. MOV AL,10  
  74. STOSB  
  75. MOV AX,122                      ;X location
  76. get_offset AX,BX
  77. MOV AL,11  
  78. STOSB  
  79. MOV AX,124                      ;X location
  80. get_offset AX,BX
  81. MOV AL,12  
  82. STOSB  
  83. MOV AX,126                      ;X location
  84. get_offset AX,BX
  85. MOV AL,13  
  86. STOSB  
  87. MOV AX,128                      ;X location
  88. get_offset AX,BX
  89. MOV AL,14  
  90. STOSB  
  91. MOV AX,130                      ;X location
  92. get_offset AX,BX
  93. MOV AL,15  
  94. STOSB  
  95. MOV AX,132                      ;X location
  96. get_offset AX,BX
  97. MOV AL,16  
  98. STOSB  
  99. ADD BX,01h
  100. CMP BX,200
  101. JNE LOOP_LABEL
  102.  
  103. WAIT_FOR_KEY_PRESS:
  104.         MOV AH,0x00
  105.         INT 0x16
  106. REBOOT:
  107.         DB 0xEA
  108.         DW 0x0000
  109.         DW 0xFFFF
  110. SIGNATURE DW 0xAA55

Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Syntax highlighting:

To highlight particular lines, prefix each line with {%HIGHLIGHT}




All content is user-submitted.
The administrators of this site (kpaste.net) are not responsible for their content.
Abuse reports should be emailed to us at