ARMÖÐCºÍ»ã±à»ìºÏ±à³Ì¼°Ê¾Àý
1£® ÔÚCÓïÑÔÖÐÄÚǶ»ã±à
ÔÚCÖÐÄÚǶµÄ»ã±àÖ¸Áî°üº¬´ó²¿·ÖµÄARMºÍThumbÖ¸Á²»¹ýÆäʹÓÃÓë»ã±àÎļþÖеÄÖ¸ÁîÓÐЩ²»Í¬£¬´æÔÚһЩÏÞÖÆ£¬Ö÷ÒªÓÐÏÂÃ漸¸ö·½Ã棺
a. ²»ÄÜÖ±½ÓÏòPC¼Ä´æÆ÷¸³Öµ£¬³ÌÐòÌøתҪʹÓÃB»òÕßBLÖ¸Áî
b. ÔÚʹÓÃÎïÀí¼Ä´æÆ÷ʱ£¬²»ÒªÊ¹ÓùýÓÚ¸´ÔÓµÄC±í´ïʽ£¬±ÜÃâÎïÀí¼Ä´æÆ÷³åÍ»
c. R12ºÍR13¿ÉÄܱ»±àÒëÆ÷ÓÃÀ´´æ·ÅÖмä±àÒë½á¹û£¬¼ÆËã±í´ïʽֵʱ¿ÉÄܽ«R0µ½R3¡¢R12¼°R14ÓÃÓÚ×Ó³ÌÐòµ÷Óã¬Òò´ËÒª±ÜÃâÖ±½ÓʹÓÃÕâЩÎïÀí¼Ä´æÆ÷
d. Ò»°ã²»ÒªÖ±½ÓÖ¸¶¨ÎïÀí¼Ä´æÆ÷£¬¶øÈñàÒëÆ÷½øÐзÖÅä
ÄÚǶ»ã±àʹÓõıê¼ÇÊÇ __asm»òÕßasm¹Ø¼ü×Ö£¬Ó÷¨ÈçÏ£º
__asm
{
instruction [; instruction]
…
[instruction]
}
asm(“instruction [; instruction]”);
ÏÂÃæͨ¹ýÒ»¸öÀý×ÓÀ´ËµÃ÷ÈçºÎÔÚCÖÐÄÚǶ»ã±àÓïÑÔ£¬
#include <stdio.h>
void my_strcpy(const char *src, char *dest)
{
char ch;
__asm
{
loop:
ldrb ch, [src], #1
strb ch, [dest], #1
cmp ch, #0
bne loop
}
}
int main()
{
char *a = "forget it and move on!";
char b[64];
my_strcpy(a, b);
printf("original: %s", a);
printf("copyed: %s", b);
return 0;
}
ÔÚÕâÀïCºÍ»ã±àÖ®¼äµÄÖµ´«µÝÊÇÓÃCµÄÖ¸ÕëÀ´ÊµÏֵģ¬ÒòΪָÕë¶ÔÓ¦µÄÊǵØÖ·£¬ËùÒÔ»ã±àÖÐÒ²¿ÉÒÔ·ÃÎÊ¡£
2£® ÔÚ»ã±àÖÐʹÓÃC¶¨ÒåµÄÈ«¾Ö±äÁ¿
ÄÚǶ»ã±à²»Óõ¥¶À±à¼»ã±àÓïÑÔÎļþ£¬±È½Ï¼ò½à£¬µ«ÊÇÓÐÖî¶àÏÞÖÆ£¬µ±»ã±àµÄ´úÂë½Ï¶àʱһ°ã·ÅÔÚµ¥¶ÀµÄ»ã±àÎļþÖС£Õâʱ¾ÍÐèÒªÔÚ»ã±àºÍCÖ®¼ä½øÐÐһЩÊý¾ÝµÄ´«µÝ£¬×î¼ò±ãµÄ°ì·¨¾ÍÊÇʹÓÃÈ«¾Ö±äÁ¿¡£
/* cfile.c
* ¶¨ÒåÈ«¾Ö±äÁ¿£¬²¢×÷ΪÖ÷µ÷³ÌÐò
*/
#include <stdio.h>
int gVar_1 = 12;
extern asmDouble(void);
int main()
{
printf("original value of gVar_1 is: %d", gVar_1);
asmDouble();
printf(" modified value of gVar_1 is: %d", gVar_1);
return 0;
}
¶ÔÓ¦µÄ»ã±àÓïÑÔÎļþ
;called by main(in C),to double an integer, a global var defined in C is used.
AREA asmfile, CODE, READONLY
EXPORT asmDouble
IMPORT gVar_1
asmDouble
ldr r0, =gVar_1
ldr r1, [r0]
mov r2, #2
mul r3, r1, r2
str r3, [r0]
mov pc, lr
END
3£® ÔÚCÖе÷Óûã±àµÄº¯Êý
ÔÚCÖе÷Óûã±àÎļþÖеĺ¯Êý£¬Òª×öµÄÖ÷Òª¹¤×÷Ó
Ïà¹ØÎĵµ£º
C µ÷ÓÃ Fortran
c2ffn.f
SUBROUTINE NAMEAGE(NAME, NLEN, AGE, TEMP)
CHARACTER*(*) NAME
INTEGER NLEN,AGE
REAL TEMP
C
WRITE(6,1000) NAME(1:NLEN),AGE,TEMP ......
1¡¢±àдһ¸ö²¼¶ûº¯Êýint is_leap_year(int year)£¬ÅжϲÎÊýyearÊDz»ÊÇÈòÄê¡£Èç¹ûijÄê·ÝÄܱ»4Õû³ý£¬µ«²»Äܱ»100Õû³ý£¬ÄÇôÕâÒ»Äê¾ÍÊÇÈòÄ꣬´ËÍ⣬Äܱ»400Õû³ýµÄÄê·ÝÒ²ÊÇÈòÄê¡£
#include <stdio.h>
int is_leap_year(int);
int main(){
int i,j;
printf("please input a number:");
scanf("%d",& ......
½éÉÜ
ͨ³££¬Ñз¢ÈËԱʹÓõÄÊÇT-SQLÀ´´´½¨SQL ServerµÄ´æ´¢¹ý³Ì¡¢º¯ÊýºÍ´¥·¢Æ÷¡£ ¶øÏÖÔÚµÄSQL Server 2005ÒÑÍêÈ«Ö§³Ö.NETͨÓÃÓïÑÔÔËÐÐʱ£¨CLR£©ÁË¡£ Õâ¾ÍÒâζ×Å£¬ÄúÄܹ»Ê¹ÓÃ.NETµÄÓïÑÔ£¬ÈçC#¡¢VB.NETÖ®ÀàµÄÀ´Ñз¢SQL ServerµÄ´æ´¢¹ý³Ì¡¢º¯ÊýºÍ´¥·¢Æ÷¡£ SQL Server ºÍ CLR µÄ¼¯³É¸øÎÒÃÇ´øÀ´ÁËn¶àºÃ´¦£¬Èçʵʱ±àÒë¡¢ÀàÐÍ°²È«¡ ......
- ¼ÓÈë²ËÄñѧϰÍø£¬»ñµÃÕä²Ø×ÊÔ´
Java´úÂë Êý¾ÝÍÚ¾òÖоö²ßÊ÷C4.5Ô¤²âË㷨ʵÏÖ(°ë³ÉÆ·£¬»¹ÒªÐ´¹æÔòºó¼ôÖ¦¼°¶Ô·ÇÀëÉ¢Êý¾ÝÐÅÏ¢ÔöÒæ¼ÆËã) Java´úÂë package org.struct.decisiontree; import java.util.ArrayList; import java.util.Arrays; ......
. ±àÒëµ¥Ôª(Ä£¿é)£º
ÔÚIDE¿ª·¢¹¤¾ß´óÐÐÆäµÀµÄ½ñÌ죬¶ÔÓÚ±àÒëµÄһЩ¸ÅÄîºÜ¶àÈËÒѾ²»ÔÙÇå³þÁË£¬ºÜ¶à³ÌÐòÔ±×îŵľÍÊÇ´¦ÀíÁ¬½Ó´íÎó(LINK ERROR), ÒòΪËü²»Ïñ±àÒë´íÎóÄÇÑù¿ÉÒÔ¸ø³öÄã³ÌÐò´íÎóµÄ¾ßÌåλÖã¬Äã³£³£¶ÔÕâÖÖ´íÎó¸Ðµ½°ÃÄÕ£¬µ«ÊÇÈç¹ûÄã¾³£Ê¹ÓÃgcc£¬makefileµÈ¹¤¾ßÔÚlinux»òÕßǶÈëʽÏÂ×ö¿ª·¢¹¤×÷µÄ ......