* PTDOS Memory bank select routine * use with Cromemco bank select system * By Tom M Quinn 6/15/79 COPY NPTDEFS get system definitions ORG CXBUF command execution buffer XEQ START execution address START MVI A,PSOPT read chrs until delimiter LXI D,BUFPS point to buffer CALL PSCAN parameter scanner JC ERRPS field syntax error JZ ERRSY syntax error CPI ';' valid delimiter? JZ OKDEL yes, cont CPI 0DH CR is valid also JNZ ERRSY syntax error OKDEL MOV A,C # of characters scanned CPI 1 just one? JNZ ERRSY no, syntax error * LDA BUFPS get character scanned MVI B,01H start with bank 0 select bit CPI '0' bank 0? JZ OUTB yes MVI B,02H no, try bank 1 CPI '1' match? JZ OUTB yes MVI B,04H no, try bank 2 CPI '2' match? JZ OUTB yes MVI B,08H no, try bank 3 CPI '3' match? JZ OUTB yes MVI B,10H no, try bank 4 CPI '4' match? JZ OUTB yes MVI B,20H no, try bank 5 CPI '5' match? JZ OUTB yes MVI B,40H no, try bank 6 CPI '6' match? JZ OUTB yes MVI B,80H no, try bank 7 CPI '7' match? JNZ ERRSY no, must be an error OUTB MOV A,B get bank bit back OUT 40H bank select port CALL SYS system call, all done DB RETOP normal return to system * parameter scanner error handler ERRPS MOV A,E move error code STA ERRCD store it * syntax utility error handler ERRSY MVI A,0 control word LXI H,-1 no 2nd line message CALL UTIL system utility call DB UXOP explain error JMP ABORT error return DB -1 no operation code ERRCD DB 2AH command syntax error message unless patched * drastic error handler ABORT CALL SYS system call, normal return, not used DB RESOP return to DOS and reset all BUFPS DS 20 parameter scanner buffer END