; PRINT ENTIRE OF CODE PAGE 437 TO THE SCREEN
; (NASM Source)
_start:
; Set to 0
xor ax, ax
xor bx, bx
xor cx, cx
xor dx, dx
mov ah, 0x5 ; Select active display page al
mov al, 1
int 0x10
mov bh, 1 ; Page number
mov ah, 0x2 ; Set cursor position to (dl, dh)
int 0x10
xor ax, ax
; For each character (0-255)
loop:
mov ah, 0xa ; Write character al at cursor position
mov cx, 1 ; Write only once
int 0x10
inc dl ; x++
; Create a newline every 32 characters
test dl, 0x1f ; if dl & 0x1f == 0
jnz nonewline
inc dh ; y++
xor dl, dl ; x = 0
nonewline:
mov ah, 0x2 ; Set cursor position to (dl, dh)
int 0x10
inc al ; al++
test al, al ; if al != 0 goto loop
jnz loop
hang:
jmp hang
; Count up size of each section
%assign text_length ($-$$)
; Pad the boot sector out to 512 bytes
; All bytes are padded with nop, except the last to (0x55 0xaa).
times 510 - text_length nop
db 0x55, 0xaa