1PROCENDPNEARFARNEAR1NEAR2FAR2PROCENDP31FAR2MAINPROCFAR…CALLSUBR1…RETMAINENDPSUBR1PROCNEAR…RETSUBR1ENDPMAINPROCFAR…CALLSUBR1…RETSUBR1PROCNEAR…RETSUBR1ENDPMAINENDPCALLRETSEGXSEGMENT…SUBTPROCFAR…RETSUBTENDP…CALLSUBT…SEGXENDSSEGYSEGMENT…CALLSUBT…SEGYENDSCALLDSTRETDST,JMPIPEIPCSIPEIPJMPJMPLLLLCALLLLLLPROCFARRET1CALLDSTCALLCALLDSTDSTIPEIPDSTIPEIPCALLWORDPTR[BX]CALLBXRET2RETCALLDSTRETRETIPEIPRETRETEXP1RETEXP2IPEIPSPESPSPESPSPESP+EXPMAINPRO_APRO_BPRO_CMAINCALLFARPTRPRO_A(IP)=1000(CS)=0500PRO_ACALLNEARPTRPRO_B(IP)=2500CALLNEARPTRPRO_C(IP)=3700RETPRO_ACALLNEARPTRPRO_B(IP)=2500CALLNEARPTRPRO_C(IP)=3700RETPRO_BCALLNEARPTRPRO_C(IP)=4000RETPRO_CRETCALLRET(1)(2)PROADDDATASEGENTARYDW100DUPCOUNTDW100SUMDWDATAENDSCODESEGMENTMAINPROCFARASSUMECSCODEDSCODESTART…CALLPROADD…RETMAINENDPCODEENDSENDSTART……PROADDPROCFARLEASIARYMOVCXCOUNTXORAXAXNEXTADDAX[SI]ADDSI2LOOPNEXTMOVSUMAXRETPROADDENDPPROADDARYDW100DUP(?)COUNTDW100SUMDWMAINPROCFARASSUMECSCODEDSCODESTARTCALLPROADDRETMAINENDPADDAXCXMOVDXAX……AXMAINPROCFARASSUMECSCODEDSCODESTARTCALLPROADDRETMAINENDPADDAXCXMOVDXAX……?PROADDPROCFARPROADDENDPPUSHAXPUSHCXPUSHSIPOPSIPOPCXPOPAX(1)RETPROADDPROCFARPROADDENDPPUSHAXPUSHCXPUSHSIPOPSIPOPCX(2)RET12123COMMONPUBLIC11AXAXPROADDPROCFARPROADDENDPPUSHAXPUSHCXPUSHSIPOPSIPOPCXPOPAXAXDATASEGENTARYDW100DUPCOUNTDW100SUMDWDATAENDSCODESEGMENTMAINPROCFARCALLPROADDRETMAINENDPNUMDW100DUPNDW100TOTALDW……2DATASEGENTARYDW100DUPCOUNTDW100SUMDWDATAENDSCODESEGMENTMAINPROCFARCALLPROADDRETMAINENDP…TABLEDW3DUP…2CODESEGMENTMAINPROCFARCALLPROADDRETMAINENDP……MOVTABLEOFFSETARYMOVTABLE+2OFFSETCOUNTMOVTABLE+4OFFSTESUMMOVBXOFFSETTABLESUMCOUNTARYBXTABLEPROADDPROCFARPROADDENDPPUSHAXPUSHCXPUSHSIPOPSIPOPCXPOPAXSUMCOUNTARYBXTABLERETPROADDPROCFARPROADDENDPMOVSI[BX]MOVDI[BX+2]MOVCX[DI]MOVDI[BX+4]……XORAXAXNEXTADDAX[SI]ADDSI2LOOPNEXTMOV[DI]AXSUMCOUNTARYBXTABLE123MAINPROCFARCALLPROADDRETMAINENDP…MOVBXOFFSETARYPUSHBXMOVBXOFFSETCOUNTPUSHBXMOVBXOFFSETSUMPUSHBX…3PROADDPROCFARPROADDENDPMOVSI[BP+0AH]MOVDI[BX+8]MOVCX[DI]MOVDI[BP+6]PUSHBPMOVBPSPPUSHAXPUSHCXPUSHSIPUSHDIRET6…ARYCOUNTSUMCSIPBPAX…BP2COMMONPUBLICPUBLIC[]EXTRN[]1;sourcemodule1Extrnvar2:word,lab2:farpublicvar1,lab1Data1segmentVar1db?Var3dw?Var4dw?Data1endsCode1segmentCode1endsEndstartModule1lab1;sourcemodule2Extrnvar1:byte,var4:wordpublicvar2Data2segmentVar2dw0Var3db5dup(?)Data2endsCode2segmentCode2endsEndModule2PUBLIC;sourcemodule3Extrnlab1:farpubliclab2,lab3Code3segmentCode3endsEndModule3EXTRNEXTRN2COMMONPUBLICPROCENDPCALLDSTRET(1)(2)12123COMMONPUBLIC