【導讀】LinkingtoVC++. Irvine. linker. time.Moreremarks. istheassembler.theshow.codesegment,datasegment,stacksegmentetc.resolve..modelsmall. .stack100h. .386. messagebyte0ah,0dh,"hello$". dsegends. externVar1:word,Var2:word,Proc1:near. assumecs:cseg,ds:dseg. mainproc. movax,dseg. movds,ax. movVar1,20. movVar2,45. callProc1. movdx,var1. movah,2. int21h. movdx,offsetmessage. movah,9. int21h. movax,4c00h. int21h. mainendp. CSEGends. endmain. sub. publicVar1,Var2,Proc1. Var1word?Var2word?DSEGends. assumecs:cseg,ds:dseg. Proc1procnear. movax,Var1. addax,Var2. movVar1,ax. ret. Proc1endp. CSEGends. end. C:\Masm615\Examples\ch08>ML/nologo-Zi-c-Fl-Sg. Assembling:. C:\Masm615\Examples\ch08>linkmainsub. RunFile[]:. ListFile[]:. Libraries[.lib]:. DefinitionsFile[]:. C:\Masm615\Examples\ch08>main. A. hello. C:\Masm615\Examples\ch08>. .modelsmall. .data. .code. publicconcat. concatproc. cld. movdi,segfinalstring. moves,di. movdi,offsetfinalstring. movsi,ax. s1loop:. lodsb. andal,al. jzdos2. stosb. jmps1loop. dos2:. movsi,bx. s2loop:lodsb. stosb. andal,al. jnzs2loop. ret. concatendp. end. Mainfor2ndexample. .modelsmall. .stack100h. .data. s2byte'world',0ah,0dh,'$',0. publicfinalstring. .code. externconcat:proc. mainproc. movax,@data. movds,ax. movax,offsets1. movbx,offsets2. callconcat. movah,9. movdx,offsetfinalstring. int21h. movax,4c00h. int21h. mainendp. endmain. Ass