"How do you do bank-switching?" Reluctantly! If you can get a Linear Frame Buffer (or use OS/Xwindows services to do it for you), that's probably a better bet. If you're stuck with 64k segments, you may need to do bank-switching.
For VGA modes, there'a a port...
xor bx,bx
sbank:
;To set a 64k bank number in single paging mode use the following procedure:
;PortW[$3CE] := bank_number Shl 12 + $09;
mov dx,03CEh
mov ax,bx
shl ax,0Ch
add ax,09h
out dx,ax
For higher res modes (VESA) there's a BIOS interrupt...
; bank in dx
SwitchBank:
push ax
push bx
mov ax,4f05h
xor bx,bx
int 10h
pop bx
pop ax
ret
Since I tried to avoid bank-switching, that's about all I know about it. There's some "setup" involved before those will work, so I'll attach the files they're snipped from. I don't know where "vid94.asm" came from. I believe "hires.asm" was derived from "garfvid.asm" - something posted by a guy who went by "Garfield" (if I ever knew his right name, I've forgotten) which I attempted to "improve" for him. His original "PutPixel" ("lint" in this version) calls SwitchBank whether the bank needs to be switched or not. My "pp2" checks to see if it needs to be switched. Should be faster - I don't really recall. I don't think any of 'em do anything "interesting", but they're examples of "bank-switching in Nasm".
Best,
Frank