[תÌù]linuxÏÂcÓïÑÔǶÈë»ã±à
ÍøÉÏ¿´µ½µÄÕâÆª¹ØÓÚLinuxÏÂCÓïÑÔǶÈë»ã±àµÄÎÄÕÂдµÄ·Ç³£È«£¬×ªÔعýÀ´¡£
Using Assembly Language in Linux.
IntelºÍAT&T»ã±àÓï·¨²îÒ죺
1¡£Ç°×º£º
Intel»ã±à¼Ä´æÆ÷ºÍÁ¢¼´ÊýÎÞÐèǰ׺¡£ºóÕ߼ĴæÆ÷ǰ׺Ϊ%£¬Á¢¼´Êýǰ׺Ϊ$¡£
eg£º
Intex Syntax
mov eax,1
mov ebx,0ffh
int 80h
AT&T Syntax
movl $1,%eax
movl $0xff,%ebx
int $0x80
2¡£¶þÕß¶Ô²Ù×÷Êý´¦Àí·½Ïò²»Í¬£º
eg£º
Intel »ã±àÓï·¨£º
instr dest,source
mov eax,[ecx]
AT&T »ã±àÓï·¨£º
instr source,dest
movl (%ecx),%eax
3¡£ÄÚ´æ±äÁ¿Óï·¨²îÒ죺
IntelÓ﷨ʹÓÃÖÐÀ¨ºÅ[]£¬ºóÕßʹÓÃСÀ¨ºÅ()
eg£º
Intex Syntax
mov eax,[ebx]
mov eax,[ebx+3]
AT&T Syntax
movl (%ebx),%eax
movl 3(%ebx),%eax
4¡£ºó׺£º
AT&T»ã±àÖ¸ÁîÓкó׺£¬ÒÔ±íÃ÷Êý¾ÝÀàÐÍ£¨8λ¡¢16λµÈ£©£»IntelÔò¸ù¾Ý¼Ä´æÆ÷×Ô¶¯Ê¶±ð¡£
eg£º
Intel Syntax
mov al,bl
mov ax,bx
mov eax,ebx
mov eax, dword ptr [ebx]
AT&T Syntax
movb %bl,%al
movw %bx,%ax
movl %ebx,%eax
movl (%ebx),%eax
5¡£
Intel£ºsegreg:[base+index*scale+disp]
AT&T£º %segreg:disp(base,index,scale).
Àý×Ó£º
1 #include <stdio.h>
2
3 int main(void) {
4 long eax=4;
5 long ebx=2;
6
7 __asm__ __volatile__ ("addl %1, %0"
8
Ïà¹ØÎĵµ£º
1. HCI²ãÐÒé¸ÅÊö£º
HCIÌṩһÌ×ͳһµÄ·½·¨À´·ÃÎÊBluetoothµ×²ã¡£ÈçͼËùʾ£º
´ÓͼÉÏ¿ÉÒÔ¿´³ö£¬Host Controller Interface(HCI) ¾ÍÊÇÓÃÀ´¹µÍ¨HostºÍModule¡£Hostͨ³£¾ÍÊÇPC£¬ ModuleÔòÊÇÒÔ¸÷ÖÖÎïÀíÁ¬½ÓÐÎʽ£¨USB,serial,pc-cardµÈ£©Á¬½Óµ½PCÉϵÄbluetooth Dongle¡£
ÔÚHostÕâÒ»¶Ë£ºapplication,SDP,L2capµÈÐÒé ......
ÔÍÄðÐí¾ÃµÄÊÖ¼ÇÖÕÓÚÃæÊÀÁË£¬Ï£Íû¸ßÊÖ¶à¶àÖ¸µã¡£´Ó7Ôµ½ÏÖÔÚ£¬ÎÒ²ÎÓëµÄ²úÆ·µÄÑз¢£¬Ò²Ëã¸æÒ»¶ÎÂ䣬Ã÷Ìì¾ÍÊdzɶ¼µÄÒ½²©»áÁË£¬Õ⼸¸öÔÂÂýÂý¿Ð³öÀ´µÄ¶«Î÷£¬ÒªºÃºÃµÄ×ܽáһϣ¬´óѧµÄʱºò£¬ÍæµÄÊǵ¥Æ¬»ú£¬armÂã»ú£¬¶ÔÓÚϵͳÓÐËùÁ˽⣬×ö¹ýһЩСʵÑ飬µ«ÊÇûÓÐϵͳµÄѧϰ£¬Èç½ñ×öµÄÊÂÇ飬ÈÃÎÒ¶ÔǶÈëʽlinuxµÄÈÏʶҲ¸üÕýÁËÐ ......
LinuxµÄÎļþ²Ù×÷APIÉæ¼°µ½´´½¨¡¢´ò¿ª¡¢¶ÁдºÍ¹Ø±ÕÎļþ¡£
1.linux API
¡¡¡¡´´½¨
int creat(const char *filename, mode_t mode);
¡¡¡¡²ÎÊýmodeÖ¸¶¨Ð½¨ÎļþµÄ´æÈ¡È¨ÏÞ£¬ËüͬumaskÒ»Æð¾ö¶¨ÎļþµÄ×îÖÕȨÏÞ£¨mode&umask£©£¬ÆäÖÐumask´ú±íÁËÎļþÔÚ´´½¨Ê±ÐèҪȥµôµÄһЩ´æÈ¡È¨ÏÞ¡£umask¿Éͨ¹ýϵͳµ÷ÓÃumask()À´¸ ......
ѧϰlinuxÒ»Äê¶àÁË£¬»ù±¾¾ÍÊÇÒ»¸ö“ϹÕû££>³öÎÊÌ⣣>°Ù¶È/Google££>½â¾öÎÊÌ⣣>¼ÌÐøÏ¹Õû"µÄÑ»·¡£ºÜ¸ÐÐ»ÍøÉÏÄÇô¶àÈ˶¼ÄܰÑ×Ô¼ºµÄ¾Àú¡¢¾Ñé¸ú´ó¼Ò·ÖÏí£¬ËùÒÔÒ»Ö±¶¼ÓаÑ×Ô¼ºÅöµ½µÄÎÊÌâ¼°½â¾ö°ì·¨¸ú´ó¼Ò·ÖÏí£¬Ï£Íû¶Ô´ó¼ÒÄÜÓÐËù°ïÖú¡£
ºÃ£¬²»¶à·Ï»°ÁË¡ ......
Õ⼸Ìì×°ÁËUbuntu²Å·¢ÏÖ£¬XmarkÔç¾Í±»ºÓзǯÁË¡£ÄѹÖ֮ǰÊéǩһֱ´«²»ÉÏÈ¥¡£¡£ÐÒºÃwin7»¹Ã»É¾£¬²»È»ÎÒÕû¸öÔµÄÊéÇ©¶¼Ã»ÁË¡£
Ôڴ˼ǼһÏÂÆÆÇ½µÄ·½·¨£º
sudo emacs /etc/hosts
Ìí¼Ó
64.147.188.86 www.xmark.com
64.147.188.92 api.xmarks.com
64.147.188.89 login.xmarks.com
64.147.188.87 sync.xmarks.com
......