rendered paste body[ORG 0x100]
jmp @Principal
@WriteCh:
pusha
push es
mov dx, 0xB800 ;Video location
mov es, dx ;es = dx
mov cx, ax ;cx = ax (col, line)
mov al, 80 ;al = 80
mul ah ;multiply ah by al -> ah * 80
xor ax, ax ;ax = 0
add al, cl ;
adc ah, 0 ;using this, it add cl to ax
shl ax, 1 ;ax = ax * 2
mov di, ax ;di = ax (di must be the position in the screen in dec)
mov ax, bx ;ax = bx (colors and char)
stosw
pop es
popa
ret
@Principal:
mov al, 25 ;col
mov ah, 41 ;line
mov bh, 0x2F ;foreground and background
mov bl, 'A' ;char to print
call @WriteCh
@Fim:
mov ax, 0x4C00
int 0x21
;Formula -> 2*(lines*80+cols)