⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 strcopy.s

📁 wARM兼容ARM7TDMI指令集
💻 S
字号:
        AREA    StrCopy, CODE, READONLY
        ENTRY                   ; mark the first instruction to call

start
        LDR     r1, =srcstr     ; pointer to first string
        LDR     r0, =dststr     ; pointer to second string

        BL      strcopy ; call subroutine to do copy

stop
        MOV     r0, #0x18               ; angel_SWIreason_ReportException
        LDR     r1, =0x20026    ; ADP_Stopped_ApplicationExit
        SWI     0x123456                ; Angel semihosting ARM SWI


strcopy                 
        LDRB    r2, [r1],#1     ; load byte and update address
        STRB    r2, [r0],#1     ; store byte and update address;
        CMP     r2, #0  ; check for zero terminator
        BNE     strcopy ; keep going if not
        MOV     pc,lr           ; Return


        AREA    Strings, DATA, READWRITE
srcstr  DCB "First string - source",0
dststr  DCB "Second string - destination",0

        END

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -