我的第一个汇编程序,led流水灯

;S3C2410X 芯片
;SFR Area 0x4800_0000 0x600_0000
GPFCON      EQU  0x56000050     ;Port F control
GPFDAT      EQU  0x56000054     ;Port F data
GPFUP       EQU  0x56000058     ;Pull-up control F 
   
 AREA myarea, CODE
 ENTRY

 LDR r0, =0x5500   ;0b 0101 0101 0000 0000 output GPFCON 
 LDR r1, = GPFCON
 STR r0,[r1]    ; 设置GPFCON寄存器

 LDR r0, = 0xf0
 LDR r1, =GPFUP
 STR r0,[r1] ;设置 GPF4~GPF7上拉有效
  LDR r2, = 0xfe
start_while
 
 ROR r2,#1
 LDR r1, =GPFDAT  
 STR  r2,[r1]
    
    LDR r0, =0xffff 
loop1
 SUBS r0,r0, #1
 BNE loop1

 LDR r0, = 0xF0
 LDR r1, =GPFDAT
 STR  r0,[r1]

 LDR r0, =0xffff
loop2
 SUBS r0,r0, #1
 BNE loop2 
   
 B start_while

stop
 B stop
 END


 

 

你可能感兴趣的:(汇编)