assembly code for clearing DOS screen and ...

Dear friends..iam a beginer ..and ineed an urgent code ..of assembly language which first clear DOS screen and then display any number on the top right corner of screen in green color with white background.

plz help me out...looking forward..

Comments

  • This should work in any screen mode:
    [code]
    ; Clear screen by resetting the video mode
    mov ah, 0fh ; function - get video mode
    int 10h
    push ax ; save number of columns
    push bx ; save page number
    mov ah, 0 ; function - set video mode
    int 10h

    ; Set cursor to right corner
    pop bx ; restore page number
    pop dx ; restore number of columns
    mov dl, dh
    dec dl
    mov dh, 0 ; first line
    push bx ; save page number
    mov ah, 2 ; function - set cursor
    int 10h

    ; Display any number
    pop bx ; restore page number
    mov al, '7' ; number 7
    mov bl, 0f2h ; attribute = green/white
    mov cx, 1 ; print once
    mov ah, 9 ; function - print character
    int 10h
    [/code]
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion