📄 vgetsc.v
字号:
/**
*** Copyright (c) 2001 Equator Technologies, Inc.
**/
//----------------------------------------------------------------
I_GET_STARTCODE_SUBR:
#ifdef DUMP_SYMBOL
setacc D0_DATA;
setreg dbgPtr_r27;
#endif
// STATUS
setacc 0xac;
setreg tmpData_r16;
setacc D0_STATUS+2;
nop;
st tmpData_r16,acc;
nop;
//
// Start of while() loop in startcodeloop() psg
//
I_WHILE1_STARTCODE:
call.gbstall pcaddr_r19; // Stall until GB has data
gb G_ALIGN, 3;
nop;
I_GET_STARTCODE_SUBR_1:
br I_TEST_FLUSH_JUNK;
nop;
I_WHILE_FLUSH_JUNK:
call.gbstall pcaddr_r19; // Stall until GB has data
gb G_GETSYM, 1; // Shift 1 bit at a time...start code can be anywhere.
nop;
nop;
nop;
nop;
I_TEST_FLUSH_JUNK:
#ifdef DUMP_SYMBOL
// DUMP SYMBOL 1
st symbol, dbgPtr_r27;
add.w dbgPtr_r27, 4;
nop;
st tmpData_r16, dbgPtr_r27;
add.w dbgPtr_r27, 4;
#endif
add symbol, 0;
br.accne0 I_WHILE_FLUSH_JUNK; // br if symbol not 16 0s, else fall-through
nop;
I_GET_STARTCODE_SUBR_2:
// STATUS
setacc 0x1ac;
setreg tmpData_r16;
setacc D0_STATUS+3;
nop;
st tmpData_r16,acc;
nop;
call.gbstall pcaddr_r19; // Stall until GB has data
gb G_GETSYM, 16; // Found 16 consecutive 0s, flush them out
nop;
nop;
nop;
nop;
#ifdef DUMP_SYMBOL
// DUMP SYMBOL 2
st symbol, dbgPtr_r27;
add.w dbgPtr_r27, 4;
nop;
st tmpData_r16, dbgPtr_r27;
add.w dbgPtr_r27, 4;
#endif
br I_TEST_STARTCODE_CHECK;
nop;
//
// 16 consecutive 0s found...check if startcode...
// ~ If not, shift by 1 until we get either start code or other nonzero
// ~ If other nonzero, start from beginning.
//
I_WHILE_STARTCODE_CHECK:
call.gbstall pcaddr_r19; // Stall routine untill GB has data
gb G_GETSYM, 1; // Shift 1 bit at a time...start code can be anywhere.
nop;
nop;
nop;
nop;
#ifdef DUMP_SYMBOL
// DUMP SYMBOL 3
st symbol, dbgPtr_r27;
add.w dbgPtr_r27, 4;
nop;
st tmpData_r16, dbgPtr_r27;
add.w dbgPtr_r27, 4;
#endif
I_TEST_STARTCODE_CHECK:
// STATUS
setacc 0x2ac;
setreg tmpData_r16;
setacc D0_STATUS+2;
nop;
st tmpData_r16,acc;
nop;
// Currently only checking for the 7 0s followed by a 1, not for the 0x1c (sc value)
swapsr symbol, _SWAP+8; // swap , then shift right by 8, acc = symbol[0:7]
sub acc, 1;
br.acceq0 I_GOOD_START_CODE_VALUE; // br if symbol[0:7]==0000_0001, else...
nop;
swapsr symbol, _SWAP+8; // swap , then shift right by 8, acc = symbol[0:7]
//br.accne0 I_TEST_FLUSH_JUNK; // br if symbol[0:7] != 0000_0001 and != 0000_0000 (i.e., more junk)
br.accne0 I_WRAP_UP;
nop;
br I_WHILE_STARTCODE_CHECK; // ...else symbol[0:7] == 0000_0000, so keep shifting out 0s per bit
nop;
I_GOOD_START_CODE_VALUE:
// Indicate found
setacc 0xcc;
setreg tmpData_r16;
setacc D0_STATUS+2;
st tmpData_r16,acc;
nop;
call.gbstall pcaddr_r19; // Stall routine untill GB has data
gb G_GETSYM, 16; // Shift out start code, align to coeff vlcs
nop;
nop;
nop;
nop;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -