basm

FLD instruction x64 bit

南笙酒味 提交于 2019-12-01 17:13:27
问题 I have a little problem with FLD instruction in x64 bit ... want to load Double value to the stack pointer FPU in st0 register, but it seem to be impossible. In Delphi x32, I can use this code : function DoSomething(X:Double):Double; asm FLD X // Do Something .. FST Result end; Unfortunately, in x64, the same code does not work. 回答1: In x64 mode floating point parameters are passed in xmm-registers. So when Delphi tries to compile FLD X, it becomes FLD xmm0 but there is no such instruction.

Delphi Assembly Function Returning a Long String

北慕城南 提交于 2019-12-01 09:40:43
问题 I am trying to learn inline assembly programming in Delphi, and to this end I have found this article highly helpful. Now I wish to write an assembly function returning a long string, specifically an AnsiString (for simplicity). I have written function myfunc: AnsiString; asm // eax = @result mov edx, 3 mov ecx, 1252 call System.@LStrSetLength mov [eax + 0], ord('A') mov [eax + 1], ord('B') mov [eax + 2], ord('C') end; Explanation: A function returning a string has an invisible var result:

Intel x86 assembly optimization techniques in a sample problem

自古美人都是妖i 提交于 2019-11-29 00:47:05
问题 I am learning assembler quite a while and I am trying to rewrite some simple procedures \ functions to it to see performance benefits (if any). My main development tool is Delphi 2007 and first examples will be in that language but they can be easily translated to other languages as well. The problem states as: We have given an unsigned byte value in which each of the eight bits represents a pixel in one row of a screen. Each single pixel can be solid (1) or transparent (0). So in other words