rem First Assembly Prog .... Rev 1.0 rem A J Tooth // 1st November 2003 (Debugged May 2004!!) rem Make space for the Assembly Program and Variables mode 22 : cls dim code% 1000, a% 3, b% 3, c% 3, d% 3, e% 3 dim sa% 3,sb% 3,sc% 3,sd% 3, trl% 0 rem Dual-pass assembly, in case of labels for i%=1 to 3 step 2 proc_ass(i%) a$=get$ next i% cls:print:print " Ready to roll!! Press any key to continue." a$=get$ ?trl%=rnd(15) print:input " Enter a +ve number",!a% print:input " Enter a second +ve number",!b% rem Call the Assembly routine located at "code%" call(code%) print:print " This is colour code : ";?trl% print:print " The sum of ";!a%;" and ";!b%;" is ...";!c% print:print " Shifting the result right gives ...";!d% print:print " Multiplying the result by 6 gives ...";!e% end rem End of Program ++++++++++++++++++++++++++++++++++++++++ def proc_ass(opt%) P%=code% [opt opt% mov eax,[a%] add eax,[b%] mov [c%],eax sar eax,1 mov [d%],eax mov eax,[c%] mul dword [dta%] mov [e%],eax mov al,[vdcode%] call "oswrch" mov al,[trl%] call "oswrch" jmp over .dta% db 6 db 0 db 0 db 0 .vdcode% db 17 .over ret ] endproc