;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; Advanced Communication Board Developers Toolkit ;; (c) Copyright 1993-1995, Sealevel Systems Incorporated ;; ;; ACB.ASM ;; For use with Advanced Communication Boards ;; These routines write to the 85x30 SCC registers ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; TITLE ACB ifdef LMOD .MODEL LARGE elseifdef MMOD .MODEL MEDIUM elseifdef TMOD .MODEL TINY else .MODEL SMALL endif ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; MACROS ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; pause MACRO ;85x30 recovery time jmp short $+2 ;This purges the CPU prefetch cue, which allows jmp short $+2 ; for enough delay for most oscillator and CPU jmp short $+2 ; jmp short $+2 ; jmp short $+2 ; jmp short $+2 ; jmp short $+2 ; ENDM ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; INCLUDE ACB.INC .DATA .CODE ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; SCCout : ;; ;; Parameters: BASE - Data Port Address ;; ;; REGISTER - 8530 Register to read ;; ;; VALUE - Value to write to selected register ;; ;; Return: Nothing ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; SCCout PROC C PUBLIC USES DX AX, BASE:WORD,REGISTER:BYTE,VALUE:BYTE mov dx, BASE ;passes data port I/O address inc dx ;point to control port address mov al, REGISTER ;get selected 85x30 register out dx, al ;select the register pause ;I/O recovery mov al, VALUE ;get the value to write to the register out dx, al ;write to the selected register pause ;I/O recovery ret ;return to caller SCCout ENDP ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; SCCin : ;; ;; Parameters: BASE - Data Port Address ;; ;; REGISTER - 8530 Register to read ;; ;; Return: Value read from selected Register ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; SCCin PROC C PUBLIC USES DX,BASE:WORD,REGISTER:BYTE mov dx, BASE ;passes data port I/O address inc dx ;point to control port address mov al, REGISTER ;get selected 85x30 register out dx, al ;select the register pause ;I/O recovery in al, dx ;read the selected register pause ;return value in AL register ret ;return to caller SCCin ENDP ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; SCCInit : ;; ;; Parameters: BASE - Data Port Address ;; ;; LABEL1 - Starting Address of Init Array ;; ;; LABEL2 - Ending Address of Initialization Array ;; ;; Return: Nothing ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; SCCInit PROC C PUBLIC USES AX BX CX DX,BASE:WORD, LABEL1:WORD,LABEL2:WORD mov bx, LABEL1 ;get starting address mov cx, LABEL2 ;get ending address mov dx, BASE ;passes data port I/O address call INIT_ROUTINE ret SCCInit ENDP ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; SCCInitEx : ;; ;; Parameters: BASE - Data Port Address ;; ;; fpINIT - Far Pointer to Init Array ;; ;; wLENGTH - Length of Initialization Array ;; ;; Return: Nothing ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; SCCInitEx PROC C PUBLIC USES AX BX CX DX DS,BASE:WORD, fpINIT:DWORD,wLENGTH:WORD lds bx,fpINIT ;Get struct address mov cx, bx add cx, wLENGTH dec cx mov dx, BASE ;passes data port I/O address call INIT_ROUTINE ret SCCInitEx ENDP ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; INIT_ROUTINE : Internal.NEAR : ;; ;; Parameters: BASE - Data Port Address ;; ;; fpINIT - Far Pointer to Init Array ;; ;; LENGTH - Length of Initialization Array ;; ;; Return: Nothing ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; INIT_ROUTINE PROC NEAR inc dx ;point to control port address inc cx ;adjust for C array / ASM lable sub cx, bx ;get parameter count sar cx, 1 ;divide by 2 @@: mov al, [bx] ;get register out dx, al ;send to 85x30 control port pause ;I/O recovery inc bx ;increment to parameter mov al, [bx] ;get parameter out dx, al ;send to 85x30 control port pause ;I/O recovery inc bx ;increment to register loop @b ;loop back ret INIT_ROUTINE ENDP ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; END