PAGE 1 [3.3a] 6/28/89 17:45:18 ASSEMBLY OF GDC.TEXT PASS 1 COMPLETE. ERRORS: 0 1 * sccs info: @(#) gdc 8.1 84/05/04 00:17:09 * 2 PAGE 2 [3.3a] 6/28/89 17:45:18 EXTDC - GANGLIA DRIVERS (GDC) 5 ******************************************************************************** 6 * 7 * 8 * GANGLIA EXTDC 9 * 10 * 11 ******************************************************************************** 12 * 13 * 14 * Authors - Carl Dierschow / Tim Mikkelsen 15 * Phone - 303-226-3800 ext. 2910 16 * 17 * Date - 03/31/82 18 * Update - 05/04/82 Bob Morain/Tim Mikkelsen 19 * 20 * 21 * Modified by: Anny Randel 22 * Date: Dec. 27, 1983 23 * Purpose: Use timer when present 24 * 25 * NOTES: I assume here, correctly, I hope, that timeout(a4) is an 26 * integer that is a delay time in milliseconds 27 * 28 ******************************************************************************** 29 30 sprint 31 nosyms 32 llen 132 PAGE 3 [3.3a] 6/28/89 17:45:18 EXTDC - GANGLIA DRIVERS (GDC) 34 ******************************************************************************** 35 * 36 * 37 * The following lines are used to tell the LINKER/LOADER what this module 38 * looks like in PASCAL terms. 39 * 40 * Note that it is possible to create assembly modules that are functions. 41 * These routines are called through an indirect pointer using the CALL 42 * facility which does NOT permit functions. 43 * 44 * This module is called 'EXTDC' ( upper or lower case - doesn't matter ) 45 * independent of the file name ( by use of the MNAME pseudo-op ). 46 * 47 * All the externally used procedures are called 'EXTDC_@@@@@@@@' in 48 * this module. If you are using assembly to access them use the 49 * 'EXTDC_@@@@@@@' name. If you are using Pascal use the '@@@@@@@' 50 * name. 51 * 52 ******************************************************************************** 53 MNAME EXTDC 54 SRC MODULE EXTDC; 55 SRC EXPORT 56 SRC 57 SRC PROCEDURE enter_data ( temp : ANYPTR ; x : ANYPTR ; 58 SRC VAR c : INTEGER ); 59 SRC PROCEDURE output_data ( temp : ANYPTR ; x : ANYPTR ; 60 SRC cnt : INTEGER ); 61 SRC PROCEDURE output_end ( temp : ANYPTR ); 62 SRC 63 SRC FUNCTION gang_reset ( temp : ANYPTR ) : BOOLEAN; 64 SRC END; { of extdc } PAGE 4 [3.3a] 6/28/89 17:45:18 EXTDC - GANGLIA DRIVERS (GDC) 66 ******************************************************************************** 67 * 68 * SYMBOLS FOR EXPORT AS PROCEDURE NAMES 69 * 70 ******************************************************************************** 71 DEF EXTDC_EXTDC 72 73 DEF EXTDC_ENTER_DATA 74 DEF EXTDC_OUTPUT_DATA 75 DEF EXTDC_OUTPUT_END 76 DEF EXTDC_GANG_RESET 77 78 list PAGE 5 [3.3a] 6/28/89 17:45:18 GANGLIA BOOT - COMMON EQUATES AND DEFINITIONS (GDC) 81 ******************************************************************************** 82 * 83 * 84 * DRIVER TEMPS TEMPLATE 85 * 86 * OFFSET FROM A2 87 * 88 * HPL DECLARATIONS ( MODIFIED ) 89 * 90 * 91 ******************************************************************************** 92 0000 0000 C_ADR EQU 00 ..03 card address 93 0000 0004 TIMEOUT EQU 04 ..07 timeout value 94 * =0 : no timeout 95 * #0 : value of timeout 96 0000 0008 AVAIL_OFF EQU 08 ..135 98629 card ( 128 bytes ) PAGE 6 [3.3a] 6/28/89 17:45:18 GANGLIA BOOT - COMMON EQUATES AND DEFINITIONS (GDC) 98 ******************************************************************************** 99 * 100 * EXTERNAL REFERANCES for escape 101 * 102 ******************************************************************************** 103 REFA sysglobals 104 104 105 ******************************************************************************** 106 * 107 * EXTERNAL REFERENCES FOR TIMER ROUTINES 108 * 109 ******************************************************************************** 110 111 REFA start_timer,check_timer,delay,milli_to_micro 112 113 ******************************************************************************** 114 * 115 * Define constants for timer routines 116 * 117 ******************************************************************************** 118 119 FFFF FEDA sysflag2 equ $FFFFFEDA location of sysflag2 120 0000 0001 timer_absent equ 1 1 for no timer, 0 for timer 121 0000 0000 M68000 equ 0 1 for 68000, 0 for 68010/12 122 123 ******************************************************************************** 124 * 125 * Include bootrom lowram declarations 126 * 127 ******************************************************************************** 128 INCLUDE BROM:LOWRAM 129 * sccs info: @(#) lowram 8.1 84/05/04 00:17:54 * 130 131 ****************************************************************************** 132 * Low RAM Memory Map and Equates * 133 ****************************************************************************** 134 * F_AREA Points to an area of stolen read/write in low RAM which has 135 * the following format: 136 * 137 * (F_AREA) + 0 semi-unused (see klink) 138 * 1 RE_RDWRT.b Re-read counter 139 * 2 RESEEK.b Re-seek counter 140 * 141 * 3 FFLAGS0 142 * 4 TRKSIDE0.b Current track and side for drive 0 143 * 5 XCMDCOPY0.b Permanent copy of xcmdreg for drive 0 144 * 6 FOFFSET0.b Offset temporary 145 * 146 * 7 FFLAGS1.b 147 * 8 TRKSIDE1.b Current track and side for drive 1 148 * 9 XCMDCOPY1.b Permanent copy of xcmdreg for drive 1 149 * 10 FOFFSET1.b Offset temporary 150 * 151 * 152 ******************************System Information****************************** 153 0000 000B booleans equ 11 BOOTROM Booleans: ****************************** PAGE 7 [3.3a] 6/28/89 17:45:18 GANGLIA BOOT - COMMON EQUATES AND DEFINITIONS (GDC) 154 0000 0000 h_5060 equ 0 Bit 0 50 Hz (Not 60Hz) 155 0000 0001 ram_test equ 1 Bit 1 To tell if RAM Test is Long 156 0000 0002 configure equ 2 Bit 2 To tell if in Configure Mode 157 0000 0003 attended equ 3 Bit 3 To tell if BOOT is attended 158 0000 0004 lowram_ok equ 4 Bit 4 To tell if LOWRAM is positioned 159 0000 0005 dma_p equ 5 Bit 5 To tell if DMA is present 160 0000 0006 mon_p equ 6 Bit 6 To tell if Monitor is present 161 0000 0007 bb_pres equ 7 Bit 7 Indicates BURGESS Board is present 162 0000 000C iocards equ booleans+1 32 bits one on per I/O Card present 163 ******************************Buffer To Be Set-up To Use Read Interface******* 164 0000 0010 mb_ptr equ 16 Ptr to Allocated RAM: 4 bytes 165 0000 0014 mb_size equ mb_ptr+4 Required bytes in Allocated RAM: 4 bytes 166 ******************************Items Modifiable by BOOT Extensions ************ 167 0000 0018 i_start equ 24 Address of Start of Init/Test List 168 0000 001C b_start equ i_start+4 Address of Start of BOOT List ****************** 169 0000 0000 active equ 0 170 0000 0004 next_system equ 4 171 0000 0020 d_start equ i_start+8 Address of Start of Mass Storage Driver List *** 172 0000 0000 doff equ 0 Offset to next List Element (4 bytes) 173 0000 0004 dadr equ 4 Address of Drivers (4 bytes) 174 0000 0008 dtype equ 8 MSUS type of Drivers (1 byte) 175 0000 0000 dsel equ 0 Display Select Code 176 0000 0001 dhpib equ 1 Display HP-IB Address 177 0000 0002 ddrive equ 2 Display Drive Number 178 0000 0003 dcomma1 equ 3 Put Comma Between Select Code and Name 179 0000 0004 dcomma2 equ 4 Put Comma Between Select Code and Addr 180 0000 0005 dvol equ 5 Split Volume number from drive number 181 0000 0024 dd_start equ i_start+12 Address of Mass Storage Device Driver List ***** 182 0000 0028 dm_start equ i_start+16 Address of Directory Manager Driver List ******* 183 0000 002C tempram equ i_start+20 Offset to Actual LOWRAM: 4 bytes 184 ******************************BOOTROM Dependent Temps follow****************** 185 ******************************Display Driver Variables************************ 186 0000 0030 winit equ 48 Display Initialization Vector 187 0000 0036 wtb equ winit+6 Write a byte in d0 to Display Vector 188 0000 003C tabxy equ winit+12 Position Printhead to X(d0),Y(d1) Vector 189 0000 0042 crtst equ winit+18 Address of 1st CRT memory word 190 0000 0046 width equ winit+22 CRT Width 191 192 * driver-specific variables 193 0000 0048 width2 equ winit+24 (26/36 ) CRT Width times 2 194 0000 0048 startoffont equ winit+24 (hi res) Pointer to 1st char in font to be used 195 0000 0048 key_lock equ winit+24 (remote) lock out key processing 196 0000 0049 key_pending equ winit+25 (remote) key pending flag 197 198 0000 004A prthead equ winit+26 Address of CRT Printhead 199 0000 004E crtlst equ winit+30 Address of End of CRT Plus one 200 0000 0052 height equ winit+34 Number of Lines in Display: 2 bytes 201 ******************************Global Booleans and Temps********************** 202 0000 0054 m_b equ 84 Booleans: 1 byte 203 0000 0000 mb_loop equ 0 bit Self-Test Loop 204 0000 0001 mb_lock equ 1 bit Lock out Resets 205 0000 0002 mb_stop equ 2 bit Pause Search 206 0000 0003 mb_current equ 3 bit GANGLIA Boolean 207 0000 0004 mb_badHiRes equ 4 bit High Resolution CRT Failed bit 208 0000 0005 mb_btemp equ 5 bit Temporary Boolean 209 0000 0006 mb_prom equ 6 bit Prom Present Boolean 210 0000 0007 mb_btemp2 equ 7 bit Temporary Boolean PAGE 8 [3.3a] 6/28/89 17:45:18 GANGLIA BOOT - COMMON EQUATES AND DEFINITIONS (GDC) 211 0000 0055 r_lock equ m_b+1 Reset Lock Byte Record 212 ******************************Global Shared Mass Storage Temps*************** 213 0000 0056 m_msus equ 86 Passed msus: 4 bytes 214 0000 0056 mm_fd equ m_msus+0 byte msus format/device subfield 215 0000 0057 mm_un equ m_msus+1 byte msus unit number subfield 216 0000 0058 mm_sc equ m_msus+2 byte msus select code subfield 217 0000 0059 mm_ba equ m_msus+3 byte msus bus address subfield 218 0000 005A m_dirsec equ m_msus+4 Directory Sector Address: 4 bytes 219 0000 005E m_dirlen equ m_msus+8 Directory Length (in sectors): 4 bytes 220 0000 0062 m_dirent equ m_msus+12 Directory entry: 4 bytes 221 0000 0066 m_filesec equ m_msus+16 File Start Address: 4 bytes 222 ******************************Variables Private to Specific Drivers********** 223 0000 006A m_sarea equ 106 32 bytes for Sector Device Present Booleans 224 0000 008A m_garea equ m_sarea+32 64 booleans for Ganglia: 8 bytes 225 ***************************************************************************** 226 0000 0092 m_nxtmsus equ 146 Next msus to try: 4 bytes 227 0000 0096 led_val equ m_nxtmsus+4 Last Failure Value to be sent to test leds 228 0000 009A remote_adr equ m_nxtmsus+8 Address of Remote H.I.: 4 bytes 229 0000 009E remote_type equ m_nxtmsus+12 1 Byte: Type of Remote I/O Card 230 0000 009F remote_xoff equ m_nxtmsus+13 1 Byte: Remote Card Software Handshake Flag 231 ******************************Temps used only during Self-Test & BOOT Scanner 232 ******************************Variables Private to Specific Drivers********** 233 0000 00A0 m_sarea2 equ 160 512 bytes for Sector Device Present Booleans 234 0000 02A0 m_garea2 equ m_sarea2+512 4 bytes for Ganglia Device Present Booleans 235 ******************************Keyboard Input Driver Variables***************** 236 0000 02A4 rinit equ 676 Initialize Input Device Vector 237 0000 02AA rstatus equ rinit+6 Check for Input Character Available Vector 238 0000 02B0 rdb equ rinit+12 Input Character Vector 239 0000 02B6 rbuff equ rinit+18 16 byte Input Buffer 240 0000 02C6 rwait equ rinit+34 Number of Characters Waiting to be Processed 241 0000 02C8 rhead equ rinit+36 Offset to next character to be processed 242 0000 02CA rtail equ rinit+38 Offset to next free char space in queue 243 0000 02CC kbdlang equ rinit+40 Keyboard language 244 0000 02CD kbdtype equ rinit+41 Keyboard type (1: ITF, 0: old chipmonk style) 245 ******************************Temps used only during Self-Test & BOOT Scanner 246 0000 02CE tempsss equ 718 Address of Last Memory Failure 247 0000 02D2 boot_sel equ tempsss+4 Boot Sub-selector 248 0000 02D3 boot_char equ tempsss+5 Boot Selector Character 249 0000 02D4 nxt_sline equ tempsss+6 Next self_test Display line available 250 0000 02D6 midram equ tempsss+8 Pointer to Mid RAM for temporary ram before LOAD 251 0000 02DA steal equ tempsss+12 Number of 32 byte blocks to reserve in f_area 252 ******************************End of F_AREA********************************** 253 0000 02DC f_areatop equ 732 Top of f_area PAGE 9 [3.3a] 6/28/89 17:45:18 GANGLIA BOOT - COMMON EQUATES AND DEFINITIONS (GDC) 255 * 256 * escapecodes 257 * 258 0000 0001 ec_no_device equ 1 259 0000 0002 ec_no_medium equ 2 260 0000 0003 ec_not_ready equ 3 261 0000 0004 ec_read_error equ 4 262 0000 0005 ec_bad_hardware equ 5 263 0000 0006 ec_bad_error_state equ 6 264 0000 0007 ec_bus_error equ 7 265 266 267 268 * 269 * dev field equates 270 * 271 0000 0000 mini equ 0 9826/36 internal 5.25" minifloppy 272 0000 0004 HP9895 equ 4 9895 8" floppy / 913X 5.25" micro-winchester (HP-IB) 273 0000 0005 HP8290X equ 5 82900 series 5.25" minifloppy (HP-IB) 274 0000 0006 HP9885 equ 6 9885 8" floppy (GPIO) 275 0000 0007 HP913X_A equ 7 913X A 5-megabyte 5.25" micro-winchester (HPIB) 276 0000 0008 HP913X_B equ 8 913X B 10-megabyte 5.25" micro-winchester (HPIB) 277 0000 0009 HP913X_C equ 9 913X C 15-megabyte 5.25" micro-winchester (HPIB) 278 0000 000A HP7905 equ 10 7905 hard disc (HPIB) 279 0000 000B HP7906 equ 11 7906 hard disc (HPIB) 280 0000 000C HP7920 equ 12 7920 hard disc (HPIB) 281 0000 000D HP7925 equ 13 7925 hard disc (HPIB) 282 283 0000 0010 CS80_256 equ 16 Command Set '80 devices with 256-byte blocks (HPIB) 284 0000 0011 CS80_other equ 17 all other Command Set '80 devices (HPIB) 285 286 0000 0014 EPROM equ 20 EPROM card 287 288 0000 0016 Bubbles equ 22 Bubbles card 289 290 0000 001F Unknown equ 31 used while scanning before device type is known 291 292 293 * 294 * card ID equates 295 * 296 FFFF FFFF null_sc equ -1 fake ID; null select code 297 0000 0000 no_card equ 0 fake ID; no card present 298 0000 0001 hp98624 equ 1 external HPIB 299 0000 0002 hp98626 equ 2 serial 300 0000 0003 hp98622 equ 3 gpio 301 0000 0008 hp98625 equ 8 Simon (PHI) HPIB 302 0000 0014 hp98628 equ 20 datacom 303 0000 0020 intHPIB equ 32 fake ID; actually has no real ID of its own 304 305 306 * 307 * hardware related equates 308 * 309 0047 8000 intHPIBaddr equ $478000 internal HPIB address 310 311 PAGE 10 [3.3a] 6/28/89 17:45:18 GANGLIA BOOT - COMMON EQUATES AND DEFINITIONS (GDC) 312 ******************************************************************************** 313 * 314 * Escape code values 315 * 316 ******************************************************************************** 317 0000 0001 TMO_ERR EQU ec_no_device timeout 318 0000 0005 CRD_DWN EQU ec_bad_hardware interface is dead 319 0000 0006 IO_MISC EQU ec_bad_error_state misc. error 320 320 320 321 FFFF FFFE ESC_CODE EQU SYSGLOBALS-2 322 FFFF FFF6 RCVR_BLK EQU SYSGLOBALS-10 323 324 list PAGE 11 [3.3a] 6/28/89 17:45:18 DC_DECLS: COMMON DATA COMM DECLARATIONS (GDC) 327 * include dc_decls 328 ******************************************************************************** 329 * Data Comm card RAM locations * 330 * (byte offsets from base address) * 331 332 0000 0000 RESET_ID equ $000000 333 0000 0002 INT_DMA equ $000002 334 0000 0004 SEMAPHORE equ $000004 335 0000 4000 INT_COND equ $004000 336 0000 4002 COMMAND equ $004002 337 0000 4004 DATA_REG equ $004004 338 0000 4006 PRIMARY_ADDR equ $004006 339 0000 4008 DSDP equ $004008 340 0000 400C ERROR_CODE equ $00400C 341 342 ************************** Data Structures Descriptor ************************** 343 344 0000 0000 ATTRIBUTES equ $000000 345 0000 0002 TR_QUEUE_ADDR equ $000002 346 0000 0006 PRIM_0_ADDR equ $000006 347 348 ****************************** Queue ****************************************** 349 350 0000 0000 TXENDBLOCKSPACE equ $000000 351 0000 0001 RXDATABUFF_NUMB equ $000001 352 0000 0004 TXBUFF equ $000004 353 0000 0024 RXBUFF equ $000024 354 355 0000 0000 CTRL_AREA equ $000000 356 0000 0010 DATA_AREA equ $000010 357 358 ****************************** Buffer record ********************************** 359 360 0000 0000 ADDR equ $000000 361 0000 0004 SIZE equ $000004 362 0000 0008 FILL equ $000008 363 0000 000C EMPTY equ $00000C 364 365 ****************************** Control block ********************************** 366 367 0000 0000 POINTER equ $000000 368 0000 0004 TERMFIELD equ $000004 369 0000 0006 MODEFIELD equ $000006 370 0000 0008 CTRLBLKSIZE equ $000008 371 372 ****************************** select_code_table ****************************** 373 374 0000 0008 term_and_mode equ AVAIL_OFF+00 .. 01 ; Encompasses the two below 375 0000 0008 term equ AVAIL_OFF+00 ; byte 376 0000 0009 mode equ AVAIL_OFF+01 ; byte 377 0000 000A data_address equ AVAIL_OFF+02 .. 05 ; pointer 378 0000 000E data_number equ AVAIL_OFF+06 .. 09 ; integer 379 0000 0012 outer_tx_count equ AVAIL_OFF+10 .. 13 ; integer 380 0000 0016 timeout_counter equ AVAIL_OFF+14 .. 17 ; integer 381 0000 001A inner_counter equ AVAIL_OFF+18 .. 21 ; integer 382 0000 001E inner_tx_count equ AVAIL_OFF+22 .. 25 ; integer 383 0000 0022 sctablebytes equ AVAIL_OFF+26 ; size of the entire table for allocation PAGE 12 [3.3a] 6/28/89 17:45:18 DC_DECLS: COMMON DATA COMM DECLARATIONS (GDC) 384 385 0000 0000 error_int equ 0 ; Bits for interrupt 386 0000 0001 rx_int equ 1 ; register 387 0000 0002 tx_int equ 2 388 0000 0003 ON_INTR_int equ 3 389 0000 0004 RC_reset_int equ 4 390 0000 0005 trace_int equ 5 391 392 ******************************************************************************** 393 394 list PAGE 13 [3.3a] 6/28/89 17:45:18 DC_BUFF: BUFFER UTILITIES (GDC) 397 * include dc_buff 398 399 400 * **** * * ***** ***** ***** **** *** 401 * * * * * * * * * * * * 402 * * * * * * * * * * * 403 * **** * * ***** ***** ***** **** *** 404 * * * * * * * * * * * 405 * * * * * * * * * * * * 406 * **** *** * * ***** * * *** 407 408 409 410 411 412 ******************************************************************************** 413 * * 414 * routine gain_access: gets access to SEMAPHORE on card for buffer * 415 * =========== utilities. If access is not gained in a * 416 * preset time, an escape is performed. * 417 * * 418 * At entry: * 419 * a3.l = card base address ($00xx0001) * 420 * * 421 * Upon normal exit: * 422 * If escape performed then * 423 * Timeout occurred * 424 * Otherwise * 425 * Access was gained * 426 * SR has been set to disable all but level 7 interrupt. The * 427 * SR has been pushed on the stack and GAIN_ACCESS MUST BE * 428 * CALLED AT THE SAME LEVEL ON THE STACK!!!!! * 429 * * 430 * This bashes d2.l. * 431 * * 432 * * 433 * Modified by: Anny Randel * 434 * Date: Dec. 27, 1983 * 435 * Purpose: Use timer when present * 436 ******************************************************************************** 437 438 0000 0000 gain_access equ * 439 00000000 241F move.l (sp)+,d2 ; Get return address 440 00000002 40E7 move sr,-(sp) ; Push on old SR 441 00000004 2F02 move.l d2,-(sp) ; and push on return address 442 00000006 342F 0004 move.w 4(sp),d2 ; Now get old SR into d2 443 0000000A C47C F0FF and.w #$F0FF,d2 ; Strip off old int level 444 0000000E 847C 0600 or.w #$0600,d2 ; Set interrupt level 6 445 00000012 46C2 move d2,sr ; and put into SR 446 447 ******** START OF ANNY'S CHANGES ******* 448 00000014 0838 0001 btst #timer_absent,sysflag2 timer absent? FEDA 449 0000001A 6622 bne.s galp1 branch if so 450 0000001C 2F3C 000F move.l #1000000,-(sp) push microsec value (1 sec) 4240 451 00000022 4857 pea (sp) push loc PAGE 14 [3.3a] 6/28/89 17:45:18 DC_BUFF: BUFFER UTILITIES (GDC) 452 00000024 4EB8 0000 jsr start_timer get timeout value 453 00000028 241F galp2 move.l (sp)+,d2 pop timeout value into d2 454 0000002A 4A2B 0004 tst.b SEMAPHORE(a3) Fetch semaphore bit in bit 7 (sign) 455 0000002E 6A3A bpl.s gadone If bit 7 true then done! 456 00000030 2F02 move.l d2,-(sp) push timeout value 457 00000032 4857 pea (sp) push it's location 458 00000034 4EB8 0000 jsr check_timer timed out yet??? 459 00000038 6AEE bpl.s galp2 branch if not timed out 460 0000003A 588F addq.l #4,sp pop stack 461 0000003C 6010 bra.s galp3 jump over processor timing loop 462 ******** END OF ANNY'S CHANGES ******* 463 464 0000003E 243C 0002 galp1 move.l #157500,d2 [CALIBRATED 1 SEC] ; Initialize counter 673C 465 00000044 4A2B 0004 galoop tst.b SEMAPHORE(a3) ; Fetch semaphore bit in bit 7 (sign) 466 00000048 6A20 bpl.s gadone ; If bit 7 true then done! 467 0000004A 5382 subq.l #1,d2 ; Loop for preset time 468 0000004C 66F6 bne.s galoop 469 470 * Timed out: escape, but first... 471 0000004E 46EF 0004 galp3 move 4(sp),sr ; Get old SR back 472 00000052 6000 008C bra lunched ; Now escape PAGE 15 [3.3a] 6/28/89 17:45:18 DC_BUFF: BUFFER UTILITIES (GDC) 474 ******************************************************************************** 475 * * 476 * routine release_access: releases access to SEMAPHORE on card which * 477 * ============== was previously gained with gain_access. * 478 * Read the notes with the above routine to * 479 * see description of stack funnies. * 480 * THIS MUST BE CALLED WITH A BSR INSTRUCTION! * 481 * * 482 * At entry: * 483 * a3.l = card base address ($00xx0001) * 484 * * 485 * Upon normal exit: * 486 * no registers are bashed. * 487 * * 488 ******************************************************************************** 489 490 0000 0056 release_access equ * 491 00000056 1740 0004 move.b d0,SEMAPHORE(a3) ; Store don't-care into semaphore. 492 0000005A 46EF 0004 move 4(sp),sr ; Now get old SR back 493 0000005E 3F6F 0002 move.w 2(sp),4(sp) ; Now move return address up 0004 494 00000064 3F57 0002 move.w (sp),2(sp) ; into where we will return to 495 00000068 548F addq.l #2,sp ; & bump up by one word 496 * 497 * MODULE initialization 498 * 499 0000 006A extdc_extdc equ * 500 0000006A 4E75 gadone rts ; Now return to the return address. 501 502 503 ****************************************************************************** 504 * gang_reset(card_address:integer):boolean * 505 * * 506 * Reset the Ganglia Card at the given address. If it fails self- * 507 * test return false, otherwise return true. * 508 ****************************************************************************** 509 0000 006C extdc_gang_reset equ * 510 0000006C 205F gang_reset movea.l (sp)+,a0 Get Return Address 511 0000006E 265F movea.l (sp)+,a3 Get Card Address 512 00000070 524B addq #1,a3 Adjust for Other routines 513 00000072 2F08 move.l a0,-(sp) Put Return address back on stack 514 00000074 422B 400C clr.b $400C(a3) Clear out any errors so far 515 00000078 177C 0080 move.b #$80,RESET_ID(a3) Reset the Card 0000 516 0000007E 6180 bsr gain_access Wait for Card Ready 517 00000080 61D4 bsr release_access 518 00000082 51EF 0004 sf 4(sp) False so far until self-test 519 00000086 4A2B 400C tst.b $400C(a3) Is Zero 520 0000008A 6604 bne.s gang_reset1 521 0000008C 50EF 0004 st 4(sp) Succeed 522 00000090 4E75 gang_reset1 rts 523 524 525 PAGE 16 [3.3a] 6/28/89 17:45:18 DC_BUFF: BUFFER UTILITIES (GDC) 527 ******************************************************************************** 528 * * 529 * routine find_TRBUF: Sets up pointer in a2 to point to the record * 530 * =========== describing the card's TRBUFF structure. * 531 * * 532 * routine find_TXBUF: Sets up pointer in a2 to point to the record * 533 * =========== describing the card's TXBUFF structure. * 534 * * 535 * routine find_RXBUF: Sets up pointer in a2 to point to the record * 536 * =========== describing the card's RXBUFF structure. * 537 * * 538 * At entry: * 539 * a3.l = card base address ($00xx0001) * 540 * * 541 * Upon exit: * 542 * a2.l = buffer record base address (CTRLBUFF_ADDR, * 543 * CTRLBUFF_SIZE, CTRLBUFF_FILL, CTRLBUFF_EMPTY, * 544 * DATABUFF_ADDR, etc). (shifted, +1+selectcode) * 545 * This bashes a1, d4 and d5. * 546 * * 547 ******************************************************************************** 548 549 0000 0092 find_TXBUF equ * 550 00000092 7A04 moveq #TXBUFF,d5 551 00000094 6002 bra.s find 552 553 0000 0096 find_RXBUF equ * 554 00000096 7A24 moveq #RXBUFF,d5 555 00000098 45F8 0006 find lea PRIM_0_ADDR,a2 556 557 0000009C 4284 findTR clr.l d4 558 0000009E 090B 4008 movep.w DSDP(a3),d4 559 000000A2 EE5C ror.w #7,d4 560 000000A4 D88B add.l a3,d4 561 000000A6 2244 movea.l d4,a1 ; a1 points to Data Struct Descriptor 562 563 000000A8 4284 clr.l d4 564 000000AA D3CA adda.l a2,a1 ; add offset to which queue table 565 000000AC 0909 0000 movep.w 0(a1),d4 566 000000B0 EE5C ror.w #7,d4 567 000000B2 D88B add.l a3,d4 568 000000B4 D885 add.l d5,d4 569 000000B6 2444 movea.l d4,a2 ; a2 points to buffer record 570 000000B8 4E75 rts PAGE 17 [3.3a] 6/28/89 17:45:18 DC_BUFF: BUFFER UTILITIES (GDC) 572 ******************************************************************************** 573 * * 574 * routine find_RX_DATA: * 575 * routine find_DATA_AREA: Sets up pointers to point to the data buffer. * 576 * ============== This is to be used in conjunction with the * 577 * routines find_XXBUF which will set up the * 578 * pointer (in a2) to the buffer we are using. * 579 * THIS SHOULD NOT BE USED WITH THE RECEIVE * 580 * BUFFER! USE THE PREVIOUS ROUTINE INSTEAD! * 581 * * 582 * routine find_CTRL_AREA: Sets up pointers to point to the ctrl buffer. * 583 * ============== This is to be used in conjunction with the * 584 * routines find_XXBUF which will set up the * 585 * pointer (in a2) to the buffer we are using. * 586 * * 587 * At entry: * 588 * a3.l = card base address ($00xx0001) * 589 * a2.l = Data buffer record base address (CTRLBUFF_ADDR, * 590 * CTRLBUFF_SIZE, CTRLBUFF_FILL, CTRLBUFF_EMPTY, * 591 * DATABUFF_ADDR, etc). (shifted, +1+selectcode) * 592 * * 593 * Upon exit: * 594 * a1.l = data area base address (shifted, +1+selectcode) * 595 * d4.l = address of first byte PAST data area (shifted, +1+sc) * 596 * d5.l = XXxxxxBUFF_SIZE (unshifted, not adjusted) * 597 * * 598 ******************************************************************************** 599 600 0000 00BA find_RX_DATA equ * 601 0000 00BA find_DATA_AREA equ * 602 000000BA 43F8 0010 lea DATA_AREA,a1 603 000000BE 6004 bra.s findare 604 605 0000 00C0 find_CTRL_AREA equ * 606 000000C0 43F8 0000 lea CTRL_AREA,a1 607 608 000000C4 D3CA findare adda.l a2,a1 ; a1 points to data/ctrl part of record 609 000000C6 4285 clr.l d5 610 000000C8 0B09 0004 movep.w SIZE(a1),d5 611 000000CC E05D ror.w #8,d5 ; d5 = SIZE in bytes 612 613 000000CE 4284 clr.l d4 614 000000D0 0909 0000 movep.w ADDR(a1),d4 615 000000D4 EE5C ror.w #7,d4 616 000000D6 D88B add.l a3,d4 617 000000D8 2244 movea.l d4,a1 ; a1 points to front of buffer area 618 000000DA D885 add.l d5,d4 619 000000DC D885 add.l d5,d4 ; d4 points past end of buffer area 620 621 000000DE 4E75 rts 622 PAGE 18 [3.3a] 6/28/89 17:45:18 DC_COMM: COMMAND MODULE (GDC) 625 * include dc_comm 626 627 628 * *** *** * * * * *** * * **** 629 * * * * * ** ** ** ** * * ** * * * 630 * * * * * * * * * * * * * * * * * 631 * * * * * * * * ***** * ** * * 632 * * * * * * * * * * * * * * 633 * * * * * * * * * * * * * * * 634 * *** *** * * * * * * * * **** 635 636 637 638 639 640 ****************************** Escapes ***************************************** 641 642 0000 00E0 lunched equ * 643 000000E0 7005 moveq #crd_dwn,d0 644 000000E2 6002 bra.s escape 645 646 0000 00E4 time_err equ * 647 000000E4 7001 moveq #tmo_err,d0 648 649 ******************************************************************************** 650 * * 651 * routine escape: performs Pascal "escape" function. Error exit * 652 * ====== number is to be passed in d0. * 653 * * 654 * Uses: a3.l = Base address of card * 655 * a4.l = Address of SCT: select_code_table * 656 * a5.l = Global pointer for escape arguments * 657 * d0.l = Escape number * 658 * * 659 * This leaves interrupts ENABLED * 660 * * 661 ******************************************************************************** 662 663 0000 00E6 escape equ * ; Escape point for errors 664 000000E6 3B40 FFFE move.w d0,ESC_CODE(a5) 665 000000EA 4E4A trap #10 666 667 PAGE 19 [3.3a] 6/28/89 17:45:18 DC_RXBUF: RX BUFFER UTILITIES (GDC) 670 * include dc_rxbuf 671 672 673 * **** * * **** * * ***** ***** ***** **** 674 * * * * * * * * * * * * * * 675 * * * * * * * * * * * * * * 676 * **** * **** * * ***** ***** ***** **** 677 * * * * * * * * * * * * * * 678 * * * * * * * * * * * * * * 679 * * * * * **** *** * * ***** * * 680 681 682 683 684 685 ******************************************************************************** 686 * * 687 * routine RX_BUFF_bytes: Function which returns the number of * 688 * ============= characters until the first control block in * 689 * the Receive Buffer. If there are no control * 690 * blocks, this just returns the number of * 691 * characters in the buffer. This only works * 692 * on the current Rx data buffer, and does not * 693 * extract TERM=255 control blocks! * 694 * * 695 * At entry: * 696 * a2.l = data buffer base address (shifted, +1+selectcode) * 697 * a3.l = card base address ($00xx0001) * 698 * a4.l = pointer to sc_subtabletype structure * 699 * * 700 * Upon exit: * 701 * d0.l = Number of characters. * 702 * a1, d4 and d5 are left with values from find_RX_DATA. * 703 * This also bashes a0, d1 and d2. * 704 * * 705 * This routine uses the card's SEMAPHORE to gain access. * 706 * * 707 * This routine calls gain_access, release_access, and find_RX_DATA. * 708 * * 709 ******************************************************************************** 710 711 0000 00EC RX_BUFF_bytes equ * 712 000000EC 61CC bsr find_RX_DATA ; Setup a1 = data buffer base addr 713 * d4 = end of data buffer addr 714 * d5 = RXDATABUFF_SIZE 715 000000EE 4280 clr.l d0 ; Get garbage out of top of d0, d1 716 000000F0 4281 clr.l d1 717 000000F2 030A 000C movep.w CTRL_AREA+EMPTY(a2),d1 ; Fetch pointers (bytes in wrong order) 718 000000F6 6100 FF08 bsr gain_access ; Need access to FILL pointers 719 000000FA 010A 0018 movep.w DATA_AREA+FILL(a2),d0 720 000000FE 050A 0008 movep.w CTRL_AREA+FILL(a2),d2 721 00000102 6100 FF52 bsr release_access 722 00000106 B242 cmp.w d2,d1 ; If the two ctrl block pointers are not 723 00000108 670A beq.s RBb1 ; equal, then we want to use the pointer 724 0000010A EE59 ror.w #7,d1 ; field from the next control block to 725 0000010C D28B add.l a3,d1 ; indicate how much data may be removed 726 0000010E 2041 movea.l d1,a0 PAGE 20 [3.3a] 6/28/89 17:45:18 DC_RXBUF: RX BUFFER UTILITIES (GDC) 727 00000110 0108 0000 movep.w POINTER(a0),d0 ; --- Use it as the "FILL" pointer 728 729 00000114 E058 RBb1 ror.w #8,d0 ; Switch bytes for FILL 730 00000116 030A 001C movep.w DATA_AREA+EMPTY(a2),d1 ; and get EMPTY and switch bytes 731 0000011A E059 ror.w #8,d1 ; d0="FILL", d1=EMPTY 732 733 0000011C 9041 sub.w d1,d0 ; Compute d0 := FILL-EMPTY 734 0000011E 6C02 bge.s RBb2 735 00000120 D045 add.w d5,d0 ; If negative, add data buffer size 736 00000122 4E75 RBb2 rts ; Now d0 = ("FILL"-EMPTY) mod SIZE --- of data buffer PAGE 21 [3.3a] 6/28/89 17:45:18 DC_RXBUF: RX BUFFER UTILITIES (GDC) 738 ******************************************************************************** 739 * * 740 * routine getctrlblk: Routine which gets a control block from the * 741 * ========== Receive buffer. It must have already been * 742 * determined that there is a control block at * 743 * the front of the buffer, since this routine * 744 * does NOT check for that condition. The TERM * 745 * and MODE fields of the removed block are left * 746 * in the appropriate (.term and .mode) in the * 747 * sc_subtabletype structure. * 748 * * 749 * At entry: * 750 * a2.l = RX buffer record base address from find_RXBUF * 751 * a3.l = card base address ($00xx0001) * 752 * a4.l = pointer to sc_subtabletype structure * 753 * * 754 * Upon exit: * 755 * sc_subtabletype.term = TERM field of control block (8 bits) * 756 * sc_subtabletype.mode = MODE field of control block (8 bits) * 757 * a1, d4 and d5 are left with the values from find_CTRL_AREA. * 758 * This bashes d0, d2, and a0. * 759 * * 760 * This routine uses the card's SEMAPHORE to gain access. * 761 * * 762 * This routine calls gain_access, release_access, and find_CTRL_AREA. * 763 * * 764 ******************************************************************************** 765 766 0000 0124 getctrlblk equ * 767 00000124 619A bsr find_CTRL_AREA ; Setup a1 = ctrl buffer base addr 768 * d4 = end of ctrl buffer addr 769 * d5 = TRCTRLBUFF_SIZE 770 771 00000126 4280 clr.l d0 ; Clear top of d0 772 00000128 010A 000C movep.w CTRL_AREA+EMPTY(a2),d0 ; Get control buffer EMPTY pointer 773 0000012C EE58 ror.w #7,d0 ; Now make it into a 68000 pointer 774 0000012E D08B add.l a3,d0 775 00000130 2040 movea.l d0,a0 ; Move to a0 so we can use it 776 00000132 D07C 0008 add.w #CTRLBLKSIZE,d0 ; Bump pointer by control block size 777 00000136 B840 cmp.w d0,d4 ; and check for wraparound. 778 00000138 6602 bne.s gcb1 779 0000013A 3009 move.w a1,d0 ; If so, set to front of buffer 780 0000013C 0880 0000 gcb1 bclr #0,d0 ; Make it into a Z80 781 00000140 EF58 rol.w #7,d0 ; type pointer with bytes reversed 782 00000142 6100 FEBC bsr gain_access ; Now store the updated EMPTY pointer 783 00000146 018A 000C movep.w d0,CTRL_AREA+EMPTY(a2) 784 0000014A 6100 FF0A bsr release_access 785 0000014E 4E75 rts ;<<d3 then set d0 := d3 848 00000172 6E02 bgt.s gc1 849 00000174 2003 move.l d3,d0 850 851 00000176 242C 000E gc1 move.l data_number(a4),d2 ; Fetch number of positions available 852 0000017A B480 cmp.l d0,d2 ; If d0>d2 then set d0 := d2 853 0000017C 6E02 bgt.s gc2 854 0000017E 2002 move.l d2,d0 855 856 00000180 2600 gc2 move.l d0,d3 ; d3.l saves number of chars actually 857 * ; transferred below 858 00000182 6738 beq.s gcdone ; If zero, no work to be done 859 00000184 5340 subq.w #1,d0 ; Make offset correct for dbf instr. 860 00000186 206C 000A movea.l data_address(a4),a0 ; Get character pointer into a0 861 862 0000018A 10D2 gcloop move.b (a2),(a0)+ ; Transfer a character & bump dest ptr 863 0000018C 544A addq.w #2,a2 ; Bump source pointer (odd bytes) 864 0000018E 51C8 FFFA dbf d0,gcloop ; Then decrement d0 & loop 865 866 00000192 9483 sub.l d3,d2 ; Decrement datacnt by # bytes 867 00000194 2942 000E move.l d2,data_number(a4) ; Now store adjusted address and 868 00000198 2948 000A move.l a0,data_address(a4) ; number fields 869 870 0000019C 220A move.l a2,d1 ; Store pointer for computations 871 0000019E B88A cmp.l a2,d4 ; Now check to see if EMPTY was moved 872 000001A0 6602 bne.s gc3 ; past end of buffer. If so, set to 873 000001A2 2209 move.l a1,d1 ; the front of the buffer. 874 000001A4 0881 0000 gc3 bclr #0,d1 ; Fix up the 68000 pointer to be the 875 000001A8 EF59 rol.w #7,d1 ; card's type of pointer 876 000001AA 4CDF 0400 movem.l (sp)+,a2 877 000001AE 6100 FE50 bsr gain_access 878 000001B2 038A 001C movep.w d1,DATA_AREA+EMPTY(a2) ; Remember d1 = card's EMPTY pointer. 879 000001B6 6100 FE9E bsr release_access 880 000001BA 4E75 rts 881 000001BC 4CDF 0400 gcdone movem.l (sp)+,a2 882 000001C0 4E75 rts PAGE 24 [3.3a] 6/28/89 17:45:18 DC_RXBUF: RX BUFFER UTILITIES (GDC) 884 ******************************************************************************** 885 * * 886 * routine RX_stuff_avail: Routine which determines whether there is * 887 * ============== ANYTHING (data or control blocks) in the * 888 * Receive buffer. This consumes any TERM=255 * 889 * control blocks before returning the function. * 890 * * 891 * At entry: * 892 * a2.l = RX buffer record base address from find_RXBUF * 893 * a3.l = card base address ($00xx0001) * 894 * a4.l = pointer to sc_subtabletype structure * 895 * * 896 * Upon exit: * 897 * d0.l = $00 if buffer is empty, * 898 * $01 if ctrl buffer is empty and data buffer is not, * 899 * $02 if data buffer is empty and ctrl buffer is not, * 900 * $03 if both data and ctrl buffers are not empty. * 901 * a1 and d4 are left with the values from find_RX_DATA. * 902 * This bashes d0, d1, d2, d3, d4, d5, a0 and a1. * 903 * * 904 * This routine uses the card's SEMAPHORE to gain access. * 905 * * 906 * This routine calls gain_access and release_access. * 907 * * 908 ******************************************************************************** 909 910 0000 01C2 RX_stuff_avail equ * 911 000001C2 6100 FEF6 bsr find_RX_DATA ; Setup a1 = data buffer base addr 912 * d4 = end of data buffer addr 913 * d5 = RXDATABUFF_SIZE 914 000001C6 6100 FE38 bsr gain_access 915 000001CA 070A 0018 movep.w DATA_AREA+FILL(a2),d3 ; Fetch FILL & EMPTY (bytes reversed but 916 000001CE 030A 0008 movep.w CTRL_AREA+FILL(a2),d1 917 000001D2 6100 FE82 bsr release_access ; we're just checking equality) 918 000001D6 4282 clr.l d2 919 000001D8 4280 clr.l d0 920 000001DA 050A 000C movep.w CTRL_AREA+EMPTY(a2),d2 921 000001DE B441 cmp.w d1,d2 ; Compare ctrl buff FILL & EMPTY 922 000001E0 660C bne.s setbit1 ; If not equal, then set bit 1 923 000001E2 050A 001C chkdata movep.w DATA_AREA+EMPTY(a2),d2 924 000001E6 B443 cmp.w d3,d2 ; Compare data buff FILL & EMPTY 925 000001E8 6702 beq.s return 926 000001EA 5200 addq.b #1,d0 ; And set bit 0 if not equal 927 000001EC 4E75 return rts 928 929 000001EE 5400 setbit1 addq.b #2,d0 ; Set "ctrl not empty" bit 930 000001F0 60F0 bra.s chkdata PAGE 25 [3.3a] 6/28/89 17:45:18 DC_RXBUF: RX BUFFER UTILITIES (GDC) 932 ******************************************************************************** 933 * * 934 * routine ctrlblknext: Routine which determines whether the next * 935 * =========== thing to be consumed from the Receive buffer * 936 * is a control block. THE RESULT OF THIS * 937 * FUNCTION IS NOT VALID UNLESS RX_BUFFER_empty * 938 * RETURNS FALSE!!! * 939 * * 940 * At entry: * 941 * a2.l = RX buffer record base address from find_RXBUF * 942 * a3.l = card base address ($00xx0001) * 943 * * 944 * Upon exit: * 945 * d0.b = $FF if control block is next, $00 if data is next. * 946 * This bashes d2, d5 and a0. * 947 * * 948 ******************************************************************************** 949 950 0000 01F2 ctrlblknext equ * 951 000001F2 6100 FE0C bsr gain_access 952 000001F6 050A 0008 movep.w CTRL_AREA+FILL(a2),d2 ; Check if ctrl buffer is empty 953 000001FA 6100 FE5A bsr release_access 954 000001FE 4280 clr.l d0 955 00000200 010A 000C movep.w CTRL_AREA+EMPTY(a2),d0 ; Fetch ctrl buffer EMPTY pointer 956 00000204 B440 cmp.w d0,d2 ; If equal then return d0.b=$00 957 00000206 6716 beq.s cbn1 958 00000208 EE58 ror.w #7,d0 959 0000020A D08B add.l a3,d0 960 0000020C 2040 movea.l d0,a0 961 0000020E 0108 0000 movep.w POINTER(a0),d0 ; Fetch the POINTER field from the 962 963 00000212 4285 clr.l d5 ; Setup d5.l=offset 964 00000214 050A 001C movep.w DATA_AREA+EMPTY(a2),d2 ; first ctrl block and compare to the 965 966 00000218 B440 cmp.w d0,d2 ; data buffer EMPTY pointer 967 0000021A 57C0 seq d0 ; Then set d0 if equal 968 0000021C 4E75 rts 969 970 0000021E 4280 cbn1 clr.l d0 971 00000220 4E75 rts 972 973 PAGE 26 [3.3a] 6/28/89 17:45:18 DC_TRANS: HANDSHAKE TRANSFER CODE (GDC) 976 * include dc_trans 977 978 979 * ***** **** *** * * *** ***** ***** **** 980 * * * * * * ** * * * * * * * 981 * * * * * * * * * * * * * * 982 * * **** ***** * ** *** *** *** **** 983 * * * * * * * * * * * * * 984 * * * * * * * * * * * * * * 985 * * * * * * * * *** * ***** * * 986 987 988 989 990 0000 0006 in_timeout equ 6 [UNCALIBRATED 1 MS] 991 0000 0007 out_timeout equ 7 [UNCALIBRATED 1 MS] 992 993 994 ************************************************* 995 * * 996 * procedure OUTPUT_DATA ( * 997 * var SCT: select_code_table; * 998 * PTR: ^ data_bytes; * 999 * COUNT: longword ); * 1000 * * 1001 * This operation may hang waiting for space. * 1002 * * 1003 * This routine calls find_TXBUF and putchars. * 1004 * * 1005 * * 1006 * Modified by: Anny Randel * 1007 * Date: Dec. 27, 1983 * 1008 * Purpose: Use timer when present * 1009 * * 1010 ************************************************* 1011 1012 0000 0222 extdc_output_data equ * 1013 0000 0222 output_data equ * 1014 00000222 205F movea.l (sp)+,a0 1015 00000224 221F move.l (sp)+,d1 ; COUNT 1016 00000226 225F movea.l (sp)+,a1 ; PTR 1017 00000228 285F movea.l (sp)+,a4 ; SCT 1018 0000022A 4850 pea (a0) 1019 0000022C 266C 0000 movea.l c_adr(a4),a3 1020 00000230 528B addq.l #1,a3 1021 1022 00000232 2949 000A move.l a1,data_address(a4) ; initialize address/count 1023 00000236 2941 000E move.l d1,data_number(a4) 1024 1025 0000023A 296C 0004 move.l timeout(a4),timeout_counter(a4) 0016 1026 1027 ********** START OF ANNY'S CHANGES ********** 1028 00000240 0838 0001 btst #timer_absent,sysflag2 ; timer absent? FEDA 1029 00000246 6612 bne.s out_t1 ; branch if so 1030 PAGE 27 [3.3a] 6/28/89 17:45:18 DC_TRANS: HANDSHAKE TRANSFER CODE (GDC) 1031 00000248 486C 0016 pea timeout_counter(a4) 1032 0000024C 4EB8 0000 jsr milli_to_micro ; Translate value to microseconds 1033 00000250 486C 0016 pea timeout_counter(a4) ; now contains us value 1034 00000254 4EB8 0000 jsr start_timer ; value of timer at timeout returned 1035 * in timeout_counter 1036 00000258 6008 bra.s out_t2 ; jump over processor dependent init. 1037 *********************************************** 1038 1039 0000025A 297C 0000 out_t1 move.l #out_timeout,inner_counter(a4) 0007 001A 1040 1041 00000262 6100 FE2E out_t2 bsr find_TXBUF ; Set up a2.l = buffer descriptor record 1042 * base address 1043 00000266 6746 beq.s outdone 1044 1045 00000268 4AAC 000E out_2 tst.l data_number(a4) ; And transfer characters until done 1046 0000026C 6740 beq.s outdone 1047 0000026E 6100 01B0 bsr putchars 1048 00000272 4A2B 400C tst.b error_code(a3) 1049 00000276 6600 FE6C bne time_err 1050 1051 ******** ANNY'S CHANGES ******** 1052 0000027A 0838 0001 btst #timer_absent,sysflag2 ; timer absent? FEDA 1053 00000280 660E bne.s out_t3 ; branch if so 1054 1055 00000282 486C 0016 pea timeout_counter(a4) 1056 00000286 4EB8 0000 jsr check_timer ; Test for timeout condition 1057 0000028A 6ADC bpl.s out_2 ; if it hasn't timed out, goto out_2 1058 0000028C 6000 FE56 bra time_err ; if it has timed out, goto time_err 1059 ******** END OF ANNY'S CHANGES ******** 1060 1061 00000290 53AC 001A out_t3 subq.l #1,inner_counter(a4) ; Test for timeout condition 1062 00000294 66D2 bne.s out_2 1063 00000296 297C 0000 move.l #out_timeout,inner_counter(a4) 0007 001A 1064 0000029E 4AAC 0016 tst.l timeout_counter(a4) 1065 000002A2 67C4 beq.s out_2 1066 000002A4 53AC 0016 subq.l #1,timeout_counter(a4) 1067 000002A8 6700 FE3A beq time_err ; if so, escape 1068 000002AC 60BA bra.s out_2 1069 1070 000002AE 4E75 outdone rts PAGE 28 [3.3a] 6/28/89 17:45:18 DC_TRANS: HANDSHAKE TRANSFER CODE (GDC) 1072 ************************************************* 1073 * * 1074 * procedure ENTER_DATA ( * 1075 * var SCT: select_code_table; * 1076 * PTR: ^ data_bytes; * 1077 * var COUNT:longword ); * 1078 * * 1079 * COUNT initially passes the number of bytes * 1080 * which the upper level wants to read. THE * 1081 * ROUTINE DOES NOT NECESSARILY READ THIS MANY! * 1082 * Upon exit COUNT will be reflect the number * 1083 * of data bytes entered, whether or not there * 1084 * is an escape. * 1085 * * 1086 * escape(EOD): Terminated by reaching a control* 1087 * block. TERM&MODE may be read with STATUS * 1088 * 9 and 10. * 1089 * * 1090 * This routine calls find_RXBUF, * 1091 * getctrlblk, getchars, ctrlblknext, and * 1092 * RX_BUFFER_EMPTY. * 1093 * * 1094 * * 1095 * Modified by: Anny Randel * 1096 * Date: Dec. 14, 1983 * 1097 * Purpose: Use timer when present * 1098 ************************************************* 1099 1100 0000 02B0 extdc_enter_data equ * 1101 0000 02B0 enter_data equ * 1102 000002B0 205F movea.l (sp)+,a0 1103 000002B2 245F movea.l (sp)+,a2 ; addr(COUNT) 1104 000002B4 225F movea.l (sp)+,a1 ; PTR 1105 000002B6 285F movea.l (sp)+,a4 ; SCT 1106 000002B8 4850 pea (a0) 1107 000002BA 266C 0000 movea.l c_adr(a4),a3 1108 000002BE 528B addq.l #1,a3 1109 1110 000002C0 2949 000A move.l a1,data_address(a4) ; initialize address 1111 1112 000002C4 296C 0004 move.l timeout(a4),timeout_counter(a4) 0016 1113 1114 ********** START OF ANNY'S CHANGES ********** 1115 000002CA 0838 0001 btst #timer_absent,sysflag2 ; timer absent? FEDA 1116 000002D0 6612 bne.s in_t1 ; branch if so 1117 1118 000002D2 486C 0016 pea timeout_counter(a4) 1119 000002D6 4EB8 0000 jsr milli_to_micro ; Translate value to microseconds 1120 000002DA 486C 0016 pea timeout_counter(a4) ; now contains us value 1121 000002DE 4EB8 0000 jsr start_timer ; value of timer at timeout returned 1122 * in timeout_counter 1123 000002E2 6008 bra.s in_t2 ; jump over processor dependent init. 1124 *********************************************** 1125 PAGE 29 [3.3a] 6/28/89 17:45:18 DC_TRANS: HANDSHAKE TRANSFER CODE (GDC) 1126 000002E4 297C 0000 in_t1 move.l #in_timeout,inner_counter(a4) 0006 001A 1127 1128 000002EC 2952 000E in_t2 move.l (a2),data_number(a4) 1129 000002F0 2F0A move.l a2,-(sp) 1130 000002F2 6006 bra.s in_1 1131 1132 000002F4 4AAC 000E in_0 tst.l data_number(a4) ; See if all characters transferred 1133 000002F8 675C beq.s in_exit ; If so, leave 1134 1135 000002FA 6100 FD9A in_1 bsr find_RXBUF ; Set up a2.l = buffer descriptor record 1136 * base address 1137 000002FE 4A2B 400C tst.b error_code(a3) 1138 00000302 6600 FDE0 bne time_err 1139 1140 ******** ANNY'S CHANGES ******** 1141 00000306 0838 0001 btst #timer_absent,sysflag2 ; timer absent? FEDA 1142 0000030C 660C bne.s in_t3 ; branch if so 1143 1144 0000030E 486C 0016 pea timeout_counter(a4) 1145 00000312 4EB8 0000 jsr check_timer ; Test for timeout condition 1146 00000316 6A2A bpl.s in_4 ; if it hasn't timed out, goto in_4 1147 00000318 601A bra.s in_t4 ; if it has timed out, goto in_t4 1148 ******** END OF ANNY'S CHANGES ******** 1149 1150 0000031A 53AC 001A in_t3 subq.l #1,inner_counter(a4) ; Test for timeout condition 1151 0000031E 6622 bne.s in_4 1152 00000320 297C 0000 move.l #in_timeout,inner_counter(a4) 0006 001A 1153 00000328 4AAC 0016 tst.l timeout_counter(a4) 1154 0000032C 6714 beq.s in_4 1155 0000032E 53AC 0016 subq.l #1,timeout_counter(a4) 1156 00000332 660E bne.s in_4 1157 1158 00000334 205F in_t4 movea.l (sp)+,a0 1159 00000336 2010 move.l (a0),d0 1160 00000338 90AC 000E sub.l data_number(a4),d0 1161 0000033C 2080 move.l d0,(a0) 1162 0000033E 6000 FDA4 bra time_err 1163 1164 00000342 6100 FE7E in_4 bsr RX_stuff_avail ; See if buffer is empty 1165 00000346 4A00 tst.b d0 ; If so, just sit here & wait 1166 00000348 67AA beq.s in_0 1167 1168 0000034A 6100 FEA6 bsr ctrlblknext ; If a control block is next, then 1169 0000034E 4A00 tst.b d0 1170 00000350 6710 beq.s in_3 1171 1172 00000352 6100 FDD0 bsr getctrlblk ; Get it, and check for the special 1173 1174 0000 0356 in_2 equ * 1175 1176 00000356 205F in_exit movea.l (sp)+,a0 1177 00000358 2010 move.l (a0),d0 1178 0000035A 90AC 000E sub.l data_number(a4),d0 1179 0000035E 2080 move.l d0,(a0) PAGE 30 [3.3a] 6/28/89 17:45:18 DC_TRANS: HANDSHAKE TRANSFER CODE (GDC) 1180 00000360 4E75 rts 1181 1182 00000362 4AAC 000E in_3 tst.l data_number(a4) ; see if chars to transfer 1183 00000366 67EE beq.s in_exit ; yes, go do it 1184 1185 00000368 6100 FDE6 bsr getchars ; move some data 1186 0000036C 6086 bra in_0 ; & go back to check for ctrl blk PAGE 31 [3.3a] 6/28/89 17:45:18 DC_TRANS: HANDSHAKE TRANSFER CODE (GDC) 1188 ************************************************* 1189 * * 1190 * procedure OUTPUT_END ( * 1191 * var SCT: select_code_table ); * 1192 * * 1193 * Equivalent to the BASIC OUTPUT Sc;END. * 1194 * * 1195 * This operation may hang waiting for space. * 1196 * * 1197 * This routine calls find_TXBUF and * 1198 * try_sending_EOF. * 1199 * * 1200 * * 1201 * Modified by: Anny Randel * 1202 * Date: Dec. 14, 1983 * 1203 * Purpose: Use timer when present * 1204 ************************************************* 1205 1206 0000 036E extdc_output_end equ * 1207 0000 036E output_end equ * 1208 0000036E 205F movea.l (sp)+,a0 1209 00000370 285F movea.l (sp)+,a4 ; SCT 1210 00000372 4850 pea (a0) 1211 00000374 266C 0000 movea.l c_adr(a4),a3 1212 00000378 528B addq.l #1,a3 1213 1214 0000037A 6100 FD16 bsr find_TXBUF ; Set up a2.l = buffer descriptor record 1215 * base address 1216 0000037E 296C 0004 move.l timeout(a4),outer_tx_count(a4) 0012 1217 1218 ********** START OF ANNY'S CHANGES ********** 1219 00000384 0838 0001 btst #timer_absent,sysflag2 ; timer absent? FEDA 1220 0000038A 6612 bne.s oe_1 ; branch if so 1221 1222 0000038C 486C 0012 pea outer_tx_count(a4) 1223 00000390 4EB8 0000 jsr milli_to_micro ; Translate value to microseconds 1224 00000394 486C 0012 pea outer_tx_count(a4) ; now contains us value 1225 00000398 4EB8 0000 jsr start_timer ; value of timer at timeout returned 1226 * in outer_tx_count 1227 0000039C 6008 bra.s trysend ; jump over processor dependent init. 1228 *********************************************** 1229 1230 0000039E 297C 0000 oe_1 move.l #sEtimeout,inner_tx_count(a4) 000B 001E 1231 1232 000003A6 6100 0186 trysend bsr try_sending_EOF 1233 000003AA 4A00 tst.b d0 1234 000003AC 663C bne.s sentEOF 1235 1236 000003AE 4A2B 400C tst.b error_code(a3) 1237 000003B2 6600 FD30 bne time_err 1238 1239 ******** ANNY'S CHANGES ******** 1240 000003B6 0838 0001 btst #timer_absent,sysflag2 ; timer absent? FEDA PAGE 32 [3.3a] 6/28/89 17:45:18 DC_TRANS: HANDSHAKE TRANSFER CODE (GDC) 1241 000003BC 660E bne.s oe_2 ; branch if so 1242 1243 000003BE 486C 0012 pea outer_tx_count(a4) 1244 000003C2 4EB8 0000 jsr check_timer ; Test for timeout condition 1245 000003C6 6ADE bpl trysend ; if it hasn't timed out, goto trysend 1246 000003C8 6000 FD1A bra time_err ; if it has timed out, goto time_err 1247 ******** END OF ANNY'S CHANGES ******** 1248 1249 000003CC 53AC 001E oe_2 subq.l #1,inner_tx_count(a4) 1250 000003D0 66D4 bne.s trysend 1251 000003D2 297C 0000 move.l #sEtimeout,inner_tx_count(a4) 000B 001E 1252 000003DA 4AAC 0012 tst.l outer_tx_count(a4) 1253 000003DE 67C6 beq.s trysend 1254 000003E0 53AC 0012 subq.l #1,outer_tx_count(a4) 1255 000003E4 66C0 bne.s trysend 1256 000003E6 6000 FCFC bra time_err 1257 1258 000003EA 4E75 sentEOF rts 1259 1260 PAGE 33 [3.3a] 6/28/89 17:45:18 DC_TXBUF: TX BUFFER UTILITIES (GDC) 1263 * include dc_txbuf 1264 1265 1266 * ***** * * **** * * ***** ***** ***** **** 1267 * * * * * * * * * * * * * 1268 * * * * * * * * * * * * * 1269 * * * **** * * ***** ***** ***** **** 1270 * * * * * * * * * * * * * 1271 * * * * * * * * * * * * * 1272 * * * * **** *** * * ***** * * 1273 1274 1275 1276 0000 000B sEtimeout equ 11 [UNCALIBRATED] 1277 0000 000B pcbtimeout equ 11 [CALIBRATED 1 MS] 1278 1279 1280 ******************************************************************************** 1281 * * 1282 * routine TXCTRLBUFFroom: Function which returns the number of byte * 1283 * ============== positions as yet unused in the Transmit ctrl * 1284 * Buffer. * 1285 * * 1286 * routine TXDATABUFFroom: Function which returns the number of byte * 1287 * ============== positions as yet unused in the Transmit data * 1288 * Buffer. * 1289 * * 1290 * At entry: * 1291 * a2.l = TXBUFF base address (shifted, +1+selectcode) * 1292 * a3.l = card base address ($00xx0001) * 1293 * d5.l = TXDATABUFF_SIZE or TXCTRLBUFF_SIZE * 1294 * (unshifted, not adjusted) * 1295 * * 1296 * Upon exit: * 1297 * d0.l = TXDATABUFF_FILL or TXCTRLBUFF_FILL (unshifted) * 1298 * d3.l = Number of bytes left * 1299 * This also bashes d2. * 1300 * * 1301 * This routine uses the card's SEMAPHORE to gain access. * 1302 * * 1303 * This routine calls gain_access and release_access. * 1304 * * 1305 ******************************************************************************** 1306 1307 0000 03EC TXCTRLBUFFroom equ * 1308 000003EC 4280 clr.l d0 ; Get garbage out of top of d0&d3 1309 000003EE 4283 clr.l d3 1310 000003F0 010A 0008 movep.w CTRL_AREA+FILL(a2),d0 1311 000003F4 6100 FC0A bsr gain_access ; Need access to EMPTY 1312 000003F8 070A 000C movep.w CTRL_AREA+EMPTY(a2),d3 ; Fetch pointers (bytes in wrong order) 1313 000003FC 6010 bra.s room1 1314 1315 0000 03FE TXDATABUFFroom equ * 1316 000003FE 4280 clr.l d0 ; Get garbage out of top of d0&d3 1317 00000400 4283 clr.l d3 1318 00000402 010A 0018 movep.w DATA_AREA+FILL(a2),d0 1319 00000406 6100 FBF8 bsr gain_access ; Need access to EMPTY PAGE 34 [3.3a] 6/28/89 17:45:18 DC_TXBUF: TX BUFFER UTILITIES (GDC) 1320 0000040A 070A 001C movep.w DATA_AREA+EMPTY(a2),d3 ; Fetch pointers (bytes in wrong order) 1321 0000040E 6100 FC46 room1 bsr release_access 1322 1323 00000412 E058 ror.w #8,d0 ; Switch bytes in d0 & d3 1324 00000414 E05B ror.w #8,d3 1325 1326 00000416 9640 sub.w d0,d3 ; Compute d3 := EMPTY-FILL 1327 00000418 5343 subq.w #1,d3 ; (EMPTY-FILL-1) 1328 0000041A 6C02 bge.s room2 1329 0000041C D645 add.w d5,d3 ; If negative, add size 1330 1331 0000041E 4E75 room2 rts ; Return (EMPTY-FILL-1) mod SIZE PAGE 35 [3.3a] 6/28/89 17:45:18 DC_TXBUF: TX BUFFER UTILITIES (GDC) 1333 ******************************************************************************** 1334 * * 1335 * routine putchars: Routine which takes characters from the * 1336 * ======== area sc_subtabletype.data_address sized by * 1337 * sc_subtabletype.data_number and moves * 1338 * them to the Transmit buffer. The number of * 1339 * characters actually transfered is the minimum * 1340 * of: (1) the number of characters available; * 1341 * (2) the number of byte positions left in the * 1342 * Transmit buffer; and (3) the number of byte * 1343 * positions in the Transmit buffer until the * 1344 * wraparound point. THIS NUMBER CAN BE ZERO. * 1345 * This alters data_address and data_number to * 1346 * reflect where to start going next time this * 1347 * is called. The entire transfer is done when * 1348 * data_number goes to zero. * 1349 * * 1350 * At entry: * 1351 * a2.l = TX buffer record base address (shifted, +1+selectcode) * 1352 * a3.l = card base address ($00xx0001) * 1353 * a4.l = pointer to sc_subtabletype structure * 1354 * * 1355 * Upon exit: * 1356 * data_number and data_address are updated, plus FILL in the * 1357 * card's Transmit buffer. * 1358 * a1, d4 and d5 are left with the values from find_DATA_AREA. * 1359 * This bashes d0, d1, d2, d3, d4, d5, a0, and a1. * 1360 * * 1361 * Interrupts: * 1362 * This does its own enabling/disabling. Interrupts are left ON. * 1363 * * 1364 * This routine uses the card's SEMAPHORE to gain access. * 1365 * * 1366 * This routine calls gain_access, release_access, TXDATABUFFroom, * 1367 * and find_DATA_AREA. * 1368 * * 1369 ******************************************************************************** 1370 1371 0000 0420 putchars equ * 1372 00000420 6100 FC98 bsr find_DATA_AREA ; Setup a1 = data buffer base addr 1373 * d4 = end of data buffer addr 1374 * d5 = TXDATABUFF_SIZE 1375 00000424 61D8 bsr TXDATABUFFroom ; d3.l = available buffer positions 1376 00000426 2200 move.l d0,d1 ; d0.l = d1.l = TXDATABUFF_FILL 1377 00000428 2004 move.l d4,d0 1378 0000042A 0280 0000 andi.l #$0000FFFE,d0 FFFE 1379 00000430 E280 asr.l #1,d0 ; d0.l = unshifted TXDATABUFF_END 1380 00000432 9081 sub.l d1,d0 ; d0.l = remaining positions to wrap 1381 1382 00000434 B680 cmp.l d0,d3 ; If d0>d3 then set d0 := d3 1383 00000436 6E02 bgt.s pc1 1384 00000438 2003 move.l d3,d0 1385 1386 0000043A 242C 000E pc1 move.l data_number(a4),d2 ; Fetch number of chars avail into d2 1387 0000043E B480 cmp.l d0,d2 ; If d0>d2 then set d0 := d2 1388 00000440 6E02 bgt.s pc2 PAGE 36 [3.3a] 6/28/89 17:45:18 DC_TXBUF: TX BUFFER UTILITIES (GDC) 1389 00000442 2002 move.l d2,d0 1390 1391 00000444 2600 pc2 move.l d0,d3 ; d3.l saves number of chars actually 1392 * ; transferred below 1393 00000446 6740 beq.s pcdone ; If zero, no work to be done 1394 00000448 5340 subq.w #1,d0 ; Make offset correct for dbf instr. 1395 0000044A 206C 000A movea.l data_address(a4),a0 ; Get character pointer into a0 1396 1397 0000044E E349 lsl.w #1,d1 1398 00000450 D28B add.l a3,d1 1399 00000452 48E7 0040 movem.l a1,-(sp) ; Save a1 so we can use the register 1400 00000456 2241 movea.l d1,a1 ; Now a1 is useable pointer 1401 1402 00000458 1298 pcloop move.b (a0)+,(a1) ; Transfer a character & bump source ptr 1403 0000045A 5449 addq.w #2,a1 ; Bump destination pointer (odd bytes) 1404 0000045C 51C8 FFFA dbf d0,pcloop ; Then decrement d0 & loop 1405 1406 00000460 9483 sub.l d3,d2 1407 00000462 2942 000E move.l d2,data_number(a4) ; Now store adjusted number and 1408 00000466 2948 000A move.l a0,data_address(a4) ; address fields 1409 1410 0000046A 2209 move.l a1,d1 ; Move 68000 FILL pointer into d1 1411 0000046C 4CDF 0200 movem.l (sp)+,a1 ; Restore a1 before we forget! 1412 00000470 B881 cmp.l d1,d4 ; Now check to see if FILL was moved 1413 00000472 6602 bne.s pc3 ; past end of buffer. If so, set to 1414 00000474 2209 move.l a1,d1 ; the front of the buffer. 1415 00000476 0881 0000 pc3 bclr #0,d1 ; Fix up the 68000 pointer to be the 1416 0000047A EF59 rol.w #7,d1 ; card's type of pointer 1417 0000047C 6100 FB82 bsr gain_access 1418 00000480 038A 0018 movep.w d1,DATA_AREA+FILL(a2) ; Remember d1 = card's FILL pointer. 1419 00000484 6100 FBD0 bsr release_access 1420 00000488 4E75 pcdone rts PAGE 37 [3.3a] 6/28/89 17:45:18 DC_TXBUF: TX BUFFER UTILITIES (GDC) 1422 ******************************************************************************** 1423 * * 1424 * routine putctrlblk: Routine which puts a control block into the * 1425 * ========== Transmit buffer area of the card. The * 1426 * appropriate pointers are updated to reflect * 1427 * the control block. This routine also contains * 1428 * a timeout mechanism which will be adjusted * 1429 * to the proper values later. If a timeout * 1430 * occurs, an escape is done with NO DAMAGE to * 1431 * the buffer. The only thing that can cause the * 1432 * timeout is < 4 positions left in the control * 1433 * buffer. SEMAPHORE timeout is not handled * 1434 * by this routine. * 1435 * * 1436 * At entry: * 1437 * sc_subtabletype.term = TERM field for control block (8 bits) * 1438 * sc_subtabletype.mode = MODE field for control block (8 bits) * 1439 * a2.l = TX buffer record base address (shifted, +1+selectcode) * 1440 * a3.l = card base address ($00xx0001) * 1441 * a4.l = pointer to sc_subtabletype structure * 1442 * * 1443 * Upon exit: * 1444 * FILL in the card's transmit control buffer is updated. * 1445 * a1, d4 and d5 are left with the values from find_CTRL_AREA. * 1446 * This bashes d0, d1, d2, d3, d4, d5, a0 and a1. * 1447 * This uses inner/outer_tx_count for computing timeouts. * 1448 * * 1449 * Interrupts: * 1450 * This does its own enabling/disabling. Interrupts are left ON. * 1451 * * 1452 * This routine uses the card's SEMAPHORE to gain access. * 1453 * * 1454 * This routine calls TXCTRLBUFFroom, escape, gain_access, find_CTRL_AREA,* 1455 * eir, dir and release_access. * 1456 * * 1457 ******************************************************************************** 1458 1459 0000 048A putctrlblk equ * 1460 0000048A 6100 FC06 bsr find_TXBUF 1461 0000048E 6100 FC30 bsr find_CTRL_AREA ; Setup a1 = ctrl buffer base addr 1462 * d4 = end of ctrl buffer addr 1463 * d5 = TXCTRLBUFF_SIZE 1464 00000492 296C 0004 move.l timeout(a4),outer_tx_count(a4) 0012 1465 1466 ********** START OF ANNY'S CHANGES ********** 1467 00000498 0838 0001 btst #timer_absent,sysflag2 ; timer absent FEDA 1468 0000049E 6612 bne.s pcb_t1 ; branch if so 1469 1470 000004A0 486C 0012 pea outer_tx_count(a4) 1471 000004A4 4EB8 0000 jsr milli_to_micro ; Translate value to microseconds 1472 000004A8 486C 0012 pea outer_tx_count(a4) ; now contains us value 1473 000004AC 4EB8 0000 jsr start_timer ; value of timer at timeout returned 1474 * in timeout_counter 1475 000004B0 6008 bra.s pcbwait ; jump over processor dependent init. 1476 *********************************************** PAGE 38 [3.3a] 6/28/89 17:45:18 DC_TXBUF: TX BUFFER UTILITIES (GDC) 1477 1478 000004B2 297C 0000 pcb_t1 move.l #pcbtimeout,inner_tx_count(a4) ; Load timeout value 000B 001E 1479 1480 000004BA 6100 FF30 pcbwait bsr TXCTRLBUFFroom ; Get d3 = #bytes available in buffer 1481 000004BE 0C83 0000 cmpi.l #4,d3 ; and d0 = CTRLBUFF_FILL (unshifted) 0004 1482 000004C4 6C34 bge.s roomok ; If >=4 bytes, can go ahead! 1483 1484 ******** ANNY'S CHANGES ******** 1485 000004C6 0838 0001 btst #timer_absent,sysflag2 ; timer absent? FEDA 1486 000004CC 660E bne.s pcb_t2 ; branch if so 1487 1488 000004CE 486C 0012 pea outer_tx_count(a4) 1489 000004D2 4EB8 0000 jsr check_timer ; Test for timeout condition 1490 000004D6 6AE2 bpl.s pcbwait ; if it hasn't timed out, goto pcbwait 1491 000004D8 6000 FC0A bra time_err ; if it has timed out, goto time_err 1492 ******** END OF ANNY'S CHANGES ******** 1493 1494 000004DC 53AC 001E pcb_t2 subq.l #1,inner_tx_count(a4) 1495 000004E0 66D8 bne.s pcbwait ; Loop, then if it times out give an 1496 000004E2 297C 0000 move.l #pcbtimeout,inner_tx_count(a4) 000B 001E 1497 000004EA 4AAC 0012 tst.l outer_tx_count(a4) 1498 000004EE 67CA beq.s pcbwait 1499 000004F0 53AC 0012 subq.l #1,outer_tx_count(a4) 1500 000004F4 66C4 bne.s pcbwait 1501 000004F6 6000 FBEC bra time_err ; escape(timeout). 1502 1503 000004FA E348 roomok lsl.w #1,d0 ; Make CTRLBUFF_FILL into a 68000 1504 000004FC D08B add.l a3,d0 ; pointer 1505 000004FE 2040 movea.l d0,a0 ; Put in a0 to use it. 1506 1507 00000500 010A 0018 movep.w DATA_AREA+FILL(a2),d0 ; Get the DATA_FILL pointer to put 1508 00000504 0188 0000 movep.w d0,POINTER(a0) ; into the POINTER FIELD 1509 00000508 302C 0008 move.w term_and_mode(a4),d0 1510 0000050C 0188 0004 movep.w d0,TERMFIELD(a0) 1511 00000510 5088 addq.l #CTRLBLKSIZE,a0 ; Bump pointer by TWO bytes 1512 1513 00000512 2208 move.l a0,d1 ; Move 68000 FILL pointer into d1 1514 00000514 B881 cmp.l d1,d4 ; Now check to see if FILL was moved 1515 00000516 6602 bne.s pcb1 ; past end of buffer. If so, set to 1516 00000518 2209 move.l a1,d1 ; the front of the buffer. 1517 0000051A 0881 0000 pcb1 bclr #0,d1 ; Fix up the 68000 pointer to be the 1518 0000051E EF59 rol.w #7,d1 ; card's type of pointer 1519 00000520 6100 FADE bsr gain_access 1520 00000524 038A 0008 movep.w d1,CTRL_AREA+FILL(a2) 1521 00000528 6100 FB2C bsr release_access 1522 0000052C 4E75 rts PAGE 39 [3.3a] 6/28/89 17:45:18 DC_TXBUF: TX BUFFER UTILITIES (GDC) 1524 ************************************************* 1525 * * 1526 * routine try_sending_EOF: tries to send EOF * 1527 * and returns immediately if * 1528 * unsuccessful. * 1529 * * 1530 * At entry: * 1531 * a2.l = TX buffer-record base addr * 1532 * a3.l = card base address * 1533 * a4.l = pointer to sc_subtabletype * 1534 * * 1535 * Upon exit: * 1536 * d0.l = 0 if unsuccessful; * 1537 * 1 if successful. * 1538 * * 1539 * This bashes d0,d1,d2,d3,d4,d5,a0 & a1 * 1540 * * 1541 ************************************************* 1542 1543 0000 052E try_sending_EOF equ * 1544 0000052E 7204 moveq #4,d1 1545 00000530 4280 clr.l d0 1546 00000532 102A FFFC move.b TXENDBLOCKSPACE-TXBUFF(a2),d0 1547 00000536 6714 beq.s sE3 ; If it's zero jump down & wait for 4 1548 00000538 2200 move.l d0,d1 ; bytes in the control queue 1549 0000053A 6100 FB7E sE1 bsr find_DATA_AREA ; Setup a1 = data buffer base addr 1550 * d4 = end of data buffer addr 1551 * d5 = TXDATABUFF_SIZE 1552 0000053E 6100 FEBE sE1loop bsr TXDATABUFFroom ; Now hang until enough space becomes 1553 00000542 B681 cmp.l d1,d3 ; available in the data queue 1554 00000544 6C04 bge.s sE2 1555 00000546 4280 noroom clr.l d0 1556 00000548 4E75 rts 1557 1558 0000054A 7208 sE2 moveq #8,d1 ; if TXENDBLOCKSPACE#0 then wait for 1559 * ; 8 bytes, not 4. 1560 0000054C 6100 FB72 sE3 bsr find_CTRL_AREA ; Setup a1 = ctrl buffer base addr 1561 * d4 = end of ctrl buffer addr 1562 * d5 = TXCTRLBUFF_SIZE 1563 00000550 6100 FE9A sE3loop bsr TXCTRLBUFFroom ; Now hang until enough space becomes 1564 00000554 B681 cmp.l d1,d3 ; available in the ctrl queue 1565 00000556 6DEE blt.s noroom 1566 1567 00000558 397C 0500 sE6 move.w #$0500,term_and_mode(a4) 0008 1568 0000055E 6100 FF2A bsr putctrlblk 1569 00000562 7001 moveq #1,d0 1570 00000564 4E75 rts 1571 1572 1573 1574 end PASS 1 ERRORS: 0 PASS 2 ERRORS: 0