LEX 'BEEPLEX' file name TITLE BEEPLEX, John R Baker ID #5E last scratch, tokens 1>4 MSG 0 no message table POLL POLHND poll handler execution code *********************************************************** * BP+C EQU #0EB40 system level noise making CHIRP EQU #0EC5A machine code quick beep OUTELA EQU #05303 return from decompile NXTSTM EQU #08A48 all legal execution return * * * *********************************************************** EJECT ENTRY CHIRPS CHAR #D ENTRY MGUNS CHAR #D ENTRY SINGST CHAR #D ENTRY ZAPST CHAR #D EJECT *********************************************************** KEY 'CHIRP' machine 'chirp' TOKEN 1 KEY 'MGUN' makes 'phasor' sound TOKEN 2 KEY 'SING' tone swept upward TOKEN 3 KEY 'ZAP' tone swept down TOKEN 4 ENDTXT end of text table *********************************************************** EJECT * following is keyword execution code *---------------------------------------------------------- * the following is a machine code chirp * REL(5) dBPLEX decompile routine offset REL(5) pBPLEX parse offset CHIRPS SETHEX needed by chirp routine GOSBVL CHIRP go use mainframe subroutine GOVLNG NXTSTM return to BASIC loop * *********************************************************** * the following is a upward freq sweep REL(5) dBPLEX REL(5) pBPLEX SINGST SETHEX needed by BP+C C=0 W for LC LCHEX 1A duration in hex msec R0=C temp storage LCHEX 2F freq in hex Hz R1=C temp storage SINGLP C=R1 loop start P= 2 increment freq by 256d C=C+1 P increment GOC SINGEX exit on overflow R1=C store new freq D=C W freq in D(A) for BP+C C=R0 dur in C(A) for BP+C GOSBVL BP+C go make noise GOTO SINGLP loop again SINGEX GOVLNG NXTSTM return to BASIC loop *********************************************************** EJECT * the following gives a falling tone and low beep REL(5) dBPLEX REL(5) pBPLEX ZAPST SETHEX P= 0 C=0 W LCHEX 1A hex duration in mS R0=C LCHEX F8F hex frequency in Hz R1=C ZAPLP C=R1 get current freq P= 2 decrement by 256d C=C-1 P GOC ZAPEXT exit on passing 0 R1=C store current freq D=C W C=R0 get duration GOSBVL BP+C make that noise! GOTO ZAPLP for another round ZAPEXT P= 0 C=0 A LCHEX 8F frequency D=C A LCHEX 200 duration GOSBVL BP+C more noise making GOVLNG NXTSTM return to BASIC *********************************************************** EJECT * the following is a 'phasor' sound REL(5) dBPLEX decompile address REL(5) pBPLEX MGUNS SETHEX needed by chirp P= 0 for following LC C=0 A clean start LCHEX 6 1+ the number of chirps R0=C store initial counter value MGUNL C=R0 loop entry, recall counter ?C=0 A is counter equal to zero ? GOYES MGUNE if yes then go to exit C=C-1 A decrement counter R0=C store new counter value GOSBVL CHIRP machine code chirp GOTO MGUNL go to loop MGUNE GOVLNG NXTSTM exit to BASIC loop *********************************************************** EJECT * following is the poll handler execution code * D(A) relative position in LEX buffer * B(A) is poll process number * R2 is AVMEMS * R3 is STKPTR * HEX mode assumed * P= 0 on entry * must exit with carry clear * * POLHND ?B=0 B VER$ poll ? GOYES VER0 yes ? then go process GONC VER1 no ? then exit carry clear VER0 C=R3 STKPTR to C D1=C STKPTR to D1 A=R2 AVMEMS to A D1=D1- (Ven)-(Vst)-2 allow for added string CD1EX STKPTR back to C ?A>C A AVMEMS and MTHSTK overlap ? GOYES VER1 yes, then exit D1=C STKPTR to D1 R3=C STKPTR to R3 for exit time Vst LCASC ' Beep:A' my VER$ response Ven DAT1=C (Ven)-(Vst)-2 add to VER$ on MTHSTK VER1 RTNSXM exit this whole mess *********************************************************** * * the following will decompile everything that has no parse * except for the keyword (there are no parameters) * * dBPLEX GOVLNG OUTELA keeps decompile driver sober * *********************************************************** * pBPLEX RTNCC parse for keywords with no parameters has * only to return with carry clear * ************************************************************ * END