Skip to content

Incorrect access mode on FSTP instruction operand #1255

@jdhiser

Description

@jdhiser

Capstone reporting operand 0 as READ, not WRITTEN for fstp instructions on current master.

$ ./cstool -d x64 "0xdd    0xd9"
 0  dd d9                                            fstp	st(1)
	Prefix:0x00 0x00 0x00 0x00 
	Opcode:0xdd 0x00 0x00 0x00 
	rex: 0x0
	addr_size: 8
	modrm: 0xd9
	disp: 0x0
	sib: 0x0
	op_count: 1
		operands[0].type: REG = st(1)
		operands[0].size: 10
		operands[0].access: READ
	Registers read: st(1)
	Registers modified: fpsw
	EFLAGS: MOD_CF PRIOR_SF PRIOR_AF PRIOR_PF

$ ./cstool -d x64 "0xdb    0x7c    0x24    0x40"
 0  db 7c 24 40                                      fstp	xword ptr [rsp + 0x40]
	Prefix:0x00 0x00 0x00 0x00 
	Opcode:0xdb 0x00 0x00 0x00 
	rex: 0x0
	addr_size: 8
	modrm: 0x7c
	disp: 0x40
	sib: 0x24
		sib_base: rsp
		sib_scale: 1
	op_count: 1
		operands[0].type: MEM
			operands[0].mem.base: REG = rsp
			operands[0].mem.disp: 0x40
		operands[0].size: 10
		operands[0].access: READ
	Registers read: rsp
	Registers modified: fpsw
	FPU_FLAGS: MOD_C1 UNDEF_C0 UNDEF_C2 UNDEF_C3
	Groups: fpu 

$ git branch
* master

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions