gpt4 book ai didi

assembly - 不知道如何一次打印整个日历

转载 作者:行者123 更新时间:2023-12-01 23:45:33 25 4
gpt4 key购买 nike

<分区>

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

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com