文章目錄
基本知識:記憶體訪問指令:
LDR : memory--->register 將記憶體的值,存放到寄存器中
STR: register ---->memory
實驗原理圖:
Register Address R/W Description Reset Value
GPBCON 0x56000010 R/W Configures the pins of port B 0x0
GPBDAT 0x56000014 R/W The data register for port B Undef.
GPBUP 0x56000018 R/W Pull-up disable register for port B 0x0
Reserved 0x5600001c
00 = Input 01 = Output
GPB5/6/8/10 作為輸出
0001 0001 0001 0100 0000 0000
1 1 1 4 0 0
0x111400
GPB5/6/8/10 設定輸出為低電平
1010 1001 1111
a 9 f
0xa9f
原始碼如下:
;**************************************
; 點亮幾個LED燈,實驗
;
;*************************************
AREA LED, CODE, READONLY
ENTRY;入口
START ;start是標號要頂格
LDR R3,=0x56000010
LDR R2,=0x111400; 將gpb5/6/8/10作為輸出
STR R2,[R3]
LDR R4,=0x56000014
LDR R5,=0xa9f;將gpb5/6/8/10輸出設定為低電平
STR R5,[R4]
B START
END
實驗成功:本例子學習了最基本的彙編結構,以及格式要求,環境配置,以及下載。
---------------------------------------------------------堅持不懈、追求卓越 ----------------------------------------------------------------------