943,832 Members | Top Members by Rank

Ad:
  • Assembly Discussion Thread
  • Unsolved
  • Views: 3617
  • Assembly RSS
Jan 17th, 2007
0

Vesa in nasm

Expand Post »
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:
Assembly Syntax (Toggle Plain Text)
  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
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
tojas is offline Offline
2 posts
since Jan 2007
Apr 8th, 2009
0

Re: Vesa in nasm

hi you should change the code
Assembly Syntax (Toggle Plain Text)
  1. mov ax,4f05h ;SetBank
to read
Assembly Syntax (Toggle Plain Text)
  1. mov ax,4f02h ;SetBank
I think the problem is your bios support for vesain mode 4f05h
Reputation Points: 10
Solved Threads: 0
Newbie Poster
lewiscowles is offline Offline
1 posts
since Apr 2009

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: Design/Coding of assembler using C-code.
Next Thread in Assembly Forum Timeline: Learning assembly





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


Follow us on Twitter


© 2011 DaniWeb® LLC