segment code align 16 call start start: pop bx mov ax, cs shr bx, 4 add ax, bx mov ds, ax mov es, ax ; mov si, hello ; call prins findvesa: mov ax, 4F00h mov di, data int 10h cmp ax, 004Fh je .good mov si, bad call prins jmp .done .good: mov si, data mov cx, 4 call prinsn lds si, [data+6] mov cx, 100 call prinsn mov ax, es mov ds, ax .done: finish: mov si, done call prins mov ax, 4C00h ; exit(0) line 1 int 21h ; exit line 2 prins: ; address of string in si .loop: mov al, [si] cmp al, 0 je .end inc si mov ah, 0Eh ; putch line 1 mov bx, 0007h ; video page then attribute int 10h jmp .loop .end: ret prinsn: ; address of string in si, len in cx .loop: cmp cx, 0 je .end dec cx mov al, [si] inc si mov ah, 0Eh ; putch line 1 mov bx, 0007h ; video page then attribute int 10h jmp .loop .end: ret phex: pusha push ax mov si, ax and si, 00F0h shr si, 4 add si, hex mov al, [si] mov ah, 0Eh mov bx, 0007h int 10h pop si and si, 000Fh add si, hex mov al, [si] mov ah, 0Eh mov bx, 0007h int 10h mov ax, 0E20h mov bx, 0007h int 10h popa ret segment data hex: db "0123456789ABCDEF" hello: db "hello!", 13, 10, 0 done: db "all over.", 13, 10, 0 bad: db "no vesa detected", 13, 10, 0 data: dd 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 dd 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 dd 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 dd 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0