SeB*_*Bee 0 c floating-point x86 assembly types
嘿!
我想在装配中画线.我用C编写了算法,现在我需要把它放到汇编中.
我是16位实模式; 图形模式:12h(640*480 16色)
C源:
//x1/y1/x2/y2 = start x, start y, end x, end y
void draw_line(int x1, int y1, int x2, int y2)
{
double delta_l = (x2-x1)/(y2-y1);
//delta_l = like graph slope; maybe it's negative and/or not integer
// it can be also type 'float'
double y;
for(int x = x1; x <= x2; x++)
{
y = y1 + ( x * delta_l );
Round_To_Integer(y);
Put_Pixel(x, y, color);
}
}
Run Code Online (Sandbox Code Playgroud)
我的问题是我无法计算汇编中的浮点数(或双精度数).
请帮我把这个C代码"翻译"成ASM.
谢谢.
| 归档时间: |
|
| 查看次数: |
1420 次 |
| 最近记录: |