flat assembler
Message board for the users of flat assembler.

Index > OS Construction > [ask]vesa bank switching problem

Author
Thread Post new topic Reply to topic
christiandy



Joined: 03 Mar 2011
Posts: 25
Location: 101
christiandy 23 Apr 2011, 18:34
how to use bank switching function ax 4f05 int 10h? I try to make myself but it did not work. I try to write to pixel 400 which is on bank 5 cmiiwbut it still wrote in the first pixel.
Code:
setbank:
 pushad
      mov ax,0x4f05
       xor bx,bx
   mov dx,[bank]
       shl dx,4
    int 10
      popad
       ret
    


my put pixel function
Code:
putpixel: 
;put pixel direct to VGA memory (x,y,color)
   
pushad      
     

        
        MOV     CX,[X] 
        MOV     AX,[Y] 
        ROL     AX,9
        MOV     BX,AX 
        ADD     AX,CX 
        SHR     BX,2 
                xor cx,cx
        ADD     BX,AX 
         JNC NOC
             inc cx
              NOC:
            cmp cx,[bank]
               jz same
             mov [bank],cx
               call setbank
                same:
               PUSH    0A000H 
        POP     ES
           MOV     [ES:BX],DL              ; Write Pixel 
  popad
        RET 
    
Post 23 Apr 2011, 18:34
View user's profile Send private message AIM Address Reply with quote
Mac2004



Joined: 15 Dec 2003
Posts: 314
Mac2004 23 Apr 2011, 19:31
Your setbank routine calls int 10 instead of int 0x10.

Regards
Mac2004
Post 23 Apr 2011, 19:31
View user's profile Send private message Reply with quote
christiandy



Joined: 03 Mar 2011
Posts: 25
Location: 101
christiandy 24 Apr 2011, 07:01
oh thanks. but i still can't control it if i put pixel to y=400 it will drawn on y= aproximately 100
Post 24 Apr 2011, 07:01
View user's profile Send private message AIM Address Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.