Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
software:keil:asm_project [2016/02/19 07:14] – created feursoftware:keil:asm_project [2020/02/07 16:20] (current) – [Minimal Assembly Project] akdi
Line 1: Line 1:
-====== Create Assembly Project ======+====== Create an Assembly Project ======
  
 Creating an Assembly project is pretty much the same as createing a [[c_project|C project]]. \\ Creating an Assembly project is pretty much the same as createing a [[c_project|C project]]. \\
  
-\\ {{keil_add_file_2.png?500em}} \\ \\+\\ {{keil_add_file_3.png?700em}} \\ \\
  
 |< 100% 10em >| |< 100% 10em >|
 ^Type|Choose "Asm File (.s)".| ^Type|Choose "Asm File (.s)".|
 ^Name|Choose an appropriate name.| ^Name|Choose an appropriate name.|
-^Location|Choose correct [[#prepare_project_directory|location]] (.\App).|+^Location|Choose correct [[c_project#prepare_project_directory|location]] (.\App).|
  
 ===== Normal Assembly Project ===== ===== Normal Assembly Project =====
  
-To create a "normal" Assembly project you just have to add Assembly files to the project instead of C files. \\ \\+To create a "normal" Assembly project you just have to add Assembly files to the project instead of C files. \\  
 +The example code bellow shows a minimal main procedure. \\
  
-Example code for main procedure: 
 <file asm main.s> <file asm main.s>
                  AREA myCode, CODE, READONLY                   AREA myCode, CODE, READONLY 
Line 20: Line 20:
                  THUMB                   THUMB 
    
-ADR_LED          EQU    0x60000100  +ADDR_LED         EQU    0x60000100  
-ADR_DIPSW        EQU    0x60000200 +ADDR_DIPSW       EQU    0x60000200 
    
 main             PROC  main             PROC 
                  EXPORT main                   EXPORT main 
    
-                 LDR    R0, =ADR_LED  +                 LDR    R0, =ADDR_LED  
-                 LDR    R1, =ADR_DIPSW +                 LDR    R1, =ADDR_DIPSW 
 loop             LDR    R2, [R1, #0]  loop             LDR    R2, [R1, #0] 
                  STR    R2, [R0, #0]                   STR    R2, [R0, #0] 
Line 37: Line 37:
                  END                   END 
 </file> </file>
 +\\
  
 +===== Minimal Assembly Project =====
  
 +The difference between a normal an d a minimal Assembly project is, that for the minimal project you don't need to choose a runtime component. This means you have to take care of every aspect yourself! \\
 +The example code bellow shows a very minimal setup (without access to the CT Board [[ctboard:input|input]] or [[ctboard:output|output]] peripherals). \\
  
-===== Minimal Assembly Project =====+<file asm main.s> 
 +                AREA RESET, DATA, READONLY  
 +                EXPORT __Vectors  
 +__Vectors  
 +                DCD  0x2002ffff             ; top of stack  
 +                DCD  Reset_Handler          ; reset vector  
 +  
 +  
 +                AREA myCode, CODE, READONLY  
 +  
 +                THUMB  
 +  
 +CONST_VALUE_X   EQU  12  
 +  
 +  
 +                ENTRY  
 +Reset_Handler  
 +  
 +; -- Your code belongs here ---------------------------------  
 +  
 +                LDR  R0, =0  
 +                LDR  R1, =CONST_VALUE_X  
 +loop            ADD  R0, R1  
 +                B    loop  
 +              
 +; -- Your code ends here ------------------------------------  
 +  
 +                END  
 +</file> 
 +\\ \\ 
 + 
 + 
 +//**Back to [[software:start:getting_started|Getting Started]]**//
  • software/keil/asm_project.1455866046.txt.gz
  • Last modified: 2016/02/19 07:14
  • by feur