;-------------------------------------------------------------- ; Low Level Firmware Function Prototype ;-------------------------------------------------------------- ; ;-------------------------------------------------------------- ; START.A00 == Communication Subroutine ;-------------------------------------------------------------- ; ;--------------------------------------------------------------------- ; VOID SetWatchDog(U16 mSec); ; Function Routine of SetWatchDog (monitor port with Timer controller) ; Note: --- After execution this routine, place all ; the setting default data into control registers ; --- input parameter: ? /ms ; --- register modified : ;--------------------------------------------------------------------- ; ;--------------------------------------------------------------------- ; VOID HltWatchDog(); ; Function Routine of HltWatchDog (halt WatchDog Timer controller) ; Note: --- After execution this routine, place all ; the setting default data into control registers ; --- register modified : ;--------------------------------------------------------------------- ; ;---------------------------------------------------------------------- ; VOID TransmitByte(U8 char); ; transmit one byte from transmit buffer ; parameters: ; input: U8 character ; output ;---------------------------------------------------------------------- ; ;---------------------------------------------------------------------- ; U8 ReceiveByte(); ; receive one byte from receive buffer ; parameter: ; input: ; output: ; return: U8 character in al ;---------------------------------------------------------------------- ; ;-------------------------------------------------------------- ; OVMEM.A00 == Overlap Memory Subroutine ;-------------------------------------------------------------- ; ;================================================================== ; Module name: _InitEm ; Description: Initialize the emulation memory control signals ; Input: None ; Output: The control signals are initialized ; _emStatus The size of emulation memory ; = 00H, None memory ; = 01H, 512K (This is not permited for 68306) ; = 02H, 1M (Min. size is 1M for 68306) ; = 03H, 2M ; = 10H, None memory ; = 11H, 2M ; = 12H, 4M ; = 13H, 8M ; Memory 512K 1M 2M 4M 8M ; _32kBase 1 2 4 8 10H ; _32kCount 1 2 4 8 10H ; _32kLength 8000H 4000H 2000H 1000H 800H ; _32kShift 0 1 2 3 4 ; _8kBase 40H 80H 100H 200H 400H ; _8kCount 10H 8 4 2 1 ; _8kLength 3fH 7fH 0ffH 1ffH 3ffH ;================================================================== ; ;============================================================================ ; Module name: _InitMapCtr ; Description: Initialize mapping control memory (ram 32kx8 and 8kx8) ; Input: Map table (_mapBuf), it is a table for map display ; Start Address Of Memory Block (Double Word) ; End Address Of Memory Block (Double Word) ; Allocation Type, Memory Space (1 byte, 1 byte) ; : : ; End Of Table (AA55H) (1 Word) ; Ouput: Map RAM are initialized, and map all to external ; Flag bit 0 of _emError = 1 means test failure ; = 0 means OK. ; al = _emError ;============================================================================ ; ;--------------------------------------------------------------------------- ; Module name: _ClrViolFlg ; Description: Clear the violation flag to inactive state ; Input: None ; Output: Signals NWPFLG and NGUFLG are set to '1' ;--------------------------------------------------------------------------- ; ;--------------------------------------------------------------------------- ; Module name: _RdViolFlg ; Description: Read the violation flag ; Input: None ; Output: Bit 0 of AL = 0 means write protect trespass ; Bit 1 of AL = 0 means guard access trepass ;--------------------------------------------------------------------------- ; ;--------------------------------------------------------------------------- ; Module name: _EnEmRun ; Description: Enable emulation memory and violation break before EP run ; Input: None ; Output: Emulation memory and violation break are enabled ;--------------------------------------------------------------------------- ; ;--------------------------------------------------------------------------- ; Module name: _DisEmStop ; Description: Disable emulation memory and violation break after EP stop ; Input: None ; Output: Emulation memory and violation break are disabled ;--------------------------------------------------------------------------- ; ;--------------------------------------------------------------------------- ; Module name: _EnEmDisViol ; Description: Enable emulation memory and disable violation break ; before EP run ; Input: None ; Output: Emulation memory is enabled and violation break is disabled ;--------------------------------------------------------------------------- ; ;-------------------------------------------------------------- ; EPM251A.A00 == EPM251 Subroutine ;-------------------------------------------------------------- ;=================================================================== ; SUBROUTINE : _GetREGL(U16 ID,U16 data length) ; FUNCTION : get {(R0-R7)/(WR0-WR6)/(DR0-DR4)} * 4bank ; INPUT : U16 ID byte : bit15-8 = Bank No (0-3) ; bit7-0 = Rn/WRj/DRk No (0-7) ; 00h -> R0 03h -> R3 06h -> R6 ; 01h -> R1 04h -> R4 07h -> R7 ; 02h -> R2 05h -> R5 ; -------------------------------------- ; 00h -> WR0 04h -> WR4 ; 02h -> WR2 06h -> WR6 ; -------------------------------------- ; 00h -> DR0 04h -> DR4 ; -------------------------------------- ; U16 data length : ; =1 byte size ; =2 word size ; =4 double word size ; -------------------------------------- ; OUTPUT : dx,ax. If byte size, al = return value ; If word size, ax = return value ; If double word size,dx = high word ; ax = low word ; AFFECT REG. : dx,ax ; AFFECT MEM. : none ;------------------------------------------------------------------- ; ;=================================================================== ; SUBROUTINE : _SaveREGL(U16 ID,U16 data length,U8 *buf) ; FUNCTION : get {(R0-R7)/(WR0-WR6)/(DR0-DR4)} x 4 bank ; INPUT : U16 ID word: bit15-8= Bank No(0-3) ; bit7-0 = Rn No (0-7) ; 00h -> R0 03h -> R3 06h -> R6 ; 01h -> R1 04h -> R4 07h -> R7 ; 02h -> R2 05h -> R5 ; -------------------------------------- ; 00h -> WR0 04h -> WR4 ; 02h -> WR2 06h -> WR6 ; -------------------------------------- ; 00h -> DR0 04h -> DR4 ; -------------------------------------- ; U16 data length : ; =1 byte size ; =2 word size ; =3 double word size ; -------------------------------------------- ; U8 *buf : start addr. offset of new Rn/WRj/DRk value ; If data len =1 : One byte is available ; If data len =2 : Two bytes are available ; If data len =4 : Four bytes are available ; ---------------------------------------------- ; OUTPUT : ax. =0 OK (always) , =1 fail ; AFFECT REG. : ax ; AFFECT MEM. : none ;------------------------------------------------------------------- ; ;------------------------------------------------------------------- ; SUBROUTINE : _GetREGH(U16 ID ,U16 Length ) ; FUNCTION : get R8-R15,WR8-WR30,DR8-DR28,DR56,DR60 ; Special Note : DR56,60 return value is stored in _getREGbuf ; INPUT : U16 ID byte : Only lower byte is available. ; bit7-0: ; 08h -> R8 0Bh -> R11 0Eh -> R14 ; 09h -> R9 0Ch -> R12 0Fh -> R15 ; 0Ah -> R10 0Dh -> R13 ; -------------------------------------------- ; 08h -> WR8 10h -> WR16 18h -> WR24 ; 0Ah -> WR10 12h -> WR18 1Ah -> WR26 ; 0Ch -> WR12 14h -> WR20 1Ch -> WR28 ; 0Eh -> WR14 16h -> WR22 1Eh -> WR30 ; ---------------------------------------------- ; 08h -> DR8 14h -> DR20 38h -> DR56 ; 0Ch -> DR12 18h -> DR24 3Ch -> DR60 ; 10h -> DR16 1Ch -> DR28 ; ---------------------------------------------- ; U16 Length : ; =1 --> byte size ; =2 --> word size ; =4 --> double word size ; ; OUTPUT : dx,ax : if length =1 -> al = Rm ; if ; AFFECT REG. : dx,ax ; AFFECT MEM. : none ;------------------------------------------------------------------- ; ;------------------------------------------------------------------- ; SUBROUTINE : _SaveREGH(U16 ID,U16 length,U8 *buf) ; FUNCTION : get R8-R15,WR8-WR30,DR8-DR28,DR56,DR60 ; INPUT : U16 ID word : Only lower byte is available. ; ; 08h -> R8 0Bh -> R11 0Eh -> R14 ; 09h -> R9 0Ch -> R12 0Fh -> R15 ; 0Ah -> R10 0Dh -> R13 ; -------------------------------------------- ; 08h -> WR8 10h -> WR16 18h -> WR24 ; 0Ah -> WR10 12h -> WR18 1Ah -> WR26 ; 0Ch -> WR12 14h -> WR20 1Ch -> WR28 ; 0Eh -> WR14 16h -> WR22 1Eh -> WR30 ; -------------------------------------------- ; 08h -> DR8 14h -> DR20 38h -> DR56 ; 0Ch -> DR12 18h -> DR24 3Ch -> DR60 ; 10h -> DR16 1Ch -> DR28 ; ---------------------------------------------- ; U16 Length : =1 -> byte size ; =2 -> word size ; =4 -> double word size ; ---------------------------------------------- ; U8 *buf : start address(offset) of new Rm/WRj/DRk value ; ------------------------------------------------------ ; OUTPUT : ax 0=OK , 1=Fail ; AFFECT REG. : ax ; AFFECT MEM. : none ;------------------------------------------------------------------- ; ;------------------------------------------------------------------- ; SUBROUTINE : _GetSFR(U16 ID) ; FUNCTION : get SFR ; INPUT : U16 ID word : Only lower byte is available. ; bit7-0 : ; E0h -> ACC 80h -> P0 CCh -> TL2 DCh -> CCAPM2 ; F0h -> B 90h -> P1 CDh -> TH2 DDh -> CCAPM3 ; D0h -> PSW A0h -> P2 88h -> TCON DEh -> CCAPM4 ; D1h -> PSW1 B0h -> P3 89h -> TMOD E9h -> CL ; 81h -> SP C8h -> T2CON F9h -> CH ; BEh -> SPH 98h -> SCON C9h -> T2MOD EAh -> CCAP0L ; 82h -> DPL 99h -> SBUF CAh -> RCAP2L EBh -> CCAP1L ; 83h -> DPH B9h -> SADEN CBh -> RCAP2H ECh -> CCAP2L ; 84h -> DPXL A9h -> SADDR A6h -> WDTRST EDh -> CCAP3L ; 87h -> PCON EEh -> CCAP4L ; A8h -> IE0 8Ah -> TL0 D8h -> CCON FAh -> CCAP0H ; B7h -> IPH0 8Ch -> TH0 D9h -> CMOD FBh -> CCAP1H ; B8h -> IPL0 8Bh -> TL1 DAh -> CCAPM0 FCh -> CCAP2H ; A7h -> WCON 8Dh -> TH1 DBh -> CCAPM1 FDh -> CCAP3H ; FEh -> CCAP4H ; ---------------------------------------------------------------- ; OUTPUT : ax --> al=return value , ah=00h always ; AFFECT REG. : ax ; AFFECT MEM. : none ;------------------------------------------------------------------- ; ;------------------------------------------------------------------- ; SUBROUTINE : _SaveSFR(U16 ID,U8 *buf) ; FUNCTION : save new value to SFR ; INPUT : U16 ID word : Only lower byte is available. ; ; E0h -> ACC 80h -> P0 CCh -> TL2 DCh -> CCAPM2 ; F0h -> B 90h -> P1 CDh -> TH2 DDh -> CCAPM3 ; D0h -> PSW A0h -> P2 88h -> TCON DEh -> CCAPM4 ; D1h -> PSW1 B0h -> P3 89h -> TMOD E9h -> CL ; 81h -> SP C8h -> T2CON F9h -> CH ; BEh -> SPH 98h -> SCON C9h -> T2MOD EAh -> CCAP0L ; 82h -> DPL 99h -> SBUF CAh -> RCAP2L EBh -> CCAP1L ; 83h -> DPH B9h -> SADEN CBh -> RCAP2H ECh -> CCAP2L ; 84h -> DPXL A9h -> SADDR A6h -> WDTRST EDh -> CCAP3L ; 87h -> PCON EEh -> CCAP4L ; A8h -> IE0 8Ah -> TL0 D8h -> CCON FAh -> CCAP0H ; B7h -> IPH0 8Ch -> TH0 D9h -> CMOD FBh -> CCAP1H ; B8h -> IPL0 8Bh -> TL1 DAh -> CCAPM0 FCh -> CCAP2H ; A7h -> WCON 8Dh -> TH1 DBh -> CCAPM1 FDh -> CCAP3H ; FEh -> CCAP4H ; ------------------------------------------------------ ; U8 *buf : new SFR value, byte size ; ------------------------------------------------------ ; OUTPUT : ax ,=0 OK ,!=0 --> Fail ; AFFECT REG. : ax ; AFFECT MEM. : none ;------------------------------------------------------------------- ; ;------------------------------------------------------------------ ; SUBROUTINE : _SearchMem ; STATUS _SearchMem(U32 addr, U16 addrLen,U16 patnLen, ; U8 *buff) ; FUNCTION : Search a string from target memory/EMM. ; (using byte size always). ; INPUT : ; addr -- start address ; range: 0FE0000h-0FFFFFFh ; 0000000h-001FFFFh ; only bit23-0 are available. ; bit31-24 are useless.Please fill bit31-24 as 00h ; ---------------------------------------- ; addrLen -- memory length minimum : 1 byte. ; maximum : 64K bytes.(just input 00h) ; Note: Do Not Search Over the 64K Boundary. ; ==== ; ---------------------------------------- ; patnLen -- pattern length . ; minimum 1 byte. ; maximum 40 bytes.(28h bytes) ; Note : Pattern Length must less than or equal to 28h ; ------------------------------------------------ ; *buff -- a start pointer[near] of pattern. A 16 bit offset. ; U8 *buf -> *buf array contain byte data ; ; Note: The 'addrLen' must be great or equal the 'len'. ; ==== ; ; OUTPUT : ax , return code. ; 0 --- OK (found) ; 1 --- Not found ; 2 --- failure , check _exceptBreak flag ; ; Search OK address is kept in _canTemp buffer ; _canTemp --> A[0..7] ; _canTemp+1 --> A[8..15] ; _canTemp+2 --> A[16..23] ; _canTemp+3 --> A[24..31] ; ; AFFECT REG. : ax ; AFFECT MEM. : none ;------------------------------------------------------------------ ; ;------------------------------------------------------------------ ; SUBROUTINE : _TestMem ; STATUS _TestMem(U32 addr, U16 addrLen) ; FUNCTION : Test Memory block by byte size ; INPUT : ; addr -- Test block start address ; range:00:0000h-01:FFFFh,0FE:0000h-0FF:FFFFh ; ; addrLen -- memory length minimum : 1 byte. ; maximum : 64Kbytes.(just input 0h) ; Special Note : 1. Do not Test over 64K boundary. ; 2. Data contained in Test Area will be destroied ; ; OUTPUT : ax , return code. ; 0 --- OK, ; 1 --- Test Fail ; ; Reply Buffer using the _canTemp buffer ; ( When Test Fail ) ; =================================================== ; _canTemp +0-3 ---> Test Fail Addr (U32) ; ; _canTemp + 0 ---> A[7-0] ; _canTemp + 1 ---> A[15-8] ; _canTemp + 2 ---> A[23-16] ; _canTemp + 3 ---> A[31-24] ; ; AFFECT REG. : ax ; AFFECT MEM. : none ;------------------------------------------------------------------ ; ;------------------------------------------------------------------ ; SUBROUTINE : _CompareMem ; STATUS _CompareMem(U32 addr1,U32 addr2, U16 addrLen) ; FUNCTION : Compare two memory block by byte size ; INPUT : ; addr1 -- block1 start address ; range:00:0000h-01:FFFFh,0FE:0000h-0FF:FFFFh ; ; addr2 -- block2 start address. ; range:00:0000h-01:FFFFh,0FE:0000h-0FF:FFFFh ; ; addrLen -- memory length minimum : 1 byte. ; maximum : 64Kbytes.(just input 0h) ; ; OUTPUT : ax , return code. ; 0 --- OK, Match ; 1 --- Not Match [default in can program] ; (Error address stored in _canTemp) ; 2 --- Other failure, Please check _exceptBreak flag. ; ; Reply Buffer using the _canTemp buffer ; ( When Not Match / Not Ready ) ; =================================================== ; _canTemp + 0-3 ---> Block 1 address. (U32) ; _canTemp + 4 ---> Block 1 data (U8) ; _canTemp + 5-8 ---> Block 2 address. (U32) ; _canTemp + 9 ---> Block 2 data (U8) ; ; AFFECT REG. : ax ; AFFECT MEM. : none ;------------------------------------------------------------------ ; ;------------------------------------------------------------------ ; SUBROUTINE : _Checksum ; VOID Checksum (U32 addr,U16 addr length) ; FUNCTION : compute the check-sum of a block memory. ; INPUT : U32 block start addr. ; U16 Check Sum block length ; OUTPUT : ax return CODE, =0 (always), =1 CheckSum Fail ; _canTemp --> checksum,word size ; ; AFFECT REG. : ax ; AFFECT MEM. : none ;------------------------------------------------------------------ ; ;------------------------------------------------------------------ ; SUBROUTINE : _DumpMem --@@@@ ; STATUS _DumpMem (U32 addr,U16 addrLen,U8 *buff) ; FUNCTION : Dump memory by EP. Dump EP memory data to CAN RAM ; INPUT : U32 addr -- start address,32 double word ; U16 addrLen -- Dump length ; U8 *buf -- return data start address (offset) ; Special Note : Dump Length MUST less than 15K ; ; OUTPUT : AX ,return code. ; 0 -- OK(always) ; 1 -- Dump Error ; ; Return values are stored at ds:U8 *buf ; ; AFFECT REG. : ax ; AFFECT MEM. : none ;------------------------------------------------------------------ ; ;------------------------------------------------------------------ ; SUBROUTINE : _FillMem ---@@@@ ; STATUS _FillMem (U32 addr,U16 addrLen,U16 verify, ; U8 *buff ,U16 bufLen) ; FUNCTION : Fill memory by EP. ; Fill EP memory data from CAN RAM to desitnate memory. ; INPUT : ; addr -- start address ; addrLen -- Memory length ; verify -- [0] off / [1] perform verfiy ; Special Note : fill Length MUST less than 15K ; ; OUTPUT : AX ,return code. ; 0 -- OK (always) ; 1 -- Verify Failure ; ; Verify Fail address ---> _canTemp ( U32 adr , U8 expect , U8 actual ) ; _canTemp + 0 --> A[7..0] ; _canTemp + 1 --> A[15..8] ; _canTemp + 2 --> A[23..16] ; _canTemp + 3 --> A[31..24] ; _canTemp + 4 --> expect data ; _canTemp + 5 --> actual data ; ; AFFECT REG. : none ; AFFECT MEM. : none ;------------------------------------------------------------------ ; ;------------------------------------------------------------------ ; SUBROUTINE : _PreCopyMem ; STATUS _PreCopyMem (U32 addr1,U32 addr2,U16 addrLen, ; U16 verify) ; FUNCTION : copy memory forward,source address > destination address ; INPUT : none ; addr1 -- Source address ; addr2 -- Destination address ; addrLen -- Memory length ; verify -- [0] off / [1] perform verify ; ; OUTPUT : AX ,return code. ; 0 -- OK ; 1 -- Verify Failure ; 4 -- Other error,Check _exceptBreak flag. ; ; Verify Fail address ---> _canTemp (U32) ; _canTemp + 0 --> A[7..0] ; _canTemp + 1 --> A[15..8] ; _canTemp + 2 --> A[23..16] ; _canTemp + 3 --> A[31..24] ; ; AFFECT REG. : ax ; AFFECT MEM. : none ;------------------------------------------------------------------ ; ;------------------------------------------------------------------ ; SUBROUTINE : _PostCopyMem ; STATUS _PostCopyMem (U32 addr1,U32 addr2,U16 addrLen, ; U16 verify) ; FUNCTION : copy memory backward,source address < destination address ; INPUT : none ; addr1 -- Source address ; addr2 -- Destination address ; addrLen -- Memory length ; verify -- off[0]/on[1] ; OUTPUT : AX ,return code. ; 0 -- OK ; 1 -- Verify Failure ; 2 -- Source Area Not Ready ; 3 -- Destination Area Not Ready ; 4 -- Other error,Check _exceptBreak flag. ; ; Verify Fail/Not Ready address ---> _canTemp (U32) ; AFFECT REG. : ax ; AFFECT MEM. : none ;------------------------------------------------------------------ ; ;------------------------------------------------------------------- ; SUBROUTINE : _CheckEpStop(void) I/O read/write ; FUNCTION : Get EPSTOP singal on MCE16F Board,to al ; INPUT : none ; OUTPUT : al =1 --> EPSTOP(JmpHere State) , =0 --> EP Run ; AFFECT REG. : al ; AFFECT MEM. : none ;------------------------------------------------------------------- ; ;------------------------------------------------------------------ ; SUBROUTINE : _GoEp (void) ; FUNCTION : Set CPU FREE RUNNING ; INPUT : none ; Once EP stop, immediately call _GetPC ; --> get PC value from EP controler ; Then call _SavePC --> Save PC value to CAN RAM ; IF user wants to randomly chang PC value before EP Free Run , ; please use _ChangePC . ; OUTPUT : none ; AFFECT REG. : none ; AFFECT MEM. : none ;------------------------------------------------------------------ ; ;------------------------------------------------------------------ ; SUBROUTINE : _StopEP (void) ; FUNCTION : 1. Clear NFORCEBRK to Low ; 2. Confirm EPSTOP ; 3. Set NFORCEBRK to High ; 4. call GetPC ; 5. call SavePC ; ; INPUT : none ; OUTPUT : none ; AFFECT REG. : none ; AFFECT MEM. : none ;------------------------------------------------------------------ ; ;------------------------------------------------------------------ ; SUBROUTINE : _DisableSSI ; FUNCTION : disable synchronize start in ; INPUT : none ; OUTPUT : none ; AFFECT REG. ; none ; AFFECT MEM. ; _keepBuf ;------------------------------------------------------------------ ; ;------------------------------------------------------------------ ; SUBROUTINE : _DisableSSO ; FUNCTION : disable synchronize slave out ; INPUT : none ; OUTPUT : none ; AFFECT REG. ; none ; AFFECT MEM. ; _keepBuf ;------------------------------------------------------------------ ; ;------------------------------------------------------------------ ; SUBROUTINE : _EnableSSI ; FUNCTION : enable synchronize start in ; INPUT : none ; OUTPUT : none ; AFFECT REG. ; none ; AFFECT MEM. ; _keepBuf ;------------------------------------------------------------------ ; ;------------------------------------------------------------------ ; SUBROUTINE : _EnableSSO ; FUNCTION : enable synchronize slave out ; INPUT : none ; OUTPUT : none ; AFFECT REG. ; none ; AFFECT MEM. ; _keepBuf ;------------------------------------------------------------------ ; ;------------------------------------------------------------------ ; subroutine : VOID IsoIceHeader (VOID) ; function : Isolate ICE Header for Map Setting used. ; Save previous ISOEP state ; This function will save the ISOEP signal state then ; forces the ISOEP signal to active state. ; After Map Setting, the ReleaseHeaderBus should be ; called. ; input : none ; output : none ; affect reg. ; none ; affect mem. ; port ;------------------------------------------------------------------- ; ;------------------------------------------------------------------ ; subroutine : VOID ReleaseHeaderBus (VOID) ; function : Restore ISOEP signal state After Map Setting. ; input : none ; output : none ; affect reg. ; none ; affect mem. ; port ;------------------------------------------------------------------ ; ;------------------------------------------------------------------ ; SUBROUTINE : _Reset ; FUNCTION : warm reset ; 1.reconifg System Port ; 2.chkeck BTVCC ; 3.ClrNEPRSTtoLow ; 4.SetNEPRSTtoHi ; 5.Check EPSTOP ; FPGA1,2 ,Can & Insmntr need not reconfig ; ; OUTPUT : ax =0 --> OK, =1 --> fail (check _exceptBreak) ; AFFECT REG. : ax (return code) ; AFFECT MEM. : none ;------------------------------------------------------------------ ; ;********************************************************************** ; SUBROUTINE : _InitialReset ;------------------------------------------------------------------ ; SUBROUTINE : _InstructionStep ; FUNCTION : set STEP bit Hi in FPGA1 on MCE16F Board ; INPUT : none ; OUTPUT : none ; AFFECT REG. ; none ; AFFECT MEM. ; 10K10 on MCE16F Board ;------------------------------------------------------------------ ; FUNCTION : power up reset, cold reset ; : include : 1. initial system port ; 2. held NEPRST Low ; 3. Check BTVCC is on or not ; 4. Config FPGA1,FPGA2 ; 6. check Jmphere State ; 7. fill CAN Program ; 8. fill Instruction Monitor ; INPUT : none ; ; OUTPUT :ax =0 OK, =1 fail (check _exceptBreak) ; ; AFFECT REG. : ax (return code) ; AFFECT MEM. : none ;------------------------------------------------------------------ ; ;------------------------------------------------------------------- ; SUBROUTINE : _ChangePC(U32 new PC value) cp memory write ; FUNCTION : Change PC value in CAN RAM Program Area ; INPUT : U32 new PC value : Bit31-24 are always 0 ; ; OUTPUT : CAN RAM ; AFFECT REG. : none ; AFFECT MEM. : _LatchPC_Lwbuf,_LatchPC_Hwbuf ;------------------------------------------------------------------- ; ;****************************************************************** ; SUBROUTINE : _Pending ; FUNCTION : read if pending with SSI,MARK,6/3/93 ; INPUT : none ; OUTPUT : al=0 none,al=1 yes ; AFFECT REG. ; ax ; AFFECT MEM. ; ;****************************************************************** ; ;================================================================== ; SUBROUTINE : Initial CP Port ; FUNCTION : Set CP Port output the initial value ; OUTPUT : CP Port ; AFFECT REG. : none ; AFFECT MEM. : none ;------------------------------------------------------------------ ; ;------------------------------------------------------------------ ; SUBROUTINE : _GoEnd (U32 *pointer) ; FUNCTION : no trace and Return Break Source ; INPUT : *point[near] --> PC/SP ; OUTPUT : ax,return code ; 0 -- no executing GetIf (not available) ; 1 -- H/W execution Break Point 1 ; 2 -- H/W execution Break Point 2 (not available) ; 3 -- S/W execution Break Point (not available) ; 4 -- Trigger Break ; 5 -- Read before write Break (not available) ; 6 -- Violation Break (EMM) ; 7 -- force Break ; 8 -- Other, Check _exceptBreak Flag ! ; & No GetIf action. ; AFFECT REG. : ax ; AFFECT MEM. : none ;------------------------------------------------------------------ ; ;-------------------------------------------------------------- ; MAP251.A00 == Overlap Memory Operation Subroutine ;-------------------------------------------------------------- ; ;------------------------------------------------------------------ ;SUBROUTINE : _SetMapAction ; U16 SetMapAction (U32 mapStart, U32 mapEnd, U16 action ) ;FUNCTION : Set Mapping RAM . ; ACTION -- ; --- SetLowValue ---- ; 1. memInt fffeh ; 2. readOnly fffdh ; 3. guard fffbh ; 4. onChip fff7h ; 5. dMap ffefh ; ; --- SetHiValue ---- ; 6. memExt 0001h ; 7. clrReadOnly 0002h ; 8. clrGuard 0004h ; 9. clrOnChip 0008h ; 10. clrDMap 0010h ; ; --- SetWaitState --- ; 11. waitState0 0100h ; 12. waitState1 0101h ; 13. waitState2 0102h ; 14. waitState3 0103h ; 15. waitState4 0104h ; 16. waitState5 0105h ; 17. waitState6 0106h ; 18. waitState7 0107h ; ; 19. clearAll 55FFh ; (Note : When clearAll ACTION is set, the following ACTIONs ; will be set. ; a.memExt ; b.clrReadOnly ; c.clrGuard ; d.clrOnChip ; e.clrDMap ; f.wait7 ;Input : ;Output : ax 0-- OK(always). 1-- fail ;AFFECT REG. : ax (return code) ;AFFECT MEM. : Mapping RAM (8k*8) ;---------------------------------------------------------------- ; ;-------------------------------------------------------------------------- ;SUBROUTINE: _MapTest ; U16 _MapTest (Void) ;FUNCTION: test Mapping Ram ;Input : none ;Output : reture code (ax,0-->ok. , 1--> failure) ;-------------------------------------------------------------------------- ; ;-------------------------------------------------------------------------- ;SUBROUTINE: U16 _SetCmpRam (U32 addr, U16 action) ; ;FUNCTION: Set Compare Ram on MCE16F board ;Input : ; U32 addr ----- address of 8xC251 ; U16 action -- setExbp 0101h ; setTrip0 fffbh ; setTrip1 fff7h ; setTrapb ffefh ; setJhereb ffdfh ; setBit6 ffbfh ; setBit7 ff7fh ; ; clrExbp 0201h ; clrTrip0 0004h ; clrTrip1 0008h ; clrTrapb 0010h ; clrJhereb 0020h ; clrBit6 0040h ; clrBit7 0080h ; ; clrAllExbp 5403h ; clrAll 55ffh ; test 5600h ; ;Output : ;AFFECT REG. : ax (return code, 0-->OK. 1--> failure) ;AFFECT MEM. : Compare RAM (128k*8) ;-------------------------------------------------------------------------- ; ;-------------------------------------------------------------------------- ;SUBROUTINE: U16 _FillEmuMemByCp (U32 addr, U16 addrLen, U16 len, U8 *buff ; U16 verify) ;FUNCTION: Fill Emulation Memory by Control Processor ; ;INPUT: ; addr --- The start address is on destination space. ; addrLen --- The length of destination space. ; len --- The length of data pattern. ; *buff --- The pointer (near) of data pattern. ; verify --- off[0]/on[1] ;OUTPUT: ; return code -- 0 -> OK. ; 1 -> failure. check _failMessage. ; Note : _failMessage defined as below. ; U32 error address ; U8 expect data. ; U8 actual data. ; ; ;AFFECT REG. : ax (return code) ;AFFECT MEM. : Emulation memory ;-------------------------------------------------------------------------- ; ;-------------------------------------------------------------------------- ;SUBROUTINE: U16 _DumpEmuMemByCp (U32 addr, U16 addrLen, U8 *buff) ; ;FUNCTION: Dump Emulation Memory by Control Processor ; ;INPUT: ; addr --- 251 start address ; addrLen --- length of address ; *buff --- the pointer of reply buffer. ; ;OUTPUT: 0-->Ok(always), 1-->failure ; ;AFFECT REG. : ax (return code, 0-->Ok. 1-->failure) ;AFFECT MEM. : none ;-------------------------------------------------------------------------- ; ;-------------------------------------------------------------------------- ;SUBROUTINE: U16 _TestEmuMemByCp (U32 addr, U32 addrLen) ; ;FUNCTION: Test Emulation Memory by Control Processor ; ;INPUT: ; addr --- Start Address. ; addrLen --- Length ; ;OUTPUT: ; return code -- 0 -> OK. ; 1 -> failure. check _failMessage. ; Note : _failMessage defined as below. ; U32 error address ; U8 expect data. ; U8 actual data. ;AFFECT REG. : ax (return code) ;AFFECT MEM. : EMM ;-------------------------------------------------------------------------- ; ;-------------------------------------------------------------------------- ;SUBROUTINE: U16 _FillOnChipRomByCp (U32 addr, U16 addrLen, U16 len, U8 *buff ; U16 verify) ;FUNCTION: Fill On Chip ROM by Control Processor ; ;INPUT: ; addr --- The start address is on destination space. ; addrLen --- The length of destination space. ; len --- The length of data pattern. ; *buff --- The pointer (near) of data pattern. ; verify --- off[0]/on[1] ;OUTPUT: ; return code -- 0 -> OK. ; 1 -> failure. check _failMessage. ; Note : _failMessage defined as below. ; U32 error address ; U8 expect data. ; U8 actual data. ; ; ;AFFECT REG. : ax (return code) ;AFFECT MEM. : Emulation memory ;-------------------------------------------------------------------------- ; ;-------------------------------------------------------------------------- ;SUBROUTINE: U16 _DumpOnChipRomByCp (U32 addr, U16 addrLen, U8 *buff) ; ;FUNCTION: Dump On Chip ROM by Control Processor ; ;INPUT: ; addr --- 251 start address ; addrLen --- length of address ; *buff --- the pointer of reply buffer. ; ;OUTPUT: 0-->Ok(always), 1-->failure ; ;AFFECT REG. : ax (return code, 0-->Ok. 1-->failure) ;AFFECT MEM. : none ;-------------------------------------------------------------------------- ; ;-------------------------------------------------------------------------- ;SUBROUTINE: U16 _TestOnChipRomByCp (U32 addr, U16 addrLen) ; ;FUNCTION: Test On Chip Rom by Control Processor ; ;INPUT: ; addr --- Start Address. ; addrLen --- Length ; ;OUTPUT: ; return code -- 0 -> OK. ; 1 -> failure. check _failMessage. ; Note : _failMessage defined as below. ; U32 error address ; U8 expect data. ; U8 actual data. ;AFFECT REG. : ax (return code) ;AFFECT MEM. : EMM ;--------------------------------------------------------------------------