2
cseg segment
assume cs:cseg, ds:cseg
org 100H
begin:
mov es,cs:[video]
mov ax,3
int 10h
mov cs:[col],0fh
mov di,10 ;greeting msg will be printed after 10 spaces
lea si,greeting
call mess
call nline
call jan
call nline
mov ah,4ch
int 21h
col db 0
greeting db "Welcome to the 2015 Calendar ",0
video dw 0b800h
january db " January$",
string db "Sun Mon Tue Wed Thu Fri Sat$"
string1 db " 1 2 3 4 5$"
string2 db " 6 7 8 9 10 11 12$"
string3 db "13 14 15 16 17 18 19$"
string4 db "20 21 22 23 24 25 26$"
string5 db "27 28 29 30 31$"
mess proc
push ax
mov ah,cs:[col]
mov bh, 30
conmess:
mov al,cs:[si]
or al,al
jz endmess
mov es:[di],ax
mov es:[di+1],bh
inc si
add di,2
jmp conmess
endmess:
pop ax
ret
mess endp
nline proc
mov ah, 2 ; carriage return
mov DL, 0DH
int 21H
mov DL, 0AH ; line feed
int 21H
ret
nline endp
print:
;printing the line
mov bh,10h ;color attribute
mov ah,9
mov al,0 ;avoding extra characters
int 10h ;printing color
int 21h
ret
jan proc
lea dx,january ; load & display the STRIN
call print
call nline
lea dx, string ; load & display the STRING
call print
call nline
lea dx, string1 ; load & display the STRING
call print
call nline
lea DX, string2 ; load & display the STRING
call print
call nline
lea DX, string3 ; load & display the STRING
call print
call nline
lea DX, string4 ; load & display the STRING
call print
call nline
lea DX, string5 ; load & display the STRING
call print
call nline
ret
jan endp
cseg ends
end begin
非常感謝。但是,還有一件事我需要打印它的顏色。我遇到了麻煩。無論如何要用彩色高亮格式寫所有這些字符串? – 0ptimus 2015-04-05 16:01:48
我給輸出添加了顏色。 – 2015-04-05 18:12:18
謝謝此代碼完全工作 – 0ptimus 2015-04-05 23:29:28