PAGE 01 DAI FIRMWARE DAD4-DB6E V1.1 002 ORG :DAD4 003 * 004 * 005 * 006 * ================ 007 *** PRINT ROUTINES *** 008 * ================ 009 * 010 * 011 ***************** 012 * PRINT MESSAGE * 013 ***************** 014 * 015 * Prints a message, which may include internal 016 * references to other submessages. 017 * 018 * Entry: Pointer to message in HL. 019 * Exit: Pointer after string in HL. Other 020 * registers preserved. 021 * 022 * Message format: A series of bytes: 023 * 00 End of string. 024 * 01-7F Printed character. 025 * >= 80 bit 14 set: 026 * bits 0-13 are offset in program of 027 * a message (char. terminated by a 0). 028 * bit 14 unset: 029 * bits 0-13 are offset in program of 030 * a string (1 byte length + char.). 031 * 032 DAD4 F5 PMSG PUSH PSW 033 DAD5 7E PMS10 MOV A,M Get character 034 DAD6 23 INX H Points to next char. 035 DAD7 B7 PMS15 ORA A Check char. 036 DAD8 CAE4DA JZ :DAE4 If end message 037 DADB FAE6DA JM :DAE6 If submessage reference 038 DADE CD60DD CALL :DD60 Print character in A 039 DAE1 C3D5DA JMP :DAD5 Next 040 * 041 DAE4 F1 PMS20 POP PSW End message 042 DAE5 C9 RET 043 044 * Submessage reference: 045 046 DAE6 FEC0 PMS30 CPI :C0 047 DAE8 E5 PUSH H 048 DAE9 6E MOV L,M Lobyte in L 049 DAEA DAF6DA JC :DAF6 If reference to string 050 DAED 67 MOV H,A BASE is at location C000 051 DAEE CDD4DA CALL :DAD4 Print submessage 052 DAF1 E1 PMS35 POP H 053 DAF2 23 INX H 054 DAF3 C3D5DA JMP :DAD5 Next character 055 056 * String reference: 057 058 DAF6 C640 PMS40 ADI :40 (BASE SHR 8) - #80 059 DAF8 67 MOV H,A Hibyte in H 060 DAF9 CD32DB CALL :DB32 Print substring pntd by HL 061 DAFC C3F1DA JMP :DAF1 Next character 062 * 063 * PAGE 02 DAI FIRMWARE DAD4-DB6E V1.1 064 ******************************************** 065 * PRINT MESSAGE POINTED TO BY NEXT 2 BYTES * 066 ******************************************** 067 * 068 * Entry: Top of stack points to the address where 069 * the address of the message can be found. 070 * Exit: AFBCDEHL preserved. 071 * Returnaddress on stack. 072 * 073 DAFF E3 PMSGR XTHL Get pntr from stack 074 DB00 D5 PUSH D 075 DB01 5E MOV E,M Get lobyte address 076 DB02 23 INX H 077 DB03 56 MOV D,M Get hibyte address 078 DB04 23 INX H 079 DB05 EB XCHG Addr message in HL 080 DB06 CDD4DA CALL :DAD4 Print message 081 DB09 EB XCHG HL pnts after message pntr 082 DB0A D1 POP D 083 DB0B E3 XTHL Restore stack 084 DB0C C9 RET 085 * 086 ************************ 087 * CURSOR TO NEXT FIELD * 088 ************************ 089 * 090 * Part of 'run PRINT' (0E2B3). 091 * Moves the cursor to a new number output field. 092 * The field size is 12 character positions; field 093 * positions: 0,12,24,36,48. 094 * 095 DB0D EF PSKP RST 5 Ask cursor position 096 DB0E 0C DATA :0C and size character screen 097 DB0F 7D MOV A,L X-coord in L 098 DB10 FE30 CPI :30 Already past last field? 099 DB12 D227DB JNC :DB27 Then print car.ret, abort 100 DB15 D60C PSK10 SUI :0C ) Minus 12 untill underflow 101 DB17 D215DB JNC :DB15 ) 102 DB1A 2F PSK15 CMA Restore pos. value 103 DB1B 3C INR A 104 105 * Entry from 'SFC' function: 106 107 DB1C 57 PSK20 MOV D,A Store nr of spaces required 108 DB1D 3E20 PSK30 MVI A,:20 109 DB1F CD60DD CALL :DD60 Print space 110 DB22 15 DCR D Ready? 111 DB23 C21DDB JNZ :DB1D Next space if not 112 DB26 C9 RET 113 * 114 DB27 C35EDD PSK40 JMP :DD5E Print car.ret 115 * 116 ******************** 117 * CURSOR TO TAB(8) * 118 ******************** 119 * 120 * Part of 'List current line' (0ECB3). 121 * Moves cursor to column 8 after linenumber. 122 * 123 * Exit: BC preserved. AFDEHL corrupted. 124 * 125 PAGE 03 DAI FIRMWARE DAD4-DB6E V1.1 126 *SCTAB 127 DB2A EF PTAB RST 5 Ask cursor position and 128 DB2B 0C DATA :0C size character screen 129 DB2C 7D MOV A,L X-coord after linenr in A 130 DB2D D606 SUI :06 Tab must be 8 131 DB2F C31ADB JMP :DB1A Print additional spaces 132 * 133 **************** 134 * PRINT STRING * 135 **************** 136 * 137 * Prints a string of characters pointed to by HL. 138 * 139 * Entry: HL points to string. 140 * Exit: HL points after string. 141 * Other registers preserved. 142 * 143 * String format: 144 * 1 byte length (0 = no data). 145 * N bytes data. 146 * 147 *SCSTR 148 DB32 F5 PSTR PUSH PSW 149 DB33 C5 PUSH B 150 DB34 46 MOV B,M String length in B 151 DB35 23 PST10 INX H 152 DB36 78 PST20 MOV A,B Get length 153 DB37 D601 SUI :01 Minus 1 154 DB39 47 MOV B,A Nr. char still to be printed 155 DB3A 7E MOV A,M Get char 156 DB3B D495D6 CNC :D695 Print character if not ready 157 DB3E D235DB JNC :DB35 Next one if not ready 158 DB41 C1 POP B 159 DB42 F1 POP PSW 160 DB43 C9 RET 161 * 162 ************************ 163 * PRINT STRING MESSAGE * 164 ************************ 165 * 166 * Prints a string of characters, pointed to by 167 * HL, length in A. 168 * 169 * Entry: HL: Points to string. 170 * A: Number of characters. 171 * Exit: HL: Points after string. 172 * AFBCDE preserved. 173 * 174 *SCSTM 175 DB44 F5 PSTRM PUSH PSW 176 DB45 C5 PUSH B 177 DB46 47 MOV B,A String length in B 178 DB47 C336DB JMP :DB36 Print string 179 * 180 ********************** 181 * PRINT A HEX NUMBER * 182 ********************** 183 * 184 * Converts MACC to hex in DECBUF and print it. 185 * 186 * Exit: HL points after string in DECBUF. 187 * BCDE preserved. AF corrupted. PAGE 04 DAI FIRMWARE DAD4-DB6E V1.1 188 * 189 DB4A CD2DC0 PHEX CALL :C02D Convert MACC for hex output 190 DB4D 2A33C0 PGP LHLD :C033 Get addr DECBUF 191 DB50 C332DB JMP :DB32 Print string in DECBUF 192 * 193 ************************** 194 * PRINT A INTEGER NUMBER * 195 ************************** 196 * 197 * Prints an integer number from MACC. 198 * 199 DB53 CD5FDB PINT CALL :DB5F Convert MACC for output 200 DB56 C34DDB JMP :DB4D Print contents DECBUF 201 * 202 ********************************* 203 * PRINT A FLOATING POINT NUMBER * 204 ********************************* 205 * 206 * Prints a FPT number from MACC. 207 * 208 DB59 CD9BCE PFPT CALL :CE9B Convert MACC for output 209 DB5C C34DDB JMP :DB4D Print contents DECBUF 210 * 211 *************************************** 212 * CONVERT MACC FOR FIXED POINT OUTPUT * 213 *************************************** 214 * 215 * Places ASCII-equivalent in 00E4-F0, digits before 216 * decimal point in 00F1, length in 00E3. 217 * 218 * Exit: A: Number of digits. 219 * BCDEHL preserved. 220 * 221 DB5F CD27C0 IBCP CALL :C027 Convert INT for output 222 DB62 C5 PUSH B 223 DB63 0600 MVI B,:00 Can trim last dec. place 224 DB65 CD30C0 BPP CALL :C030 Tidy up into external form 225 DB68 C1 POP B 226 DB69 C9 RET 227 * 228 ******************************** 229 * (Not used, replaced by CE9B) * 230 ******************************** 231 * 232 DB6A 0601 LD216 MVI B,:01 ) Part of a previous version 233 DB6C C364DB JMP :DB64 ) 234 * 235 * 241 DB6F END *************************** * S Y M B O L T A B L E * *************************** BPP DB65 IBCP DB5F LD216 DB6A PFPT DB59 PGP DB4D PHEX DB4A PINT DB53 PMS10 DAD5 PMS15 DAD7 PMS20 DAE4 PMS30 DAE6 PMS35 DAF1 PMS40 DAF6 PMSG DAD4 PMSGR DAFF PSK10 DB15 PSK15 DB1A PSK20 DB1C PSK30 DB1D PSK40 DB27 PSKP DB0D PST10 DB35 PST20 DB36 PSTR DB32 PSTRM DB44 PTAB DB2A SCSTM DB44 SCSTR DB32 SCTAB DB2A