;----------------------------------------------------------------------------- ; Copyright (C) 2004 Silicon Laboratories, Inc. ; ; ; FILE NAME : RAM_FILL.ASM ; TARGET MCU : C8051F000 ; DESCRIPTION : This program disables the watchdog timer and fills RAM with ; value equal to address. ; ; NOTES: ; (1) This note intentionally left blank. ; ; ;----------------------------------------------------------------------------- ;----------------------------------------------------------------------------- ; EQUATES ;----------------------------------------------------------------------------- $include (c8051f000.inc) ; Include register definition file. ;----------------------------------------------------------------------------- ; VARIABLES ;----------------------------------------------------------------------------- ;----------------------------------------------------------------------------- ; RESET and INTERRUPT VECTORS ;----------------------------------------------------------------------------- ; Reset Vector cseg AT 0 ljmp Main ; Locate a jump to the start of code at ; the reset vector. ;----------------------------------------------------------------------------- ; MAIN PROGRAM CODE ;----------------------------------------------------------------------------- Code_Seg segment CODE rseg Code_Seg ; Switch to this code segment. using 0 ; Specify register bank for the following ; program code. Main: ; Disable the WDT. (IRQs not enabled at this point.) ; If interrupts were enabled, we would need to explicitly disable ; them so that the 2nd move to WDTCN occurs no more than four clock ; cycles after the first move to WDTCN. mov WDTCN, #0DEh mov WDTCN, #0ADh mov R0, #00H ; use R0 as pointer to memory location loop: mov @R0, AR0 ; write to indexed address with address value djnz R0,loop ; check if finished sjmp $ ; loop here forever ;----------------------------------------------------------------------------- ; End of file. END