Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
h>
#define DEL_Value 0X0ffff // This value can be changed a/c to speed req
uirement.
NAME
This_is_an_Assembly_Code.
PUBLIC __iar_program_start
SECTION .intvec : CODE (2)
CODE32
// Any name
__iar_program_start
B main
SECTION .text : CODE (2)
CODE32
//----------- Delay Subroutine ------------------delay:
LDR R1,=DEL_Value // 32-bit delay value1 ( Outer loop )
Loop1: LDR R0,=1
// 32-bit delay value2 ( Inner Loop )
Loop2: SUBS R0,R0,#1 /* So total Delay = 32+32 = 46 bit delay routine */
BNE Loop2
SUBS R1,R1,#1
BNE Loop1
MOV PC,LR // return statement
B stop
END
// Infinite loop