PRELIMINARY
Assembly Source for Algorithms
| SPLK #04000h,FL_ST ;FL_ST = FLASH1 CTRL REGS |
FL0 | RET |
*************************************************************
.page
*************************************************************
* THIS SECTION PROGRAMS THE VALUE STORED IN FL_DATA INTO | * | |
* | THE FLASH ADDRESS DEFINED BY FL_ADRS. | * |
* |
| * |
* The following resources are used for temporary storage: *
* | AR6 | Parameter passed to Delay | * |
* | SPAD1 | Flash program and STOP commands | * |
* | SPAD2 | Flash program + EXE command. | * |
**************************************************************
EXE_PGM |
|
| ; | * | |
* |
|
|
|
| * |
| CALL | ARRAY | ;ACCESS ARRAY | * | |
* LOAD WADRS AND WDATA |
| ** | |||
| LACL | FL_ADRS | ;ACC => PROGRAM ADRS | * | |
| TBLW | FL_DATA | ;LOAD WADRS AND WDATA | * | |
| CALL | REGS | ;ACCESS FLASH REGS | * | |
* SET UP WRITE COMMAND WORDS | ** | ||||
| LACL | PROTECT | ;GET SEGMENT PROTECT MASK | ** | |
| OR |
| #WR_CMND | ;OR IN WRITE COMMAND | ** |
| SACL | SPAD1 | ;SPAD1 = WRITE COMMAND | ** | |
| OR |
| #WR_EXE | ;OR IN EXEBIN COMMAND | ** |
| SACL | SPAD2 | ;SPAD2 = WRITE EXE COMMAND | ** | |
| LACL | FL_ST | ;ACC => (FLASH) | * | |
* |
|
|
|
| * |
* | ACTIVATE WRITE BIT |
| ** | ||
| TBLW | SPAD1 | ;EXECUTE COMMAND | ** | |
| LAR |
| AR6,#D10 | ;SET DELAY | ** |
| CALL | DELAY,*,AR6 | ;WAIT | ** | |
* | SET EXEBIN BIT |
| ** | ||
| TBLW | SPAD2 | ;EXECUTE COMMAND | ** | |
| LAR |
| AR6,#D100 | ;SET DELAY | ** |
| CALL | DELAY,*,AR6 | ;WAIT | ** | |
* | STOP WRITE OPERATION |
| * | ||
| SPLK | #0,SPAD1 | ;SHUT DOWN WRITE OPERATION | * | |
| TBLW | SPAD1 | ;EXECUTE COMMAND | * | |
| TBLW | SPAD1 | ;EXECUTE COMMAND | * | |
| LAR |
| AR6,#D10 | ;SET DELAY | * |
| CALL | DELAY,*,AR6 | ;WAIT | * | |
* |
|
|
|
| * |
| RET | ;RETURN TO CALLING SEQUENCE | * |
*************************************************************
.page
*************************************************************
* ACTIVATE VER0 ON FLASH READS | * | |
* | LOADS FLASH WORD AT ADDR FL_ADRS TO FL_DATA. | * |
* | Uses SPAD1 for temporary storage of flash commands. | * |
*************************************************************
SET_RD_VER0 | ; | * |
CALL REGS | ;ACCESS FLASH REGISTERS | * |
PRELIMINARY | Assembly Source Listings and Program Examples |