首页 > 解决方案 > masm 将浮点数传递给函数

问题描述

我正在尝试在我的屏幕上绘制一个三角形,它可以很好地调用 winapi Polygon 函数(https://docs.microsoft.com/en-us/windows/desktop/api/wingdi/nf-wingdi-polygon

.data
xy POINT <350,50>,<350,70>,<370,70>

.code

...

INVOKE Polygon, hdc, offset xy, lengthof xy

当我检查文档时,它说 POINT struct 用 LONG 存储 xy

typedef struct tagPOINT {
  LONG x;
  LONG y;
} POINT, *PPOINT;

但我认为不可能像这样直接初始化数据

.data
xy POINT <350.5,50.5>,<350.5,70.5>,<370.5,70.5>

那么可以用real4或real8在masm中调用这个函数吗?

标签: winapiassemblyfloating-pointmasm

解决方案


推荐阅读