Using the ARM Assembler

Hi,

does the device emulator supports ARM assembler written i a little asm file, compiled and linked to a normal app.exe written in C/C++?

I don't know i gettin' every time an access violation ( illegal instaruction ). It is fairly simple code:

in header just declaration:

extern"C"void Test();

in asm file for ARM just:

AREA text, CODE

EXPORT Test

Test

mov r4, #28 ; mov immediate 28 to r4 register

END
The illegal instruction excception occurs also when the asm file does not have any function or code only the code block. So the structure is maybe the source.

There is no support in msdn or code for using ARM Assembler.

Thx in advance.

[1247 byte] By [maddin123] at [2008-2-6]
# 1
It is not a question of emulator support of correctly linking C and assembly code. Read up on the calling convention for ARM at http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wcechp40/html/_armcall_ARM_Calling_Standard.asp. Note that you can use macros to isolate yourself from the details of the calling convention.

Thanks,

Vladimir

VladimirFedorov at 2007-9-8 > top of Msdn Tech,Smart Device Development,Device Emulator General...
# 2
You need a "return" instruction at the end of your function, or else the CPU will run whatever random code follows your instruction and crash. There is a RETURN macro that will make your code portable across the slight variations in ARM calling convention (ARMV4 vs ARMV4i). "bx lr" is the opcode for ARMV4I.

Barry

BarryBond at 2007-9-8 > top of Msdn Tech,Smart Device Development,Device Emulator General...