flat assembler
Message board for the users of flat assembler.
 Home   FAQ   Search   Register 
 Profile   Log in to check your private messages   Log in 
flat assembler > Compiler Internals > [opcode] pushing a 32bit (byte sized) value in real mode

Author
Thread Post new topic Reply to topic
rain_storm



Joined: 05 Apr 2007
Posts: 67
Location: Ireland
[opcode] pushing a 32bit (byte sized) value in real mode
In real mode there are two ways to push a 32 bit byte sized value. The 66 68 version encodes and entire 32bit immediate within the instruction. The 66 6A version encodes only an 8bit immediate which is sign extended to 32bits when executed.


Code:

use16
push large 0 ; 66 6A 00
push dword 0 ; 66 68 00 00 00 00




I've seen the push large syntax in IDA Pro for the opcode 66 6A 00 but it doesn't translate to FASM syntax directly. How can I force FASM to generate the 66 6A version.
Post 20 Oct 2017, 20:18
View user's profile Send private message Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 6676
Location: Kraków, Poland
Use PUSHD mnemonic to get the size-optimized 32-bit version in 16-bit mode.
Post 20 Oct 2017, 20:25
View user's profile Send private message Visit poster's website Reply with quote
rain_storm



Joined: 05 Apr 2007
Posts: 67
Location: Ireland
Brilliant! Thanks Tomasz.
Post 20 Oct 2017, 20:29
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


Powered by phpBB © 2001-2005 phpBB Group.

Main index   Download   Documentation   Examples   Message board
Copyright © 2004-2016, Tomasz Grysztar.