Vesa in nasm

Reply

Join Date: Jan 2007
Posts: 2
Reputation: tojas is an unknown quantity at this point 
Solved Threads: 0
tojas tojas is offline Offline
Newbie Poster

Vesa in nasm

 
0
  #1
Jan 17th, 2007
Hello!

3 weeks ago I started to search the secrets of vesa programming... and now I can forwrd with this problem.. I know I learning very slow, but... I think the important is that I want to learn :mrgreen: So here is my code:
  1. section .code
  2.  
  3.  
  4. start:
  5. mov ax,data
  6. mov ds,ax
  7. mov es,ax
  8. mov ax,stack
  9. mov ss,ax
  10. mov sp,stacktop
  11. jmp main
  12.  
  13.  
  14. PutPixel:
  15. push eax
  16. push es
  17. push ecx
  18. push edx
  19. push ebx
  20. lea eax,[edx+4*edx]
  21. lea eax,[eax+4*eax]
  22. xor edx,edx
  23. mov ebx,65536
  24. shl eax,5
  25. add eax,ecx
  26. div ebx
  27. mov ecx,edx
  28. cmp eax,CurBank
  29. je Lbl
  30. mov [CurBank],eax
  31. mov dx,ax
  32. mov ax,4f05h ;SetBank
  33. xor ebx,ebx
  34. int 10h
  35. Lbl:
  36. pop ebx
  37. mov ax,0A000h
  38. mov es,ax
  39. mov [es:ecx],bl
  40. pop edx
  41. pop ecx
  42. pop es
  43. pop eax
  44. ret
  45.  
  46.  
  47. main:
  48. mov ax,0x4f02
  49. mov bx,0x103
  50. int 0x10
  51.  
  52. ;-----------------------------------------
  53. mov bl,1 ;color
  54. xor edx,edx
  55. LoopY:
  56. xor ecx,ecx
  57. LoopX:
  58. call PutPixel
  59. inc ecx
  60. cmp ecx,800
  61. jne LoopX
  62. inc edx
  63. inc bl
  64. cmp edx,256
  65. jne LoopY
  66. ;-----------------------------------------
  67. xor ah,ah
  68. int 16h
  69.  
  70. xor ah,ah
  71. mov al,0x3
  72. int 0x10
  73.  
  74. mov ax,0x4c00
  75. int 0x21
  76.  
  77.  
  78. section .data
  79. s resb 256
  80. CurBank dd 0
  81. section .stack stack
  82. resb 2048
  83. stacktop:

I wrote this code in nasm. And then used tlink. The problem is that this is very very slow for filling the screen... I know that I have to use the video memory.. but I can't.. I read many tutorials but I still can't use.. Tutorials didn't write an example
Please if somebody can help me to do a faster code or something... Thanks in forward
Reply With Quote Quick reply to this message  
Join Date: Apr 2009
Posts: 1
Reputation: lewiscowles is an unknown quantity at this point 
Solved Threads: 0
lewiscowles lewiscowles is offline Offline
Newbie Poster

Re: Vesa in nasm

 
0
  #2
Apr 8th, 2009
hi you should change the code
  1. mov ax,4f05h ;SetBank
to read
  1. mov ax,4f02h ;SetBank
I think the problem is your bios support for vesain mode 4f05h
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



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

©2003 - 2009 DaniWeb® LLC