Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .8086
- .model small
- .stack 2048
- dseg segment para public 'data'
- diagonal1 db 24 dup('*')
- diagonal2 db 24 dup('*')
- 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"
- ;diagonal from left to righ
- mov bl, 00100000b ;green background
- xor si, si ;leftmost in screen
- xor di, di
- mov cx, 24 ;number o lines
- ciclo:
- mov bh, diagonal1[di]
- mov es:[si], bh ;copy char in vector
- mov es:[si+1], bl ;set background green
- inc di
- ;you know, every line has 80 columns, but in video memory
- ;it's 160.
- add si, 162 ;add one line and one column
- loop ciclo
- ;diagonal from right to left
- mov bl, 01000000b ;red background
- mov si, 158 ;leftmost in screen
- xor di, di ;rightmost in screen
- mov cx, 24 ;number o lines
- ciclo2:
- mov bh, diagonal2[di]
- mov es:[si], bh ;copy char in vector
- mov es:[si+1], bl ;set background red
- inc di
- ;you know, every line has 80 columns, but in video memory
- ;it's 160.
- add si, 158 ;add one line and subtract one column
- loop ciclo2
- 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