SPNU118Y September 1995 – February 2020
.global C_MEMCPY
C_MEMCPY: .asmfunc stack_usage(12)
CMP r2, #0 ; CHECK FOR n == 0
BXEQ lr ;
STMFD sp!, {r0, lr} ; SAVE RETURN VALUE AND ADDRESS
TST r1, #0x3 ; CHECK ADDRESS ALIGNMENT
BNE _unaln ; IF NOT WORD ALIGNED, HANDLE SPECIALLY
TST r0, #0x3 ;
BNE _saln ;
_aln: CMP r2, #16 ; CHECK FOR n >= 16
BCC _l16 ;
STMFD sp!, {r4} ;
SUB r2, r2, #16 ;
As shown in Example 2, the disassembler can produce disassembly from the object file, memcpy32.obj. The first two lines are entered on the command line.