


ARM Macro Assembler    Page 1 


    1 00000000         ;#******************************************************
                       ***************************************
    2 00000000         ;# NAME: ARMcode.s                   *
    3 00000000         ;# Author:  EWUHAN  R & D Center, st                    
                       *
    4 00000000         ;# Desc: ARMcode examples                 *
    5 00000000         ;#          copy words from src to dst               *
    6 00000000         ;# History: shw.He 2005.02.22                 *
    7 00000000         ;#******************************************************
                       ***************************************
    8 00000000         
    9 00000000         ;/*-----------------------------------------------------
                       -------------------------------------*/
   10 00000000         ;/*          code                 */
   11 00000000         ;/*-----------------------------------------------------
                       -------------------------------------*/
   12 00000000         
   13 00000000                 GLOBAL           Reset_Handler
   14 00000000                 area             start,code,readwrite
   15 00000000                 entry
   16 00000000                 code32
   17 00000000 00000014 
                       num     EQU              20          ;/*  Set number of 
                                                            words to be copied 
                                                            */
   18 00000000         
   19 00000000         Reset_Handler
   20 00000000 E59F0044        ldr              r0, =src    ;/*  r0 = pointer t
                                                            o source block */
   21 00000004 E59F1044        ldr              r1, =dst    ;/*  r1 = pointer t
                                                            o destination block
                                                             */
   22 00000008 E3A02014        mov              r2, #num    ;/*  r2 = number of
                                                             words to copy */
   23 0000000C         
   24 0000000C E59FD040        ldr              sp, =0x30200000 ;/*  set up sta
                                                            ck pointer (r13) */
                                                            
   25 00000010         blockcopy
   26 00000010 E1B031A2        movs             r3,r2, LSR #3 ;/*  number of ei
                                                            ght word multiples 
                                                            */
   27 00000014 0A000005        beq              copywords   ;/*  less than eigh
                                                            t words to move ? *
                                                            /
   28 00000018         
   29 00000018 E92D0FF0        stmfd            sp!, {r4-r11} ;/*  save some wo
                                                            rking registers */
   30 0000001C         octcopy
   31 0000001C E8B00FF0        ldmia            r0!, {r4-r11} ;/*  load 8 words
                                                             from the source */
                                                            
   32 00000020 E8A10FF0        stmia            r1!, {r4-r11} ;/*  and put them
                                                             at the destination
                                                             */
   33 00000024 E2533001        subs             r3, r3, #1  ;/*  decrement the 
                                                            counter */
   34 00000028 1AFFFFFB        bne              octcopy     ;/*  ... copy more 
                                                            */



ARM Macro Assembler    Page 2 


   35 0000002C         
   36 0000002C E8BD0FF0        ldmfd            sp!, {r4-r11} ;/*  don't need t
                                                            hese now - restore 
                                                            originals */
   37 00000030         
   38 00000030         copywords
   39 00000030 E2122007        ands             r2, r2, #7  ;/*  number of odd 
                                                            words to copy */
   40 00000034 0A000003        beq              stop        ;/*  No words left 
                                                            to copy ? */
   41 00000038         wordcopy
   42 00000038 E4903004        ldr              r3, [r0], #4 ;/*  a word from t
                                                            he source */
   43 0000003C E4813004        str              r3, [r1], #4 ;/*  store a word 
                                                            to the destination 
                                                            */
   44 00000040 E2522001        subs             r2, r2, #1  ;/*  decrement the 
                                                            counter */
   45 00000044 1AFFFFFB        bne              wordcopy    ;/*  ... copy more 
                                                            */
   46 00000048         
   47 00000048         stop
   48 00000048 EAFFFFFE        b                stop
   49 0000004C         
   50 0000004C         ;/*-----------------------------------------------------
                       -------------------------------------*/
   51 0000004C         ;/*          make a word pool              */
   52 0000004C         ;/*-----------------------------------------------------
                       -------------------------------------*/
   53 0000004C 00000000 
              00000000 
              30200000         ltorg
   54 00000058         src
   55 00000058 00000001 
              00000002 
              00000003 
              00000004 
              00000005 
              00000006 
              00000007 
              00000008 
              00000001 
              00000002 
              00000003 
              00000004 
              00000005 
              00000006 
              00000007 
              00000008 
              00000001 
              00000002 
              00000003 
              00000004         dcd              1,2,3,4,5,6,7,8,1,2,3,4,5,6,7,8
,1,2,3,4
   56 000000A8         dst
   57 000000A8 00000000 
              00000000 
              00000000 
              00000000 



ARM Macro Assembler    Page 3 


              00000000 
              00000000 
              00000000 
              00000000 
              00000000 
              00000000 
              00000000 
              00000000 
              00000000 
              00000000 
              00000000 
              00000000 
              00000000 
              00000000 
              00000000 
              00000000         dcd              0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
,0,0,0,0
   58 000000F8                 end
Command Line: --debug --xref --device=DARMST9 --apcs=interwork -o.\obj\asm_code
1.o -IC:\Keil\ARM\INC\Samsung --list=.\lst\asm_code1.lst asm_code1.s



ARM Macro Assembler    Page 1 Alphabetic symbol ordering
Relocatable symbols

Reset_Handler 00000000

Symbol: Reset_Handler
   Definitions
      At line 19 in file asm_code1.s
   Uses
      At line 13 in file asm_code1.s
Comment: Reset_Handler used once
blockcopy 00000010

Symbol: blockcopy
   Definitions
      At line 25 in file asm_code1.s
   Uses
      None
Comment: blockcopy unused
copywords 00000030

Symbol: copywords
   Definitions
      At line 38 in file asm_code1.s
   Uses
      At line 27 in file asm_code1.s
Comment: copywords used once
dst 000000A8

Symbol: dst
   Definitions
      At line 56 in file asm_code1.s
   Uses
      At line 21 in file asm_code1.s
Comment: dst used once
octcopy 0000001C

Symbol: octcopy
   Definitions
      At line 30 in file asm_code1.s
   Uses
      At line 34 in file asm_code1.s
Comment: octcopy used once
src 00000058

Symbol: src
   Definitions
      At line 54 in file asm_code1.s
   Uses
      At line 20 in file asm_code1.s
Comment: src used once
start 00000000

Symbol: start
   Definitions
      At line 14 in file asm_code1.s
   Uses
      None
Comment: start unused
stop 00000048

Symbol: stop



ARM Macro Assembler    Page 2 Alphabetic symbol ordering
Relocatable symbols

   Definitions
      At line 47 in file asm_code1.s
   Uses
      At line 40 in file asm_code1.s
      At line 48 in file asm_code1.s

wordcopy 00000038

Symbol: wordcopy
   Definitions
      At line 41 in file asm_code1.s
   Uses
      At line 45 in file asm_code1.s
Comment: wordcopy used once
9 symbols



ARM Macro Assembler    Page 1 Alphabetic symbol ordering
Relocatable symbols

.debug_info$$$start 00000000

Symbol: .debug_info$$$start
   Definitions
      None
   Uses
      None
Warning: .debug_info$$$start undefinedComment: .debug_info$$$start unused
1 symbol



ARM Macro Assembler    Page 1 Alphabetic symbol ordering
Relocatable symbols

.debug_line$$$start 00000000

Symbol: .debug_line$$$start
   Definitions
      None
   Uses
      None
Warning: .debug_line$$$start undefinedComment: .debug_line$$$start unused
1 symbol



ARM Macro Assembler    Page 1 Alphabetic symbol ordering
Relocatable symbols

.debug_abbrev 00000000

Symbol: .debug_abbrev
   Definitions
      None
   Uses
      None
Warning: .debug_abbrev undefinedComment: .debug_abbrev unused
__ARM_asm.debug_abbrev 00000000

Symbol: __ARM_asm.debug_abbrev
   Definitions
      None
   Uses
      None
Warning: __ARM_asm.debug_abbrev undefinedComment: __ARM_asm.debug_abbrev unused
2 symbols



ARM Macro Assembler    Page 1 Alphabetic symbol ordering
Absolute symbols

num 00000014

Symbol: num
   Definitions
      At line 17 in file asm_code1.s
   Uses
      At line 22 in file asm_code1.s
Comment: num used once
1 symbol
335 symbols in table
