Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .model
- .stack 100h
- max_cols EQU 720
- max_rows EQU 400
- .code
- start:
- ; init video mode
- mov ax,0012h
- int 10h
- call fill_screen
- ;mov al,02h
- ;mov ah,0ch
- ;mov al, 1h
- ;int 10h
- jmp end_program
- fill_screen:
- pop bx ;save ret adress
- mov dx, 1
- loop_row:
- mov cx, 1
- loop_col:
- ; body here
- ;call print_coords
- mov al, dl
- xor al, cl
- call fill_pixel
- ; end body
- inc cx
- cmp cx, max_cols
- jne loop_col
- inc dx
- cmp dx, max_rows
- jne loop_row
- push bx
- ret
- end_program:
- mov ah, 4Ch
- int 21h
- print_coords:
- push dx
- push cx ;save registers in stack
- push ax
- mov ah, 2 ;print dl
- or dl, 30h
- int 21h
- mov dl, 'x'
- int 21h
- mov dl, cl ;print cl
- or dl, 30h
- int 21h
- mov dl, 0Ah ; LF
- int 21h
- mov dl, 0Dh ; CR
- int 21h
- pop ax
- pop cx
- pop dx
- ret
- fill_pixel: ;fills pixel in col cx and row dx with color in AL
- mov ah, 0Ch
- int 10h
- ret
- end start
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement