MDrive Example Program
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | 'MDRIVE DEMO PROGRAM 'Last modified 08/25/2016 'Sample test program for demonstration purposes only 'Not tested or verified for safety or any function CP 'preclear program memory 'Integer Math Only (No Decimals) 'CODE DESCRIPTION VA V1=10 'declare variables VA V2=3 VA V3 PG 1 'enter program mode at address 1 LB aa 'label aa V3=V1+V2 'add V1+V2,put in V3 PR "V3= " V3 'print V3 to term H 1000 'hold execution for 1000 mSec V3=V1*V2 'multiply V1*V2,put in V3 PR "V3= " V3 'print V3 to term H 1000 'hold execution for 1000 mSec V3=V1/V2 'divide V1/V2,put in V3 PR "V3= " V3 'print V3 to term E 'end program PG 'exit program mode '***************************************************** 'type <ex 1> to run program 'program action 'V3=V1+V2 produces an answer of 13 'V3=V1*V2 produces an answer of 30 'V3=V1/V2 produces an answer of 3 'try typing different values of V1 and V2 and "ex aa" 'V1=35<enter> 'V2=4<enter> 'EX aa<enter> 'results 'V3=V1+V2=39 'V3=V1*V2=140 'V3=V1/V2=8 |