ram_fill.asm

来自「8051试验程序 基础教材」· 汇编 代码 · 共 62 行

ASM
62
字号

;-----------------------------------------------------------------------------
; ram_fill.ASM
;-----------------------------------------------------------------------------
;	Copyright (C) 2005 Silicon Laboratories, Inc.
;
; 	FILE NAME  	: RAM_FILL.ASM
;  DATE        : 12 OCT 01
; 	TARGET MCU	: C8051F30x
; 	DESCRIPTION	: This program disables the watchdog timer and fills RAM with
;				  	  value equal to address.
;
;  	NOTES:
;	(1)	This note intentionally left blank.
;
;
;-----------------------------------------------------------------------------

#include "ioC8051F300.h"                  ; Include register definition file

;-----------------------------------------------------------------------------
; EQUATES
;-----------------------------------------------------------------------------


;-----------------------------------------------------------------------------
; VARIABLES
;-----------------------------------------------------------------------------
	
																
;-----------------------------------------------------------------------------
; RESET and INTERRUPT VECTORS
;-----------------------------------------------------------------------------

            ; Reset Vector
            ASEGN CSEG01:CODE,00h
            ljmp  Main                    ; Jump beyond interrupt vector
                                          ; space.

;-----------------------------------------------------------------------------
; CODE SEGMENT
;-----------------------------------------------------------------------------


            RSEG RAM_FILL:CODE

Main:
            ; Disable the WDT.
            anl   PCA0MD, #NOT(040h)      ; clear Watchdog Enable bit

            mov   R0, #00H                ; use R0 as pointer to memory location
loop:       mov   @R0, 0                  ; write to indexed address with
                                          ; address value
            djnz  R0, loop                ; check if finished
	
            sjmp  $                       ; loop here forever


;-----------------------------------------------------------------------------
; End of file.

            END

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?