assembly - The codes below for printing calendar is working for texted mode. How can i make this calendar working in video mode? -
.model small .data instexit db "press key exit $" ;instant exit navb db "press b end or n next month: $" ;navigation instruction of january month nav db "press b previous month or n next month: $" ;navigation instruction of months between january , december nave db "press b previous month or n end: $" ;navigation instruction of december month ; setting of value 0 greeting db "welcome 2015 calendar$" ;greetings message displayed in beginning ------- jan db " january$ " ;whole january month string db "sun mon tue wed thu fri sat$" ;prints day string , string used througout months string1 db " 1 2 3$" string2 db " 4 5 6 7 8 9 10$" string3 db "11 12 13 14 15 16 17$" string4 db "18 19 20 21 22 23 24$" string5 db "25 26 27 28 29 30 31$" ; taking out other strings month due character limitation here .code .386 mov ax,@data mov ds,ax mov ax,0003h ;setting screen 80*25 int 10h mov ah,02h mov bh,00 mov dh,1 mov dl,25 int 10h lea dx,greeting ; load & display string call print call nline ;function next line call january ;prints whole january month mov cx,1 ;counter navigation command: mov ah,1h ;user input int 10h ; ;calling interrupt handler cmp al,'n' ;comparing button user pressed jz ;jumping function cx addition 1 cmp al,'b' ;comparing button user pressed jz down ;jumping function cx subtraction 1 ending: mov ax,4c00h int 21h up: inc cx ;added 1 cx watching next month jmp navigate ;jumping display desired calendar down: dec cx ;subtracting 1 cx watching previous month jmp navigate ;jumping display desired calendar navigate: cmp cx,1 jz m1 ;jumping print january ; similar function has been taken due space issues cmp cx,0 jz ending ;end program cmp cx,13 jz ending ;end program m1: call clr ;clear out screen call nline ;prints next line call january ;print whole january month jmp command ; similar month function has been taken due space issues clr: ;clears screen mov ax,0003h int 10h ret nline: ;prints next line mov ah, 2 ;carriage return mov dl, 0dh int 10h ; mov dl, 0ah ;line feed int 10h ; ret print: ;prints string mov ah,9 int 10h ; ret color1: ;assigning color string mov ax,0920h mov bx,0047h ;white on red mov cx,30 int 10h ret color2: ;assigning color string mov ax,0920h mov bx,0021h ;blue on green mov cx,30 int 10h ret january: ;prints whole januarty month push cx mov ah,02h mov bh,00 mov dh,2 mov dl,25 int 10h call color1 lea dx,jan ; load & display string call print call nline ;prints next line mov ah,02h mov bh,00 mov dh,3 mov dl,25 int 10h call color2 lea dx, string ; load & display string call print ;prints next line call nline ;prints next line mov ah,02h mov bh,00 mov dh,4 mov dl,25 int 10h call color2 lea dx, string1 ; load & display string call print call nline ;prints next line mov ah,02h ;changing rows , columns , bring center mov bh,00 mov dh,5 ;shifting row mov dl,25 ;shifting column int 10h call color2 lea dx, string2 ; load & display string call print call nline ;prints next line mov ah,02h mov bh,00 mov dh,6 mov dl,25 int 10h call color2 lea dx, string3 ; load & display string call print call nline ;prints next line mov ah,02h mov bh,00 mov dh,7 mov dl,25 int 10h call color2 lea dx, string4 ; load & display string call print call nline ;prints next line mov ah,02h mov bh,00 mov dh,8 mov dl,25 int 10h call color2 lea dx, string5 ; load & display string call print call nline ;prints next line call nline ;prints next line lea dx,instexit ;instructions instant exit call print call nline lea dx,navb call print pop cx ret ; similar month functions has been taken due space issues end
command: mov ah,1h ;user input int 10h ; ;calling interrupt handler nline: ;prints next line mov ah, 2 ;carriage return mov dl, 0dh int 10h ; mov dl, 0ah ;line feed int 10h ; ret print: ;prints string mov ah,9 int 10h ; ret
in above code have change every occurence of int 10h
int 21h
. remember using dos functions.
to answer question. once program works in text video mode work in graphics video mode. legacy video modes, numbers 1 19.
Comments
Post a Comment