Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .8086
- .model small
- .stack 2048
- dseg segment para public 'data'
- line db 3;the line we will start copy
- dseg ends
- cseg segment para public 'code'
- assume cs:cseg, ds:dseg
- Main proc
- mov ax, dseg
- mov ds, ax
- mov ax,0b800h ;B800 is the video memory adress
- mov es,ax ;move that adress to es
- ;es stands for "extra segment"
- mov cx, 2*80 ;2*80 we will copy 2 lines. Both with 80 columns
- xor bx, bx
- mov ax, 160 ;every video adress has a size of a word
- ;so we need to jump 160 columns (theory)
- mov bl, line ;then we want to start in third line, so multiply by three
- mul bl
- mov di, ax
- mov si, 15*160 ;this is to where we will copy the text. Line 15
- mov bl, 00100000b ;[0][010][0000]b -> binary (*see below)
- ciclo:
- mov bh, es:[di] ;get the text from screen
- mov es:[si], bh ;move the space to video adreess (in other words, write a space on screen)
- mov es:[si+1], bl ;change color
- add di, 2 ;every video adress have a size of word, so let's add 2
- add si, 2
- loop ciclo ;repeat until cx = 0, In every loop, cx is decremented
- mov ah,4CH
- int 21H
- main endp
- cseg ends
- end main
- ;the first 0 means static, if 1, text will be blinking
- ;the next 3 digits is for brackground color [000-111]
- ;the next 4 digits is for text color [000-1111]
- ;colors
- ;black 0000
- ;blue 0001
- ;gren 0010
- ;cyan 0011
- ;red 0100
- ;magenta 0101
- ;brown 0110
- ;light grey 0111
- ;dark grey 1000
- ;light blue 1001
- ;light green 1010
- ;light cyan 1011
- ;light red 1100
- ;light magenta 1101
- ;yellow 1110
- ;white 1111
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement