CON _clkmode = xtal1 + pll16x _xinfreq = 5_000_000 'QUICKSTART 80 MHZ NORMAL CRYSTAL var long dividend 'VARIABLE IN THE PAR ADDRESS TO BE PASSED long divisor long quotient long remainder obj pst : "parallax serial terminal" pub main dividend := 35 divisor := 3 pst.start(115200) waitcnt(clkfreq*5 + cnt) 'hold five sec to open the 'serial terminal and enable it cognew(@asm,@dividend) 'start cog at the first variable address waitcnt(clkfreq + cnt) 'give top object time to catch up to pasm pst.str(string("quotient:")) pst.dec(quotient) pst.newline pst.str(string("remainder:")) pst.dec(remainder) pst.newline dat {{ NOTE: I have removed three mov commands as I have been shown that they are unnessary each "add tempvar,#4" points to the next variable. I got that from the NUTS AND VOLTS and appears that that may not be necessary.}} asm org mov tempvar, par 'get the par address into the temporary variable rdlong x, tempvar 'read the value into the dividend add tempvar, #4 'move over to the next long to get the divisor variable rdlong y, tempvar 'read the value of the divisor into the variable add tempvar, #4 'move over to the next long to get the quotient address call #divide '<<<