Page 1 of 1

Usefull Code Snippets

Posted: Sat Jan 19, 2008 11:05 pm
by michael
Okay ive got 3 ive found that might be usefull to people..

Warm boot

Code: Select all

mov ax,40h
mov es,ax
mov ax,0
mov [es:72h],ax
Turn off floppy drive motors

Code: Select all

mov dx,3F2h
mov al,0
out dx,al

Switch to 256 colour mode (320x200)

This part is 16 bit ONLY
mov ah, 00h
mov al, 13h
int 10h

And then write to 0xA0000 , a 320x200 array of bytes, each representing the colour of each pixel

Posted: Sat Jan 19, 2008 11:13 pm
by gzaloprgm
Thanks, I'll probably use the warm reboot in my next os.

Also, the

Code: Select all

mov ah, 00h
mov al, 13h
int 10h 
can be simplified using

Code: Select all

mov ax, 13h
int 10h