vgastop.asm
来自「Scart To Tv 的源代码,作为接口转换是个很好的参考代码」· 汇编 代码 · 共 44 行
ASM
44 行
title "VGA/15khz RGB detector by Tim Worthington"
; 15/7/04
; pin 5 = Horizontal sync input
; pin 6 = Logic output (high < 17KHz > low)
; pin 7 = inverted logic output (low < 17KHz > high)
; pin 2 = same as pin 7
processor 12c509
__config 0xfea
w equ 0
f equ 1
gpio equ 0x06
tmr0 equ 0x01
cycount equ 0x0c
status equ 0x03
org 0x000
movlw b'10101000'
option
movlw b'00001100'
tris gpio
clrf gpio
start clrf tmr0
wait btfss tmr0, 1 ;wait for a h-sync pulse
goto wait
clrf cycount
clrf tmr0
do incf cycount, f ;increase cycount every 4 uS
btfss tmr0, 3 ;count 8 h-sync pulses
goto do
movlw d'116' ;h-sync_cut_off(in uS) * h-sync_pulses_counted / cycount_time(in uS)
;58(17.2khz) * 8 / 4
subwf cycount, w
btfss status, 0
goto block
movlw b'00000010'
movwf gpio ;pass
goto start
block movlw b'00100001'
movwf gpio ;block
goto start
end
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?