rdos/boot/vga11.asm

100 lines
934 B
NASM

org 0x7C00
cols: equ 80
rows: equ 30
main:
mov ax, cs
mov ds, ax
mov es, ax
mov ss, ax
xor sp, sp
mov ah, 0x42
mov si, dap
int 0x13
mov ax, 0x0011
int 0x10
mov di, txtbuf
.loop:
call sync
xor ax, ax
int 0x16
stosb
jmp .loop
hlt:
hlt
jmp hlt
sync:
push ax
push si
push di
push es
mov si, txtbuf
mov ax, 0xA000
mov es, ax
mov di, 0
mov bx, font
mov cx, rows
.loop:
call charline
loop .loop
pop es
pop di
pop si
pop ax
ret
charline:
push bx
push cx
mov cx, 8
.loop:
call scanline
call scanline
inc bh
loop .loop
add si, cols
pop cx
pop bx
ret
scanline:
push si
push cx
mov cx, cols
.loop:
lodsb
mov bl, al
mov al, [bx]
stosb
loop .loop
pop cx
pop si
ret
dap:
db 0x10
db 1
dw 20
dw font, 0
dq 1
times (510 - ($-$$)) nop
dw 0xAA55
font:
incbin "cp437.bin"
txtbuf:
times (rows * cols) db 0
end: