************************************************** * * * program for controlling the FREEDOM terminal * * By Ronald E. Jacobs. * * October 18, 1983 * * * ************************************************** ORG 100h BDOS EQU 05h ;BDOS entry point CR EQU 0Dh ;carriage return LF EQU 0Ah ;line feed MVI C,09h ;bdos console output string LXI D,LINE1 ;display menu on console CALL BDOS QUERY: MVI C,09h ;bdos console output string LXI D,ASK ;print 'CHOICE:' CALL BDOS INPUT: MVI C,0Ah ;bdos input string LXI D,BUFFLN ;read from console CALL BDOS MVI C,09h ;bdos console output string LDA CHARS ;number of characters entered at console CPI 1 ;1 character might be 1-9 JZ CH19 ;choices 1-9 CPI 2 ;2 characters might be 10-99 JZ CH1019 ;choices 10-99 WHAT LXI D,QUEST ;if not 1-99 then print '?' CALL BDOS JMP INPUT ;go look for next choice CH19: LDA CHAR1 ;first digit sent by user IF1 CPI '1' ;was it a '1' JNZ IF2 ;jump if not a '1' LXI D,ITS1 ;it was a '1' CALL BDOS JMP QUERY ;go get another choice from console IF2: CPI '2' ;was it a '2' JNZ IF3 ;jump if not a '2' LXI D,ITS2 ;it was a '2' CALL BDOS JMP QUERY ;go get another choice from console IF3: CPI '3' ;was it a '3' JNZ IF4 ;jump if not a '3' LXI D,ITS3 ;it was a '3' CALL BDOS JMP QUERY ;go get another choice from console IF4: CPI '4' ;was it a '4' JNZ IF5 ;jump if not a '4' LXI D,ITS4 ;it was a '4' CALL BDOS JMP QUERY ;go get another choice from console IF5: CPI '5' ;was it a '5' JNZ IF6 ;jump if not a '5' LXI D,ITS5 ;it was a '5' CALL BDOS JMP QUERY ;go get another choice from console IF6: CPI '6' ;was it a '6' JNZ IF7 ;jump if not a '6' LXI D,ITS6 ;it was a '6' CALL BDOS JMP QUERY ;go get another choice from console IF7: CPI '7' ;was it a '7' JNZ IF8 ;jump if not a '7' LXI D,ITS7 ;it was a '7' CALL BDOS JMP QUERY ;go get another choice from console IF8: CPI '8' ;was it an '8' JNZ IF9 ;jump if not a '8' LXI D,ITS8 ;it was a '8' CALL BDOS JMP QUERY ;go get another choice from console IF9: CPI '9' ;was it a '9' JNZ WHAT ;if not a '9' then what was it ? LXI D,ITS9 ;it was a '9' CALL BDOS JMP QUERY ;go get another choice from console CH1019: LDA CHAR1 ;1st character typed at terminal CPI '1' ;in the 10's range ? JNZ CH2029 ;if not in 10's then in 20's ? LDA CHAR2 ;2nd character typed at terminal IF10: CPI '0' ;was it a '0' JNZ IF11 ;jump if not a 10 LXI D,ITS10 ;it was a '0' CALL BDOS JMP QUERY ;go get another choice from console IF11 CPI '1' ;was it a '1' JNZ IF12 ;jump if not a '11' LXI D,ITS11 ;it was a '1' CALL BDOS JMP QUERY ;go get another choice from console IF12: CPI '2' ;was it a '2' JNZ WHAT ;jump if not a '12' LXI D,ITS12 ;it was a '2' CALL BDOS JMP QUERY ;go get another choice from console ;IF13: CPI '3' ;was it a '3' ; JNZ IF14 ;jump if not a '13' ; LXI D,ITS13 ;it was a '3' ; CALL BDOS ; JMP QUERY ;go get another choice from console ; ;IF14: CPI '4' ;was it a '4' ; JNZ IF15 ;jump if not a '14' ; LXI D,ITS14 ;it was a '4' ; CALL BDOS ; JMP QUERY ;go get another choice from console ; ;IF15: CPI '5' ;was it a '5' ; JNZ IF16 ;jump if not a '15' ; LXI D,ITS15 ;it was a '5' ; CALL BDOS ; JMP QUERY ;go get another choice from console ; ;IF16: CPI '6' ;was it a '6' ; JNZ IF17 ;jump if not a '16' ; LXI D,ITS16 ;it was a '6' ; CALL BDOS ; JMP QUERY ;go get another choice from console ; ;IF17: CPI '7' ;was it a '7' ; JNZ IF18 ;jump if not a '17' ; LXI D,ITS17 ;it was a '7' ; CALL BDOS ; JMP QUERY ;go get another choice from console ; ;IF18: CPI '8' ;was it an '8' ; JNZ IF19 ;jump if not a '18' ; LXI D,ITS18 ;it was a '8' ; CALL BDOS ; JMP QUERY ;go get another choice from console ; ;IF19: CPI '9' ;was it a '9' ; JNZ QUEST ;if not a '19' then what was it ? ; LXI D,ITS19 ;it was a '9' ; CALL BDOS ; JMP QUERY ;go get another choice from console CH2029: JMP WHAT LINE1: DB CR,LF,' xon/xoff 1=OFF 2=ON' DB CR,LF,' status line 3=OFF 4=ON' DB CR,LF,' bell 5=OFF 6=ON' DB CR,LF,' keyclick 7=OFF 8=ON' DB CR,LF,' cursor 9=OFF 10=BLOCK' DB CR,LF,' cursor blink 11=UNDERLINE 12=BLOCK' DB CR,LF,' ^C= return to CP/M',CR,LF,LF,'$' ASK: DB 'CHOICE: ',CR,'CHOICE:$' QUEST: DB ' ?',CR,'CHOICE:$' BUFFLN: DB 10 ;max number of characters buffer holds CHARS: DS 1 ;number of characters entered at console CHAR1: DS 1 ;choice entered at console(1st character) CHAR2: DS 1 ; (2nd character) DS 10 ;space for rest of buffer ITS1: DB 0Eh,'$' ;turn on XON/XOFF ITS2: DB 0Fh,'$' ;turn off XON/XOFF ITS3: DB 1Bh,'g$' ;turn off STATUS LINE ITS4: DB 1Bh,'h$' ;turn on STATUS LINE ITS5: DB 1Bh,'_$' ;turn off BELL ITS6: DB 1Bh,'^$' ;turn on BELL ITS7: DB 1Bh,'<$' ;KEYCLICK off ITS8: DB 1Bh,'>$' ;KEYCLICK on ITS9: DB 1Bh,'.1$' ;CURSOR not displayed ITS10: DB 1Bh,'.0$' ;CURSOR is a steady block ITS11: DB 1Bh,'.3$' ;CURSOR is a blinking underline ITS12: DB 1Bh,'.2$' ;CURSOR is a blinking block END