12h.asm 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. .286
  2. .model small
  3. .code
  4. org 100h
  5. start:
  6. mov ax, 12h
  7. int
  8. 10h
  9. mov cx, 0fh
  10. gg:
  11. mov ax, 100
  12. mov bx, cx
  13. call putpixel
  14. inc ax
  15. inc bx
  16. call putpixel
  17. loop gg
  18. mov ah, 08h
  19. int 21h
  20. mov ax, 03
  21. int 10h
  22. mov ax, 4ch
  23. int 21h
  24. putpixel proc near
  25. pusha
  26. push es
  27. mov di, cx
  28. push 0a000h
  29. pop es
  30. push bx
  31. mov cl, 6
  32. shl bx, cl
  33. pop dx
  34. shl dx, 4
  35. add bx, dx
  36. push ax
  37. shr ax, 3
  38. add bx, ax
  39. pop ax
  40. and ax, 7
  41. mov cl, 7
  42. sub cl, al
  43. mov ax, 1
  44. shl ax, cl
  45. mov m1, al
  46. mov offs, bx
  47. xor cx, cx
  48. puts:
  49. mov dx, 3ceh
  50. mov ax, 5
  51. out dx, ax
  52. mov dx, 3c4h
  53. mov ax, 100h
  54. shl ax, cl
  55. add ax, 2
  56. out dx, ax
  57. mov si, offs
  58. mov al, es:[si]
  59. mov bx, 1
  60. shl bx, cl
  61. test di, bx
  62. jz nwrt
  63. or al, m1
  64. jmp myout
  65. nwrt:
  66. mov bl, m1
  67. not bl
  68. and al, bl
  69. myout:
  70. mov es:[si], al
  71. mov dx, 3c4h
  72. mov ax, 0F02h
  73. out dx, ax
  74. inc cl
  75. cmp cl, 4
  76. jnz puts
  77. pop es
  78. popa
  79. ret
  80. m1 db ?
  81. offs dw ?
  82. endp
  83. end start