flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
revolution 11 Mar 2013, 20:19
Perhaps Bresenham's line algorithm would be better for the task?
|
|||
![]() |
|
wyvern 11 Mar 2013, 20:31
Hi revolution:
Is not exactly a "task", i want to learn from the basis, sure later i will try the Bresenham's algorithm. But this is mi first attempt to draw a line and i want to make it work. |
|||
![]() |
|
f0dder 11 Mar 2013, 21:15
revolution wrote: Perhaps Bresenham's line algorithm would be better for the task? Some years ago I bumped into an article claiming that DDA is actually faster than Bresenham on modern CPUs - don't have a link handy, but it might be worth looking into. _________________ carpe noctem |
|||
![]() |
|
freecrac 11 Mar 2013, 21:46
I loose the focus mixing integer addresses with floating point values on the stack of the program.
; [bp + 4] = offset of x1 ; [bp + 6] = offset of y1 ; [bp + 8] = offset of x2 ; [bp + 10] = offset of y2 Maybe we can simplify the situation if the delivery of the parameter uses named locations instead of involving the stack of the program? (I think a floating-point-arithmetic for to calculate integer addresses is not the simplest way.) Dirk |
|||
![]() |
|
baldr 11 Mar 2013, 22:54
freecrac wrote: I think a floating-point-arithmetic for to calculate integer addresses is not the simplest way. And yes, that's amazing why someone do prefer to use direct [bp+xx] references instead of equs or some macros (LocoDelAssembly or Benjamin). |
|||
![]() |
|
bitshifter 15 Mar 2013, 03:04
some more info about lines in this thread:
http://board.flatassembler.net/topic.php?p=118603#118603 |
|||
![]() |
|
SeproMan 18 Mar 2013, 16:42
wyvern,
Seems nobody actually looked at your code! What happens in 'drawPixel' is unknown but I suppose you know if it is OK... Here are some hints for the code you've submitted: Code: fild dword [bp - 2] ;st0=x It's not a dword at this location! Code: mov si, word [bp + 8] ; fsubr dword [si] ;x-x1 This addresses X2! Code: ret 10 Should be 'ret 8' _________________ Real Address Mode. |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.