汇编语言编写金牌榜程序文档格式.docx
《汇编语言编写金牌榜程序文档格式.docx》由会员分享,可在线阅读,更多相关《汇编语言编写金牌榜程序文档格式.docx(15页珍藏版)》请在冰豆网上搜索。
FLAGDW0
dataends
codesegment
mainprocfar
assumecs:
code,ds:
data
start:
pushds
xorax,ax
pushax
movax,data
movds,ax
ma:
CALLCRLF
leadx,string
movah,9
int21h
leadx,xzzifu
movah,1
cmpal,31h
jzcsh
cmpal,32h
jzshuru
cmpal,33h
jzpaixu
cmpal,34h
jzshuchu
cmpal,35h
jzexit
jmpma
csh:
movcx,15
movdl,30h
moval,30h
leabx,country_name
csh1:
movbyteptr[bx],41h
mov[bx+1],al
mov[bx+2],dl
addbx,10
incdl
cmpdl,3Ah
jnzcsh2
incal
csh2:
loopcsh1
movbyteptr[bx],'
Z'
movbyteptr[bx+1],'
H'
movbyteptr[bx+2],'
J'
movcx,64
movbx,0
csh3:
movarray[bx],0
addbx,2
loopcsh3
shuru:
CALLCRLF
leadx,SRst2
movcx,4
leasi,ls_name
leadi,ls_shu
CALLCREE1
next:
mov[si],al
mov[si+1],al
mov[si+2],al
CALLCREE18
calljieshoushuju
mov[di],bx
CALLCREE30
mov[di+2],bx
CALLCREE42
mov[di+4],bx
addsi,10
adddi,6
callcrlf
loopnext
MOVSUM,0
LEASI,LS_NAME;
CHAXUN
zjxcha:
pushcx
pushsi
leadi,country_name
jxcha:
moval,[si]
cmpal,'
K'
JZBUDENG
cmpal,[di]
jzcha1
jxc:
ADDDI,10
LOOPjxcha
cha1:
MOVAL,[SI+1]
CMPAL,[DI+1]
JNZjxc
MOVAL,[SI+2]
CMPAL,[di+2]
ADDDI,2
MOVAX,DI;
XIANGDENGLEIJIAJINYINGTONG
LEAdi,country_name
subax,di
movdx,0
movcx,10
divcx
movcl,3
salax,cl
LEABX,ARRAY
addbx,ax
leasi,ls_shu
ADDSI,SUM
ADDSUM,6
movax,[si]
add[bx],ax
movax,[si+2]
add[bx+2],ax
movax,[si+4]
add[bx+4],ax
budeng:
popsi
popcx
loopzjxcha
leasi,array
xorbx,bx
xordx,dx
TJ:
xordi,di
adddi,[si]
adddi,[si+2]
adddi,[si+4]
mov[si+6],di
addax,[si]
addbx,[si+2]
adddx,[si+4]
addsi,8
LOOPTJ
mov[si],ax
mov[si+2],bx
mov[si+4],dx
addax,bx
addax,dx
mov[si+6],ax
movsum,ax
ZTJ:
ADDAX,[SI+6]
LOOPZTJ
CMPax,sum
jzjma
LEADX,ERR
jma:
JMPMA
paixu:
movdi,14
lp1:
movcx,di
movsi,0
lp2:
movax,array[bx]
cmpax,array[bx+8]
jgcont
jzlp3
calljh4
jmpcont
lp3:
movax,array[bx+2]
cmpax,array[bx+10]
jzlp4
lp4:
movax,array[bx+4]
cmpax,array[bx+12]
jgecont
cont:
addbx,8
looplp2
decdi
jnzlp1
jh4procnear
nextzf:
movdl,country_name[si]
xchgcountry_name[si+10],dl
movcountry_name[si],dl
incsi
loopnextzf
movsi,bx
nextsj:
movdx,array[si]
xchgdx,array[si+8]
movarray[si],dx
addsi,2
loopnextsj
ret
jh4endp
shuchu:
leadx,SCst1
movcx,11
movsi,-10
movdi,0
next3:
CMPCX,1
jnzjxnext
movsi,150
movdi,120
jxnext:
cmparray[di+6],0
JZSJJS
movcx,10;
10geguojiaming
next2:
movdl,country_name[si]
cmpdl,20h
jzjj
movah,2
jj1:
loopnext2
jj:
callcree18
movbx,array[di]
CMPBX,0
JGSCSJ1
CALLKG0
JMPSJ2
SCSJ1:
callbtod
calllx
SJ2:
movbx,array[di+2]
JGSCSJ2
JMPSJ3
LSGD:
JMPNEXT3
SCSJ2:
SJ3:
movbx,array[di+4]
JGSCSJ3
JMPSJ4
SCSJ3:
SJ4:
movbx,array[di+6]
JGSCSJ4
JMPSJJS
SCSJ4:
SJJS:
adddi,8
loopLSGD
MOVAH,1
INT21H
exit:
CREE1PROCNEAR
PUSHDX
MOVDH,24
MOVDL,0
MOVBH,0
MOVAH,2
INT10H
POPDX
RET
CREE1ENDP
CREE18PROCNEAR
MOVDL,18
CREE18ENDP
CREE30PROCNEAR
MOVDL,30
CREE30ENDP
CREE42PROCNEAR
MOVDL,42
CREE42ENDP
jieshoushujuprocnear
mov