?? rectifier.eve
字號:
// 僒儞僾儖僾儘僌儔儉 rectifier.eve
//
// 忦審暘婒傪娷傓僒儞僾儖僾儘僌儔儉偱偡丅
// 偙偺僾儘僌儔儉偱偼慡攇惍棳婍 (full wave rectifier) 傪幚尰偟偰偄傑偡丅
// 偮傑傝丄
// 擖椡怣崋偑惓側傜偽偦偺傑傑
// 擖椡怣崋偑晧側傜偽斀揮
// 偱偡丅
//
// SDI0 偺 Lch 偵擖椡偝傟偨怣崋偵懳偟偰慡攇惍棳傪巤偟偨傕偺傪
// SDO0 偺 Rch 偵弌椡偟偰偄傑偡丅SDO0 偺 Lch 偵偼 SDI0 Lch
// 擖椡傪偦偺傑傑弌椡偟偰偄傑偡丅
// SDO0 偺 L/Rch 埲奜偺僠儍儞僱儖偼偡傋偰 0 弌椡偱偡丅
//
// 惓尫攇傪 SDI0 偺 Lch 偵擖椡偟丄SDO0 偺 L/R ch 傪僆僔儘僗僐
// 乕僾偱妋擣偡傞偙偲偵傛傝慡攇惍棳屻偺攇宍傪妋擣偱偒傑偡丅
//
// 偙偺僾儘僌儔儉傪傾僙儞僽儔 EveAsm.exe 偱傾僙儞僽儖偡傞偙偲偵傛傝
// rectifier.datEve 偑嶌惉偝傟傑偡丅
//
// -----------------------------------------------------------------
//
// Sample program rectifier.eve
//
// This is the program including the branching.
// This program realizes the full wave rectifier, which means :
// When input signal is positive, output as it is.
// When input signal is negative, output the reversed signal.
//
// Full-wave-rectified SDI0 Lch signal is output from SDO0 Rch,
// while SDI0 Lch signal is output from SDO0 Lch as it is.
// The other channels except for SDO0 L/Rch are all zero output.
//
// Input sine wave to SDI0 Lch, and check SDO0 L/Rch analog output
// by oscilloscope to confirm the wave.
//
// rectifier.datEve is assemble from this program by executing EveAsm.exe.
// -----------------------------------------------------------------
// -----------------------------------------------------------------
// -----------------------------------------------------------------
#define ERAM_TYPE NO_ERAM //奜晅 RAM 側偟
//============================================================
// EVE Program
// rectifier
//============================================================
// COEF define
CDat P0.5 (-1, 0x4000); // +0.5
CDat M0.5 (-1, 0xC000); // -0.5
// Inner DATA define
DAdr Dtmp (0); // temporary 梡
//------------------------------------------------------------
// 幚峴僐儅儞僪僽儘僢僋
// | ERAM | BUS | MAC/JMP
//------------------------------------------------------------
; Dtmp = IN0; ACC0 = Dtmp *P0.5; // ACC0=IN0*(+0.5)
; ; ACC1 = Dtmp *M0.5; // ACC1=IN0*(-0.5)
; ; ;
; ; ;
; ; ;
; ; if (ACC<0) jmp minus; // ACC0 偑晧偺偲偒偼 minus 傊丅
plus: ; OUT1 = ACC0Ls1; ; // ACC0 偑惓偺偲偒丄OUT1=ACC0<<1丅
; ; jmp RecEnd;
minus: ; OUT1 = ACC1Ls1; ; // ACC0 偑晧偺偲偒丄OUT1=ACC1<<1丅
// ----------------------------------------------------------------------
RecEnd: ; OUT0 = IN0; ; // OUT0=IN0
; OUT2 = $ZERO; ; // 懠偺 channel 傪 0 clear丅
; OUT3 = $ZERO; ; // 懠偺 channel 傪 0 clear丅
; OUT4 = $ZERO; ; // 懠偺 channel 傪 0 clear丅
; OUT5 = $ZERO; ; // 懠偺 channel 傪 0 clear丅
; OUT6 = $ZERO; ; // 懠偺 channel 傪 0 clear丅
; OUT7 = $ZERO; ; // 懠偺 channel 傪 0 clear丅
// ----------------------------------------------------------------------
; MPEND = $0.5; ; // program 廔椆丅
; ; ;
; ; ;
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -