; From text p.340
title VGA mode 13h colors
;
; shows all 256 default colors of VGA mode 13h
;
.model small
.stack  100h
.code
main proc
; save old mode
        mov ah,0fh
        int 10h
        push ax
        push bx
; select VGA text mode 13h
	mov ah,0
	mov al,13h
	int 10h
; display 256 colors in row 100
	mov ah,0ch	; write pixel
        mov al,0        ; pixel color 0 initially
	mov bh,0	; page 0
	mov cx,0	; row 0
	mov dx,100	; col 100
LOOP_:
	int 10h		; write pixel
	inc al		; next color
	inc cx		; nex col
	cmp cx,256	; done?
	jl LOOP_	; if not, loop
; wait for key stroke before continuing
        xor ah,ah
        int 16h
; restore old mode
        pop bx
        pop ax
        xor ah,ah
        int 10h         ; restore mode
        mov al,bh
        mov ah,5
        int 10h         ; restore active page
; done
	mov ah,4ch
	int 21h
main	endp
	end main
