본문 바로가기
코스웨어/15년 스마트컨트롤러

20151126_안향진_ARM어셈블리_1

by 알 수 없는 사용자 2015. 11. 27.
728x90
반응형

<ARM 어셈블리>


=모드 (오스트랄로피테쿠스 다이아몬드 구슬치기)






=UND : 없는 명령(어셈블리 instruction)을 만났을 때

=ABT : 

1. Abort mode는 Access 하려는 주소가 Access 할 수 없는 주소

2. Instruction fetch를 해오려는 데 못해 온 경우

3. MMU, MPU : Access Protection이 걸려 있는 주소를 함부로 Access하려고 했을 때


:운영체제를 기반에 두고 만든 것


=이식 : 각 CPU에 대해서 알아야함


-리눅스 : 다양한 CPU에서 동작


=레지스터



=>FIQ는 Banked register가 더 많음 => push/ pop이 필요 없는 R8~R12 먼저 사용 => 속도 빠름




=context



=하드웨어적으로 Exception

-SVC : 전원인가 / reset => 0번지로 점프(

        ldr         pc, =reset_handler



=Exception 7가지



<cstartup.s>

/* Exception vectors

(should be a branch to be detected as a valid code by the rom */


_exception_vectors:

reset_vector:

        ldr         pc, =reset_handler

undef_vector:

        b           undef_vector    /* Undefined Instruction */

swi_vector:

        b           swi_vector      /* Software Interrupt */

pabt_vector:

        b           pabt_vector     /* Prefetch Abort */

dabt_vector:

        b           dabt_vector     /* Data Abort */

rsvd_vector:

        b           rsvd_vector     /* reserved */

irq_vector:

        b           irq_handler     /* IRQ : read the AIC */

fiq_vector:

/*--------------------------------------------------------------

 *- Function             : fiq_handler

 *- Treatments           : FIQ Interrupt Handler.

 *- Called Functions     :

 *-----------------------------------------------------------------*/

fiq_handler:

                b              fiq_handler


=>가장 빠르게 동작하도록 FIQ는 바로 함수 실행



=Low vector

-High vector


=Vector table (arm : exception vector table)



=Exception 우선순위




728x90