flat assembler
Message board for the users of flat assembler.

Index > Main > what name of this inttruction?

Author
Thread Post new topic Reply to topic
MinhHung



Joined: 10 Sep 2010
Posts: 51
Location: Viet Nam
MinhHung
i was reading http://download.intel.com/design/PentiumII/manuals/24319102.PDF
at page 796
Code:
adc
.... 
   immediate to al,ax or eax             0001 010w:immediate
    

what name of this instruction in FASM
{
and :immediate to al,ax or eax
cmp:immediate with al,ax or eax
imul:al,ax or eax with register[ memory]
mov(page801), or(803), rcl(register by cl page 804)....}

_________________
sorry for my english
Post 11 Jan 2011, 02:23
View user's profile Send private message Yahoo Messenger Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3502
Location: Bulgaria
JohnFound
Addition with carry. The general syntax is:

Code:
adc dest, source
    


The operation is: dest := dest + source + CF
Post 11 Jan 2011, 07:40
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
MinhHung



Joined: 10 Sep 2010
Posts: 51
Location: Viet Nam
MinhHung
yes,
but i mean is one opcode like:
Code:
adc 1234    

because "intel" page 796 write 'Addition with carry' immediate to al,ax or eax
Post 11 Jan 2011, 10:41
View user's profile Send private message Yahoo Messenger Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3502
Location: Bulgaria
JohnFound
No, it is only the particular opcode that makes this particular operation. So, the proper fasm syntax is "adc eax, 1234" (or al, ax, etc.)
In standard intel syntax, there is no implicit operands for "adc" instruction.
Post 11 Jan 2011, 10:54
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
MinhHung



Joined: 10 Sep 2010
Posts: 51
Location: Viet Nam
MinhHung
Code:
format PE console
entry main
include 'win32ax.inc'

section '.data' data readable writeable
num db 'My number is:%i',$a,0

section '.code' code readable executable

main:
        mov eax,10
        stc       ;set carry flag
        db $15    ;adc
        dd $1     ; opcode of adc, immediate
        invoke printf,num,eax
        invoke getchar

section '.idata' import data readable
library msvcrt,'msvcrt.dll'

import msvcrt,\
printf,'printf',\
getchar,'getchar'    


it work, but in fasm i can't find what are name of this instruction

_________________
sorry for my english
Post 12 Jan 2011, 05:19
View user's profile Send private message Yahoo Messenger Reply with quote
SFeLi



Joined: 03 Nov 2004
Posts: 140
SFeLi
MinhHung, adc eax, dword 1. Without dword prefix fasm would use opcode 83 (adc r/m32,imm8) which is two bytes shorter.
Post 12 Jan 2011, 07:01
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.