Loading files
This file is pinned to the selected release. Download the original to open it in your design tool.
PAGE ,132
;-----------------------------------------------------------------------------
;
; 255x255 SCAN
;
; Calling parameters :
; ES: picture buffer segment, must be 64k long
;
;
; Return :
; Zero = No errors occured
; Non-zero = Time out on digisector
; All registers are preserved
; Picture buffer filled with incoming video
;
SCAN PROC NEAR ;
PUSH AX ; save all the registers we use
PUSH BX ;
PUSH DX ;
PUSH CX ;
PUSH DI ;
CLI ; Disable the interrupts, make it go fast
MOV DX,0330H ; Digisector port address
MOV AX,0101h ; get the starting xy coords
OUT DX,AX ; start the next conversion
MOV BX,AX ; save the scan coords for later use
MOV DI,CX ; get the buffer pointer, the same as x,y coords
SCLOOP: XOR CX,CX ; set-up time out counter
SCtest: IN AX,DX ; get the status and the data if valid
DEC CX ; decrement our timer
JE SCANER ; bomb time !!!!
SHL AH,1 ; shift the busy flag into the carry bit
JC SCtest ; if still busy, then loop, and loop, ...
STOSB ; save the data, increment pointer
MOV AX,BX ; get the next address to scan
OUT DX,AX ; start the next conversion
INC BH ; increment the y-coord
CMP BH,0255 ; are we at the end of the col ?
JNE SCLOOP ; no, then loop
MOV BH,01 ; reset the y-coord counter
AND DI,0FF00H ; skip over non-scanned locations in buffer
ADD DI,00100H ; move to the next line
INC BL ; increment the x-coord
CMP BL,0255 ; are we at the end of the frame ?
JNE SCLOOP ; no, then loop
XOR AL,AL ; set the zero flag, every thing ok
SCANEXT:STI ; turn the interrupts back on
POP DI ; get the regs back
POP CX ;
POP DX ;
POP BX ;
POP AX ;
RET ; return to the caller
SCANER: MOV AL,01 ; make for a non-zero return
OR AL,AL ; we timed out on the scan
JMP SCANEXT ; get the reset of the regs and return
SCAN ENDP ;
;-----------------------------------------------------------------------------
31f96539fThis file is pinned to the selected release. Download the original to open it in your design tool.