10.07.2015 Views

PDF version - ARM Information Center

PDF version - ARM Information Center

PDF version - ARM Information Center

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>ARM</strong>과 Thumb의 인터워킹MOVS R3, #3 ; Load R3 with value 3.ADDS R2, R2, R3; R2 = R2 + R3ADR R0, <strong>ARM</strong>ProgBX R0; Branch exchange to <strong>ARM</strong>Prog.; SECTION3<strong>ARM</strong>; Subsequent instructions are <strong>ARM</strong> code.<strong>ARM</strong>ProgMOV R4, #4MOV R5, #5ADD R4, R4, R5; SECTION 4stop MOV R0, #0x18; angel_SWIreason_ReportExceptionLDR R1, =0x20026; ADP_Stopped_ApplicationExitSVC 0x123456; <strong>ARM</strong> semihostingEND; Mark end of this file.다음 단계에 따라 모듈을 빌드하고 링크합니다.1. 인터워킹용으로 소스 파일을 어셈블하려면 다음을 입력합니다.armasm --debug --apcs=/interwork addreg.s2. 객체 파일을 링크하려면 다음을 입력합니다.armlink addreg.o -o addreg.axf또는 인터워킹 베니어의 크기를 보려면 다음을 입력합니다.armlink addreg.o -o addreg.axf --info=veneers3. 호환되는 디버거를 적절한 디버그 타겟과 함께 사용하여 이미지를 실행합니다.예제 5-3 베니어를 사용한 어셈블리 언어 인터워킹이 예제에서는 레지스터 R0 ~ R2를 각각 값 1, 2 및 3으로 설정하는 어셈블리 코드의 소스 코드 인터워킹을 보여 줍니다. 레지스터 R0과 R2는 <strong>ARM</strong> 코드에서 설정되고 R1은 Thumb 코드에서 설정됩니다. 링커에서 인터워킹 베니어가 자동으로 삽입됩니다. 베니어를 사용하려면 다음을 수행합니다.• --apcs=/interwork 옵션을 사용하여 코드를 어셈블해야 합니다.• MOV pc,lr이 아닌 BX lr 명령어를 사용하여 복귀해야 합니다.; *****; arm.s; *****PRESERVE8<strong>ARM</strong> DUI 0203IK Copyright © 2002-2008 <strong>ARM</strong> Limited. All rights reserved. 5-9Unrestricted AccessNon-Confidential

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!