Classic Computer Magazine Archive PROGRAM LISTING: 85-04/PBI.M65


���	
%X; Parallel Device Handler ExampleX; By Earl RiceX; ANTIC Magazine(X;25X;(ASM,,#D:MYFILE.OBJ) because the obj code is put<%X;where there is no RAM available.FFPX;  EQUATESZ9�PDVMSKG;;Parallel device mask (indicates which ared9�PDIMSKI;;Parallel interrupt mask (not used in thisn-�GPDVV��;;Generic Parallel Device VectorxX;�$�HATABS;;Device handler table�)�CRITICB;;Critical code section flag�X;�3�DEVNAM
T;;Device name, E.G. T for "Telephone".�$�HWGET�;;Hardware GET register�%�HWPUT�;;Hardware PUT register.�5�HWRSET�;;Hardware reset (clears get register).�)�HWSTAT�;;Hardware STATUS register.�X;���X; Rom vector table�	;;Optional ROM checksum� ;;Optional Revision number�;;Mandatory ID number;;Optional Name or Type4!�NONEED;;Lo-level IO vector, which we don't need"5!�NONEED;;IRQ handler vector, which we don't need.,�;;Mandatory ID number6�DEVNAM;;Device name@1	�NONEED;;Open vector, which we don't need.J2	�NONEED;;CLOSE vector, which we don't need.T 	�GETBYT;;GET BYTE vector.^ 	�PUTBYT;;PUT BYTE vector.h"	�GETSTA;;GET STATUS vector.r4	�NONEED;;SPECIAL vector, which we don't need.|,!�INIT;;INIT vector at power up or reset.�;;NOT USED.�X;�X;CODE STARTS HERE�X;�)X;Initialize device and device handler��INIT�%Q�PDVMSK;;Get enabled device flags�L>;;Set bit 0.�P�PDVMSK;;& replace.�:X;Note: if device used interrupts we would set bit 0 of�X;�,X;Put device name in Handler table HATABS�$>X;        Top of loop
�SEARCH#Q�HATABS9;;Get a byte from table&#F�FNDIT;;0? Then we found space.02:2D2N(>$;;Length of HATABSXD�SEARCH;;Still lookingb/:;;No room in HATABS; device not initializedlX;vX;         We found a spot.�	�FNDIT�Q>�DEVNAM;;Get device name.�#P�HATABS9;;Put it in blank spot.�2�&Q>�GPDVV�;;Get lo byte of vector.�'Q>�GPDVV;;Get hi byte of vector.�P�HATABS9�:�X;�X; GET BYTE routine.�
�GETBYT�Q>�-P�CRITIC;;Enable deferred  vertical blank.%Q�HWGET;;Get a byte from hardware.P�HWRSET;;Reset hardware.;;;Indicate we handled it. :*X;4X; PUT BYTE routine.>
�PUTBYTH$>R-&�CRITIC;;Enable deferred  vertical blank.\!P�HWPUT;;Put byte to hardware.f;;;Indicate we handled it.p:zX;�X; GET STATUS routine.�
�GETSTA�Q>�-P�CRITIC;;Enable deferred  vertical blank.�Q�HWSTAT;;Get HW status.�;;;Indicate we handled it.�:�X;�X; Do nothing routine.�
�NONEED�;;;Indicate we handled it.�:�X;X;

Back to previous page