曲径通幽论坛

标题: AT&T 和 NASM 的一些区别 [打印本页]

作者: beyes    时间: 2011-1-8 10:13
标题: AT&T 和 NASM 的一些区别
GAS memory operand            NASM memory operand
------------------                          -------------------

100                                            [100]
%es:100                                    [es:100]
(%eax)                                       [eax]
(%eax,%ebx)                              [eax+ebx]
(%ecx,%ebx,2)                           [ecx+ebx*2]
(,%ebx,2)                                   [ebx*2]
-10(%eax)                                  [eax-10]
%ds:-10(%ebp)                          [ds:ebp-10]

GAS syntax            NASM syntax
==========            ===========

jmp    *100              jmp  near [100]
call    *100              call near [100]
jmp    *%eax            jmp  near eax
jmp    *%ecx            call near ecx
jmp    *(%eax)         jmp  near [eax]
call    *(%ebx)         call near [ebx]
ljmp    *100             jmp  far  [100]
lcall    *100             call far  [100]
ljmp    *(%eax)        jmp  far  [eax]
lcall    *(%ebx)        call far  [ebx]
ret                          retn
lret                         retf
lret $0x100            retf 0x100




欢迎光临 曲径通幽论坛 (http://www.groad.net/bbs/) Powered by Discuz! X3.2