Image Map Image Map
Page 2 of 14 FirstFirst 12345612 ... LastLast
Results 11 to 20 of 135

Thread: Frustrating Problem

  1. #11
    Join Date
    Jan 2007
    Location
    Pacific Northwest, USA
    Posts
    33,153
    Blog Entries
    18

    Default

    Well, Cool Amp is a powder of precipitated chalk and silver chloride. Basically, apply it with a moistened cloth and rub it in to molecularly bond with copper. I sometimes use it on bare copper PCBs, but electroless tin is probably easier.

    I learned about Cool Amp in my steel mill days. There were test points for reading thermocouples using Ralco wooden plugs and porcelain sockets. The technician carried around his L&N potentiometer and plugged into the various test points and read temperatures. The problem was that the Ralco contacts were plain copper and so temperature readings could be problematical if the contacts got too dirty. So every couple of months, we resurfaced the contacts using Cool Amp.

    To those uninitiated, a Ralco plug:



    And an L&N potentiometer:



    (I can't imagine what the Gen Z people think about this stuff They probably think I made my rounds on horseback.)

  2. #12
    Join Date
    Dec 2013
    Location
    Near Milwaukee Wisconsin
    Posts
    1,226

    Default

    Well.... it's deviling me again. Last night I played with the machine for a few hours. Probably loaded CPM more than 100 times. Made files erased files, loaded and used Word Star, assembled, printed, turn the machine on and off. The computer worked like a champ. Then this afternoon it was back to it's poor performance. Again it would correctly load a few sectors and stop. Sometimes 3 sometimes 20 sectors and again it would get stuck in the MSR polling loop, during the Command Phase of the FDC. The loop was looking to output command information to the FDC and the FDC was ready to send something back to the system.

    I have 5 boards that I have made over the years, the CPU, 32k memory, serial and parallel I/O, FDC board, front panel control board. Some are older than others. The CPU board has all most all gold plated wire wrap sockets, where as the FDC board is the newest, maybe 6 years old and has no gold plated sockets. I personally believe that this is a connection problem, just from the fact that sometimes the system works just fine and then as if a switch is thrown, it doesn't.

    I seem to have ruled out the drives and the cables between the computer and the drives. I have a set up that I can read/write/format etal my media using a newer DOS machine. I tested the drives for a number of days and never had a problem. There is a 50 wire ribbon between the FDC card and the back of the computer case. This as most of my cable are made by me. I kind of suspect this cable because I could not test it on the DOS machine. I need to make a converter, maybe I try that.

    I have never used an eraser on pins. I have used some contact cleaner and/or a razor blade to scrap them some. I do have a few old Texas Instruments IC's where the IC leads turn black. I cleaned the leads but not the sockets. Maybe I need to inspect and clean all the FDC sockets. Maybe change out these TI chips and sockets.

    I don't have any DIP switches. All my selection circuits use small jumpers on pins. All the S-100 pins to the Motherboard are gold plated and they look OK, but maybe they need cleaning also.

    Are you suggesting that I coat each chip lead with a little dielectric grease and re insert them in their socket? I have a jewelers loop. I suppose I can inspect each socket for corrosion and then use the grease.

    Here is my CBIOS system loader
    Code:
    ;This is the start of the PCM COLD START LOADER
    CPMBOOT:	MVI	A,04H		;9600 Baud 200 Octal, 080H for 300
    		STA	DIVID
    		CALL	INIT51A	;Set printer baud
    		MVI	A,0C3H	;Set jump instruction for interrupt
    		STA	08H
    		LXI	H,ISR
    		SHLD	09H
    		LXI	SP,STKPOT	;Setup Stack
    		XRA	A		;Clear a number of flags & Registers
    		STA	INPROG
    		STA	ST0
    		STA	ST1
    		STA	ST2
    		STA	ST3
    		STA	FDCERROR
    		EI
    SETFDC:	CALL	CSPEC		;Call Specify
    		CALL	CSDS		;Call Sense Drive
    RDY:		XRA	A		;Set Drive = 0, A:
    		STA	DRIVE
    		CALL	CRECAL	;Recalibrate A:
    		MVI	A,01H
    		STA	DRIVE
    		CALL	CRECAL	;Recalibrate B:
    		XRA	A
    		STA	DRIVE		;Set Drive = A:
    		LXI	B,02H	
    		MOV	A,B
    		STA	TRACK		;Set TRACK = 0
    		MOV	A,C
    		STA	SECTOR	;Set SECTOR = 2, this is the 1st sector to read
    		MVI	D,30		;Total # of sectors to read
    		LXI	H,CCP		;Bottom of CCP
    		MOV	A,H
    		STA	DMALSBAD	;Store DMA LSB address
    		MOV	A,L
    		STA	DMAMSBAD	;Store DMA MSB address
    RDISK:	MVI	A,DMARMODE	;Set DMA mode to read
    		OUT	DMAMDEPT
    		CALL	SETDMA	;Set up DMA transfer spec's
    		CALL	CREAD		;READ one predetermined sector
    		DCR	D
    		JNZ	CPM		;GO to CPM after all system tracks read
    		PUSH	B
    		LXI	B,080H	;Add 128 bytes to DMA address for next sector
    		LDA	DMALSBAD	;Put old DMA address in HL
    		MOV	L,A
    		LDA	DMAMSBAD
    		MOV	H,A
    		DAD	B		;Add HL + BC
    		MOV	A,L		;Save new DMA address
    		STA	DMALSBAD
    		MOV	A,H
    		STA	DMAMSBAD
    		POP	B
    		INR	C		;Next Sector
    		MOV	A,C
    		STA	SECTOR
    		CPI	01BH		;At sector 27? Go to next track
    		JC	RDISK		;No, continue
    		MVI	C,01H		;Reset Sector to 1
    		MOV	A,C
    		STA	SECTOR
    		INR	B		;Set track = 1
    		MOV	A,B
    		STA	TRACK
    		CALL	CSEEK
    		JMP	RDISK
    CREAD is the command phase for the FDC. It sends the command information to the FDC. Once that is complete, the program branches to WAITINT. This program waits and then interprets the interrupt. Once that is done, it branches to RREAD, which gets the results from the FDC. Returns to the CBIOS to do it again until CPM is all loaded.

    Anyway, thanks for the help. I suppose this week end I will sit down and really go over my FDC board. I suspect it more than the rest of the system in that my 2K monitor, front panel, and I/O seems to work just fine. Oh by the way last night when CPM was loading OK, I ran a memory program I have and it ran fine for more than an hour.

    Geeezzzz...... Thanks for the help, Mike

    PS, I also checked the 7805 voltage regulator for noise, it has about 5 mVolts ripple.

  3. #13
    Join Date
    Jan 2007
    Location
    Pacific Northwest, USA
    Posts
    33,153
    Blog Entries
    18

    Default

    LDA DMALSBAD ;Put old DMA address in HL
    MOV L,A
    LDA DMAMSBAD
    MOV H,A
    That makes no sense. The second LDA should be "DMAMSBAD+1"; alternatively, just replace the entire sequence with "LHLD DMAMSBAD".

    Actually, to increment the contents of DMAMSBAD you should try:

    Code:
            LHLD DMAMSBAD
            LXI    B,80H
            DAD  B
            SHLD DMAMSBAD
    There are other ways to accomplish the same thing as well. But your code up there doesn't do what you think it does. Also, are you aware of the 24 sec required delay when the 8272/765 is changing states before you see the result? (cf. PDF page 4, second column boldface in the datasheet). Since you didn't post the CREAD routine, I don't know what you're doing there.
    Last edited by Chuck(G); December 5th, 2019 at 08:52 PM.

  4. #14

    Default

    Machined pin sockets SEEM to stay good almost forever. Although they are very expensive (and now hard to find), that is the only kind that I will use in a project in order to avoid future frustration. Because all my projects are considered "permanent", I might even solder wire wrap connections. There is some controversy about whether this is a good idea or not, but I have projects 25+ years old made this way that work fine and I've never had to touch them once built and debugged.

    OTOH, I worked for two companies where the pressure to "save money" on sockets and connectors cost them very dearly later.

    I built my first XT clone with a blank board and stuffed/soldered it. I used RN side-wipe sockets. The board didn't work. I took it to an engineer and he told me that he wouldn't even look at it until I removed those @#$@#$@$ sockets. One night (overnight, actually) with an industrial desoldering station I removed every socket on that board (60+ chips) and resoldered the chips in directly (except the 8088 and UVEPROMS, for which I used Augat machined pin sockets). Plugged it in, and it worked fine for the next 10 years.

  5. #15

    Default

    Quote Originally Posted by Dwight Elvey View Post
    My brother who worked for PG&E would use silicon grease on things like tail lamps to protect them from corrosion and moisture.
    This stuff absolutely works, and a little goes a long way. You might have to look for or ask for it a larger automotive store. It is sold in very small tubes and is fairly cheap.

  6. #16
    Join Date
    Oct 2016
    Location
    Dutchess County, New York, USA
    Posts
    68

    Default

    Quote Originally Posted by Dwight Elvey View Post
    Years ago, I did some experiments. While at Intel, I was often reseating things. In some cases, we found that things like using an orange eraser would actually cause later corrosion. It was from the rubber used. I believe this was from sulfur in the rubber.
    In looking at thinks, I took a scrap connector, gold plated, and a card edge, also gold plated, and did a careful 4 point ohm measurement of the contacts. I found the typical resistance to be on the order of 10-20 milliohms. My brother who worked for PG&E would use silicon grease on things like tail lamps to protect them from corrosion and moisture. So, I tried it on my connectors. After measuring, I found that the resistance was less than 2 milliohms ( the limit of the J Fluke meter I was using ).
    A few years later I had put together a ZX81 and used a RAM expansion. I found that even the slightest bump would kill the code. I applied some of the grease to the connection. After doing so, I could bounce the computer off the table from 3 feet without the code being trashed.
    Over the years, I've used various silicon grease products. The one problem I've had was that the oil would eventually leave, leaving a hard to remove scum. Still, a little fresh grease and it would come back to normal.
    Today we have a similar product specifically designed for connections, unlike that that I used. It is automotive dielectric grease. I suggest this be tried.
    Dwight
    What was the stuff that Jerry Pournelle used to put on connectors and stuff? Some kind of space program spin off product that cost $50 per 1/4 oz or something like that back in the '80's. If my old Byte mag's were still around I'd look it up.
    Crazy old guy with a basement full of Pentium 1 laptops and parts

  7. #17

    Default

    Quote Originally Posted by DeltaDon View Post
    What was the stuff that Jerry Pournelle used to put on connectors and stuff? Some kind of space program spin off product that cost $50 per 1/4 oz or something like that back in the '80's. If my old Byte mag's were still around I'd look it up.
    I believe you're referring to "Tweek". It's still available but is now under the name Stabilant 22A .

    As to electrical "grease", Dow Corning DC-4 is used in aviation circles and is available from a variety of suppliers.

  8. #18
    Join Date
    Dec 2013
    Location
    Near Milwaukee Wisconsin
    Posts
    1,226

    Default

    Well, you may have noticed, I'm not the most efficient coder. But for a guy who spent his career in a coal fired power plant the stuff I write generally works, eventually. Maybe you didn't notice that there are two values DMA LSB AD or the DMA least significant digit and DMA MSB AD or DMA most significant digit. I'm sure after I find this elusive problem, I can improve my code. I also just noticed that I posted an earlier version, which I'm not using anymore. I'll post the correct code later, sorry about that, Mike

  9. #19
    Join Date
    Dec 2013
    Location
    Near Milwaukee Wisconsin
    Posts
    1,226

    Default

    One of my biggest problems, as I get older and older, is staying organized. I wasn't that good when I was younger, but it is constantly getting worse. I am aware of the 24 uSec service requirement, although I thought it was 27 uSec. Here is the full Monty, for what it is worth. The error handling is not pretty, but if there is no errors it is not needed. Some time in the future I'd like to clean it up, Mike

    Code:
     FC25 210400              CPMBOOT:	LXI	H,0004H		;04H 9600 Baud, 080H for 300
     FC28 2214F7    		SHLD	DIVID		        ;015DH FOR 110 BAUD
     FC2B CD5FF8    		CALL	INIT51A		;Set printer baud
     FC2E 3EC3      		 MVI	A,0C3H		;Set jump instruction for interrupt
     FC30 320800    		STA	08H
     FC33 2131FF    		LXI	H,ISR
     FC36 220900    		SHLD	09H
     FC39 318000    		LXI	SP,STKPOT	;Setup Stack
     FC3C AF        		XRA	A		;Clear a number of flags & Registers
     FC3D 3209F7    		STA	INPROG
     FC40 3210F7    		STA	ST0
     FC43 3211F7    		STA	ST1
     FC46 3212F7    		STA	ST2
     FC49 3213F7    		STA	ST3
     FC4C 320AF7    		STA	FDCERROR
     FC4F FB        		EI
     FC50 CDF5FC             SETFDC:		CALL	CSPEC		;Call Specify
     FC53 CD09FD    		CALL	CSDS		;Call Sense Drive 0
     FC56 3E01      		MVI	A,01H
     FC58 3206F7    		STA	DRIVE
     FC5B CD09FD    		CALL	CSDS		;Sense Drive 1
     FC5E AF        RDY:		XRA	A		;Set Drive = 0, A:
     FC5F 3206F7    		STA	DRIVE
     FC62 CD1DFD    		CALL	CRECAL		;Recalibrate A:
     FC65 3E01      		MVI	A,01H
     FC67 3206F7    		STA	DRIVE
     FC6A CD1DFD    		CALL	CRECAL		;Recalibrate B:
     FC6D AF        		XRA	A
     FC6E 3206F7    		STA	DRIVE		;Set Drive = A:
     FC71 010200    		LXI	B,02H	
     FC74 78        		MOV	A,B
     FC75 3200F7    		STA	TRACK		;Set TRACK = 0
     FC78 79        		MOV	A,C
     FC79 3202F7    		STA	SECTOR		;Set SECTOR = 2, this is the 1st sector to read
     FC7C 1652      		MVI	D,52H		;Total # of sectors to read
     FC7E 2100DC    		LXI	H,CCP		;Bottom of CCP
     FC81 7C        		MOV	A,H
     FC82 3205F7    		STA	DMAMSBAD	        ;Store DMA MSB address
     FC85 7D        		MOV	A,L
     FC86 3204F7    		STA	DMALSBAD	        ;Store DMA LSB address
     FC89 3E44      		MVI	A,DMARMODE	 ;Set DMA mode to read
     FC8B D3AB      		OUT	DMAMDEPT
     FC8D CD11FF    RDISK:		CALL	SETDMA		;Set up DMA transfer spec's
     FC90 CD73FD    		CALL	CREAD		;READ one predetermined sector
     FC93 15        		DCR	D
     FC94 CAC8FC    		JZ	CPM		;GO to CPM after all system tracks read
     FC97 C5        		PUSH	B
     FC98 018000    		LXI	B,080H		;Add 128 bytes to DMA address for next sector
     FC9B 3A04F7    		LDA	DMALSBAD	;Put old DMA address in HL
     FC9E 6F        		MOV	L,A
     FC9F 3A05F7    		LDA	DMAMSBAD
     FCA2 67        		MOV	H,A
     FCA3 09        		DAD	B		;Add HL + BC
     FCA4 7D        		MOV	A,L		;Save new DMA address
     FCA5 3204F7    		STA	DMALSBAD
     FCA8 7C        		MOV	A,H
     FCA9 3205F7    		STA	DMAMSBAD
     FCAC C1        		POP	B
     FCAD 0C        		INR	C		;Next Sector
     FCAE 79        		MOV	A,C
     FCAF 3202F7    		STA	SECTOR
     FCB2 FE1B      		CPI	01BH		;At sector 27? Go to next track
     FCB4 DA8DFC    		JC	RDISK		;No, continue
     FCB7 0E01      		MVI	C,01H		;Reset Sector to 1
     FCB9 79        		MOV	A,C
     FCBA 3202F7    		STA	SECTOR
     FCBD 04        		INR	B		;Set track = 1
     FCBE 78        		MOV	A,B
     FCBF 3200F7    		STA	TRACK
     FCC2 CD3EFD    		CALL	CSEEK
     FCC5 C38DFC    		JMP	RDISK
     FCC8 3A00DC    CPM:		LDA	CCP
     FCCB B7        		ORA	A
     FCCC FEC3      		CPI	0C3H		;Does the 1st address of CCP have a JUMP?
     FCCE C2D7FC    		JNZ	NOSYS		;No C3, Disk doesn't have system on it
     FCD1 AF        		XRA	A
     FCD2 4F        		MOV	C,A
     FCD3 47        		MOV	B,A
     FCD4 C300F2    		JMP	BIOS		;Start CP/M
     FCD7 CD4DF9    NOSYS:		CALL	CRLF
     FCDA 21E6FC    		LXI	H,SYSMESS
     FCDD CDA7FB    		CALL	NXTLET
     FCE0 CDBFF9    		CALL	TTYI		;Wait for user response
     FCE3 C325FC    		JMP	CPMBOOT
     FCE6 4E4F205359SYSMESS:	DB	'NO SYSTEM DISK',ZERO
                    
                    ;COMMAND	INTERRUPT	RESULT PHASE
                    ;READ		YES		YES
                    ;WRITE		YES		YES
                    ;RECAL		YES		NO
                    ;SENSE INT	        NO		YES
                    ;SPECIFY	        NO		NO
                    ;SENSE DRIVE	NO		YES
                    ;SEEK		        YES		NO
                    
                    ;SPECIFY SETS VALUES FOR HEAD LOAD TIME, HEAD UNLOAD TIME,
                    ;AND STEP RATE. ALSO DMA OR NOT JANUARY 30, 2017, I HAD TROUBLE WITH SECTOR ERRORS, FOUND
                    ;THAT THE DRIVE PARAMETERS WERE TOO TIGHT. CHANGED SRT FROM
                    ;10MS TO 8MS, HUT FROM 32MS TO 240MS AND HLT FROM 40MS TO
                    ;254MS. THEY ARE AT MAX, AND MAYBE A LITTLE SLOW, BUT IT WORKS!
     FCF5 0603      CSPEC:		MVI	B,03H
     FCF7 2108F7    		LXI	H,COMMAND
     FCFA 70        		MOV	M,B
     FCFB CDE5FD    		CALL	FDCOUT
     FCFE 068F      		MVI	B,08FH		;SRT=1000, 8MS
     FD00 CDE5FD    		CALL	FDCOUT		;HUT=1111, 240MS
     FD03 06FE      		MVI	B,0FEH		;HLT=1111111, 254MS
     FD05 CDE5FD    		CALL	FDCOUT		;ND=0, USE DMA
     FD08 C9        		RET
                    
                    ;SENSE DRIVE IS USED TO OBTAIN DRIVE STATUS IN ST3
     FD09 0604      CSDS:		MVI	B,04H
     FD0B 2108F7    		LXI	H,COMMAND
     FD0E 70        		MOV	M,B
     FD0F CDE5FD    		CALL	FDCOUT
     FD12 2106F7    		LXI	H,DRIVE
     FD15 46        		MOV	B,M
     FD16 CDE5FD    		CALL	FDCOUT
     FD19 CD4AFE    		CALL	RSDS
     FD1C C9        		RET
                    		
                    ;RECALIBRATE CAUSES THE HEAD TO RETACT TO TRACK 0. AS LONG
                    ;AS TRACK 0 SIGNAL IS LOW, DIRECTION IS HIGH AND STEP
                    ;PULSES ARE ISSUED. IF TRACK 0 IS STILL LOW AFTER 77 PULSES
                    ;EQUIPMENT ERROR FLAG (ST0) IS SET.
     FD1D 0607      CRECAL:		MVI	B,07H
     FD1F 2108F7    		LXI	H,COMMAND
     FD22 70        		MOV	M,B
     FD23 CDE5FD    		CALL	FDCOUT
     FD26 2106F7    		LXI	H,DRIVE
     FD29 46        		MOV	B,M
     FD2A CDE5FD    		CALL	FDCOUT
     FD2D CDF5FD    		CALL	WAITINT
     FD30 C9        		RET
                    
                    ;SENSE INTERRUPT
     FD31 0608      CSIS:		MVI	B,08H
     FD33 2108F7    		LXI	H,COMMAND
     FD36 70        		MOV	M,B
     FD37 CDE5FD    		CALL	FDCOUT
     FD3A CD57FE    		CALL	RSIS
     FD3D C9        		RET
                    
                    ;SEEK MOVES HEAD TO SPECIFIED TRACK. WHEN TRACK ADDRESS
                    ;ARE EQUAL ST0 BIT 5 SEEK END IS SET. IF DRIVE BECOMES
                    ;NOT READY ST0 BIT 3 IS SET.	
     FD3E F5        CSEEK:		PUSH	PSW
     FD3F C5        		PUSH	B
     FD40 3EFF      		MVI	A,0FFH
     FD42 3209F7    		STA	INPROG
     FD45 060F      		MVI	B,0FH
     FD47 2108F7    		LXI	H,COMMAND
     FD4A 70        		MOV	M,B
     FD4B CDE5FD    		CALL	FDCOUT
     FD4E 2106F7    		LXI	H,DRIVE
     FD51 46        		MOV	B,M
     FD52 CDE5FD    		CALL	FDCOUT
     FD55 2100F7    		LXI	H,TRACK
     FD58 46        		MOV	B,M
     FD59 CDE5FD    		CALL	FDCOUT
     FD5C CDF5FD    		CALL	WAITINT
     FD5F AF        		XRA	A
     FD60 3209F7    		STA	INPROG
     FD63 C1        		POP	B
     FD64 F1        		POP	PSW
     FD65 C9        		RET
                    
                    ;WRITE SINCE THE WRITE COMMAND IS SIMULAR TO READ, ONLY
                    ;THE COMMAND AND DMA = WRITE ARE ISSUED, THEN JUMP INTO
                    ;THE READ ROUTINE.
                    ;THE DRIVE, TRACK & SECTOR HAVE TO PRESET THEN 128 BYTES
                    ;ARE WRITTEN WHEN THOSE ITEMS ARE FOUND. TWO CRC BYTES
                    ;ARE WRITTEN AT THE END OF THE DATA FIELD. A READ IS DONE
                    ;AND CHECKS THE CRC, IF ERROR, THE ST1 BIT 5 IS SET
     FD66 F5        CWRITE:		PUSH	PSW
     FD67 C5        		PUSH	B
     FD68 D5        		PUSH	D
     FD69 E5        		PUSH	H
     FD6A 3E48      		MVI	A,DMAWMODE
     FD6C D3AB      		OUT	DMAMDEPT
     FD6E 0605      		MVI	B,05H
     FD70 C37DFD    		JMP	CREAD1
                    
                    ;READ, IF FDC DETECTS PHYSICAL INDEX MARK TWICE WITHOUT 
                    ;FINDING THE REQUESTED SECTOR, SECTOR NOT FOUND IS SET
                    ;ST1 BIT 2 AND ENDS THE READ COMMAND. THIS IS AN ABNORMAL
                    ;TERMINATION AND ST0 BIT 7&6 ARE SET TO 01
     FD73 F5        CREAD:		PUSH	PSW
     FD74 C5        		PUSH	B
     FD75 D5        		PUSH	D
     FD76 E5        		PUSH	H
     FD77 3E44      		MVI	A,DMARMODE
     FD79 D3AB      		OUT	DMAMDEPT
     FD7B 0606      		MVI	B,06H
     FD7D CD11FF    CREAD1:		CALL	SETDMA
     FD80 3EFF      		MVI	A,0FFH
     FD82 3209F7    		STA	INPROG
     FD85 2108F7    		LXI	H,COMMAND
     FD88 70        	 	MOV	M,B
     FD89 CDE5FD    	 	CALL	FDCOUT
     FD8C 2106F7    		LXI	H,DRIVE
     FD8F 46        	 	MOV	B,M
     FD90 CDE5FD    	 	CALL	FDCOUT
     FD93 2100F7    		LXI	H,TRACK
     FD96 46        		MOV	B,M
     FD97 CDE5FD    		CALL	FDCOUT		
     FD9A 210BF7    		LXI	H,HEAD
     FD9D 46        		MOV	B,M
     FD9E CDE5FD    		CALL	FDCOUT
     FDA1 2102F7    		LXI	H,SECTOR
     FDA4 46        		MOV	B,M
     FDA5 CDE5FD    		CALL	FDCOUT
     FDA8 210CF7    		LXI	H,SECTSIZE
     FDAB 46        		MOV	B,M
     FDAC CDE5FD    		 CALL	FDCOUT
     FDAF 210DF7    		LXI	H,EOT
     FDB2 46        		MOV	B,M
     FDB3 CDE5FD    		CALL	FDCOUT
     FDB6 210EF7    		LXI	H,GPL
     FDB9 46        		MOV	B,M
     FDBA CDE5FD    		CALL	FDCOUT
     FDBD 210FF7    		LXI	H,DTL
     FDC0 46        		MOV	B,M
     FDC1 CDE5FD    		CALL	FDCOUT
     FDC4 CDF5FD    		CALL	WAITINT
     FDC7 E1        		POP	H
     FDC8 D1        		POP	D
     FDC9 C1        		POP	B
     FDCA F1        		POP	PSW
     FDCB C9        		RET
                    
                    ;FDCIN, INPUT THE MAIN STATUS REGISTER
     FDCC DB98      FDCIN:		IN	MSR
     FDCE E6C0      		ANI	0C0H
     FDD0 FEC0      		CPI	0C0H		;BIT 6=1 INPUT
     FDD2 C2CCFD    		 JNZ	FDCIN		;BIT 7=1 REQ MASTER
     FDD5 CDDBFD    		CALL	S75USEC
     FDD8 DB99      		 IN	DATAREG
     FDDA C9        		 RET
                    
     FDDB F5        S75USEC:	PUSH	PSW
     FDDC 3E08      		MVI	A,08H
     FDDE 00        		NOP
     FDDF 3D        		DCR	A
     FDE0 C2DEFD    		JNZ	S75USEC+3
     FDE3 F1        		POP	PSW
     FDE4 C9        		RET
                    
                    ;FDCOUT, OUTPUT TO DATA REGISTER
     FDE5 DB98      FDCOUT:		IN	MSR
     FDE7 E6C0      		ANI	0C0H
     FDE9 FE80      		CPI	080H		;BIT 6=0 OUTPUT
     FDEB C2E5FD    		JNZ	FDCOUT		;BIT 7=1 REQ MASTER
                    
     FDEE CDDBFD    		CALL	S75USEC
     FDF1 78        		MOV	A,B
     FDF2 D399      		OUT	DATAREG
     FDF4 C9        		RET
                    
                    ;WAITINT, THE PROGRAM WAITS HERE FOR THE INTERRUPT,
                    ;SIGNALING THE END OF THE EXECUTION PHASE AND THE
                    ;BEGINNING OF THE RESULT PHASE.
     FDF5 0100C0    WAITINT:	LXI	B,0C000H	;TIME OUT LOOP
     FDF8 0B        		DCX	B
     FDF9 79        		MOV	A,C
     FDFA B0        		ORA	B
     FDFB CA0BFF    		JZ	ERROR
     FDFE 2107F7    		LXI	H,INTFLAG
     FE01 7E        		MOV	A,M
     FE02 B7        		ORA	A
     FE03 CAF8FD    		JZ	WAITINT+3	;NO INT YET
     FE06 AF        RSTINTFLAG:	XRA	A
     FE07 3207F7    		STA	INTFLAG
                    
     FE0A DB98      CHKBUSY:	IN	MSR		;FDC BUSY
     FE0C E610      		ANI	010H		;BIT 4=1 IS BUSY
     FE0E CA17FE    		JZ	NOTBUSY		;BIT 4=0 NOT BUSY
     FE11 CD61FE    BUSY:		CALL	RREAD		;READ/WRITE IF
     FE14 C345FE    		JMP	DONE		;BUSY
     FE17 CD31FD    NOTBUSY:	CALL	CSIS		;SEEK,RECAL,ASYNC
     FE1A 3A10F7    		LDA	ST0		;CHK INTERRUPT
     FE1D E6E0      		ANI	0E0H		;STRIP BIT 7,6,5
     FE1F FE20      		CPI	020H		;SEEK RECAL OK
     FE21 CA36FE    		JZ	SEEKOK
     FE24 FE60      		CPI	060H		;ABNORM SEEK RECAL
     FE26 CA3CFE    		JZ	SEEKBAD
                    ;		CPI	040H		;ABNORM READ/WRITE
                    ;		JZ	READBAD
     FE29 FEC0      		CPI	0C0H		;DRIVE STAT CHANGE
     FE2B CAAEFE    		JZ	DRIVERDY
     FE2E FE80      		CPI	080H		;INVALID COMMAND
     FE30 CA45FE    		JZ	DONE
     FE33 C345FE    		JMP	DONE
                    
     FE36 CD52FE    SEEKOK:		CALL	RSEEK
     FE39 C345FE    		JMP	DONE
                    
     FE3C CD52FE    SEEKBAD:	CALL	RSEEK
     FE3F CD0BFF    		CALL	ERROR
     FE42 C345FE    		JMP	DONE
                    
                    ;READBAD:	CALL	RREAD		;RREAD WILL ERROR
                    ;		JMP	CHKBUSY
                    
     FE45 AF        DONE:		XRA	A
     FE46 3209F7    		STA	INPROG
     FE49 C9        		RET
                    
                    ;SENSE DRIVE RESULT PHASE
     FE4A CDCCFD    RSDS:		CALL	FDCIN
     FE4D 3213F7    		STA	ST3
     FE50 C9        		RET
                    
                    ;RECALIBRATE AND SEEK HAVE THE SAME RESULT PHASE
     FE51 00        RRECAL:		NOP
     FE52 AF        RSEEK:		XRA	A
     FE53 3208F7    		STA	COMMAND
     FE56 C9        		RET
                    
                    ;SENSE INTERRUPT
     FE57 CDCCFD    RSIS:		CALL	FDCIN
     FE5A 3210F7    		STA	ST0
     FE5D CDCCFD    		CALL	FDCIN		;DON'T SAVE TRACK
     FE60 C9        		RET
                    
                    ;RREAD
     FE61 CDCCFD    RREAD:		CALL	FDCIN
     FE64 3210F7    		STA	ST0
     FE67 CDCCFD    		CALL	FDCIN
     FE6A 3211F7    		STA	ST1
     FE6D CDCCFD    		CALL	FDCIN
     FE70 3212F7    		STA	ST2
     FE73 CDCCFD    		CALL	FDCIN
     FE76 3200F7    		STA	TRACK
     FE79 CDCCFD    		CALL	FDCIN
     FE7C 320BF7    		STA	HEAD
     FE7F CDCCFD    		CALL	FDCIN
     FE82 CDCCFD    		CALL	FDCIN		;DON'T SAVE SECTOR
     FE85 320CF7    		STA	SECTSIZE
     FE88 3A10F7    		LDA	ST0
     FE8B E6C0      		ANI	0C0H
     FE8D C495FE    		CNZ	CHKERR
     FE90 AF        		XRA	A
     FE91 3208F7    		STA	COMMAND
     FE94 C9        		RET
                    
     FE95 3A11F7    CHKERR:		LDA	ST1
     FE98 E604      		ANI	04H		;SECTOR NOT FOUND
     FE9A CC0BFF    		CZ	ERROR
     FE9D 3A11F7    		LDA	ST1
     FEA0 E620      		ANI	020H		;ID FLD CRC ERROR
     FEA2 CC0BFF    		CZ	ERROR
     FEA5 3A12F7    		LDA	ST2
     FEA8 E620      		ANI	020H		;DATA FLD CRC
     FEAA CC0BFF    		CZ	ERROR
     FEAD C9        		RET
                    
     FEAE CDD4FE    DRIVERDY:	CALL	BEEP
     FEB1 21DDFE    		LXI	H,MESS1
     FEB4 CDA7FB    		CALL	NXTLET
     FEB7 CDCCFE    		CALL	GETDRV
     FEBA CDCEF9    		CALL	TTYOUT
                    
     FEBD 21E4FE    		LXI	H,MESS2
     FEC0 CDA7FB    		CALL	NXTLET
     FEC3 CD4DF9    		CALL	CRLF
     FEC6 CDBFF9    		CALL	TTYI		;WAIT
     FEC9 C30000    		JMP	00H
                    
     FECC 3A10F7    GETDRV:		LDA	ST0
     FECF E603      		ANI	03H
     FED1 C641      		ADI	041H
     FED3 C9        		RET
                    
     FED4 3E07      BEEP:		MVI	A,07H
     FED6 CDCEF9    		CALL	TTYOUT
     FED9 CD4DF9    		CALL	CRLF
     FEDC C9        		RET
                    
     FEDD 4452495645MESS1:	DB	'DRIVE ',ZERO
     FEE4 3A20524550MESS2:	DB	': REPLACE ORIGINAL DISK, PRESS ANY KEY',ZERO
                    
     FF0B 3E01      ERROR:		MVI	A,01H
     FF0D 320AF7    		STA	FDCERROR
     FF10 C9        		RET
                    
     FF11 F5        SETDMA:		PUSH	PSW
     FF12 3A04F7    		LDA	DMALSBAD
     FF15 D3A0      		OUT	DMAADDRPT
     FF17 3A05F7    		LDA	DMAMSBAD
     FF1A D3A0      		OUT	DMAADDRPT
     FF1C D3AC      		OUT	DMAFF
     FF1E 3E7F      		MVI	A,DMATC
     FF20 D3A1      		OUT	DMATCPT
     FF22 AF        		XRA	A
     FF23 D3A1      		OUT	DMATCPT
     FF25 3E20      		MVI	A,DMACREN
     FF27 D3A8      		OUT	DMACTRLPT
     FF29 3EF8      		MVI	A,DMAUNM0
     FF2B D3AA      		OUT	DMAMSKPT
     FF2D D3AC      		OUT	DMAFF
     FF2F F1        		POP	PSW
     FF30 C9        		RET
                    
     FF31 F5        ISR:		PUSH	PSW
     FF32 E5        		PUSH	H
     FF33 2107F7    		LXI	H,INTFLAG
     FF36 3EFF      		MVI	A,0FFH
     FF38 77        		MOV	M,A
     FF39 3E20      		MVI	A,020H		;EOI
     FF3B D340      		OUT	PICCW1
     FF3D FB        		EI
     FF3E E1        		POP	H
     FF3F F1        		POP	PSW
     FF40 3A08F7    		LDA	COMMAND		;CHECK FOR NOT READY
     FF43 FE00      		CPI	0H
     FF45 CA06FE    		JZ	RSTINTFLAG
     FF48 C9        		RET
                    
     FF49 C316F7    		JMP	FINISH
                    
     0080 =         STKPOT:		EQU	0080H		;DBUG stack
                    
                    ;Constants
     000D =         CR:		EQU	0DH
     000A =         LF:		        EQU	0AH
     001B =         ESCAPE:		EQU	01BH
     0000 =         ZERO:		EQU	0H
                    
     03C0           		ORG	03C0H
                    ;DBUG addresses
     03C0 0000      BRKADD:	DW	0H		;This is the address of the user inserted 						;Breakpoint
     03C2 0000      NEWADD:	DW	0H		;This is the address of the next instruction 						;after Bkpt
     03C4 0000      TMP:		DW	0H		;3 bytes of user program from breakpoint
     03C6 0000      	 	        DW	0H		;3 bytes for JMP EXECUT
     03C8 0000      		        DW	0H
     03CA 00        LAB:		DB	0H		;Counter for Labels
     03CB 0000      USERSK:	DW	0H		;User's stack stored here
     03CD 0000      TEMPO:		DW	0H		;2 bytes of temporary storage
     03CF 0000      FLAG:		DW	0H		;A register and Flags are saved here
     03D1 0000      RECSTART:	DW	0H		;I may remove the COMM to IBM
     03D3 0000      RECEND:		DW	0H
     03D5 0000      RECLEN:		DW	0H
                    
                    ;PIC 8259 Words
     0040 =         PICCW1:		EQU	040H
     0041 =         PICCW2:		EQU	041H
                    
                    ;DMA 8237 Words
     007F =         DMATC:		EQU	07FH	;Terminal count = 127
     0044 =         DMARMODE:	EQU	044H	;Read mode
     0048 =         DMAWMODE:	EQU	048H	;Write mode
     0020 =         DMACREN:	EQU	020H	;CR enable
     0024 =         DMACRDS:	EQU	024H	;CR disable
     00A8 =         DMACTRLPT:	EQU	0A8H	;DMA control port
     00AA =         DMAMSKPT:	EQU	0AAH	;DMA mask port
     00AB =         DMAMDEPT:	EQU	0ABH	;DMA mode port
     00A0 =         DMAADDRPT:	EQU	0A0H	;DMA address port
     00A1 =         DMATCPT:	EQU	0A1H	;DMA terminal count port
     00AC =         DMAFF:		EQU	0ACH	;1st/last flip flop port
     00AD =         DMARST:		EQU	0ADH	;DMA master reset
     00F8 =         DMAUNM0:	EQU	0F8H	;Unmask DMA channel zero
                    
     F700           		ORG	0F700H
                    ;FDC 8272 Words
     F700 0000      TRACK:		DW	0H	;Current track address
     F702 0000      SECTOR:	DW	0H	;Current sector address
     F704 00        DMALSBAD:	DB	0H	;Current DMA least significant address byte
     F705 00        DMAMSBAD:	DB	0H	;Current DMA most significant address byte
     F706 00        DRIVE:		DB	0H	;Current drive number address
     F707 00        INTFLAG:	DB	0H	;Interrupt flag 0 = no interrupt
     F708 00        COMMAND:	DB	0H	;FDC command number code
     F709 00        INPROG:		DB	0H	;In progress flag
     F70A 00        FDCERROR:	DB	0H	;FDC error code 0 = no error
     F70B 00        HEAD:		DB	0H	;Current head number 
     F70C 00        SECTSIZE:	DB	0H	;Sector size code
     F70D 00        EOT:		DB	0H	;End of track
     F70E 00        GPL:		DB	0H	;Gap length
     F70F 00        DTL:		DB	0H	;
     F710 00        ST0:		DB	0H	;Status Register 0
     F711 00        ST1:		DB	0H	;Status Register 1
     F712 00        ST2:		DB	0H	;Status Register 2
     F713 00        ST3:		DB	0H	;Status Register 3
                    
                    ;Timer 8253 Words
     F714 0000      DIVID:		DW	0000H		;Divider constant for baud rate
                    
     0098 =         MSR:		EQU	098H	;FDC main status register port
     0099 =         DATAREG:	EQU	099H	;FDC Data register port
                    
                    ;CPM WORDS
     F800 =         DBUG:		EQU	0F800H
     F200 =         BIOS:		EQU	0F200H
     E411 =         BDOS:		EQU	0E411H
     DC00 =         CCP:		EQU	0DC00H
                    
     F716 00        FINISH:		NOP
                    
     F717           END

  10. #20
    Join Date
    Jan 2007
    Location
    Pacific Northwest, USA
    Posts
    33,153
    Blog Entries
    18

    Default

    Thanks for that--when I get a little time, I'll have a careful look.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •