flat assembler
Message board for the users of flat assembler.

Index > DOS > Hey, i'm back, 320X200 MODE STUFF?, use them with care! :)

Goto page Previous  1, 2
Author
Thread Post new topic Reply to topic
edfed



Joined: 20 Feb 2006
Posts: 4240
Location: 2018
edfed
i never use stosb cause the u and v pipelines can exetute "mov [es:edi],al"
and "inc edi " on the same clock
if [es:edi] is a graphic buffer in cache then the sequence use only 1 cycle

i have writen stosb to make the shortest possible in term of instructions

so now:
Code:
putpxl:
  mov edi,[x.resolution]
  imul edi,[y]
  add edi,[x]
  mov [es:edi],al
  ret
    

Code:
putpxls:
  mov edi,[x.resolution]
  imul edi,[y]
  add edi,[x]
  mov ecx,[count]
@@:
  inc edi
  xor [delta],320  
; xor [delta],edi!
  mov [es:edi],al
  add edi,[delta]
;the best is to integrate putpxl inside the function
;the init pxl is in the init of function
;and the loop of function will access screen
;with only one instruction 
;the delta is a conbinaison of X and Y delta
;delta is a 2D vector!!!
;so you can move pxl as you want
;and with a delta string, it can make some maths functions
;a vertical line is vector delta=320 or -320
;an horizontal line is delta=1 or -1
; etc etc...
  loop @b
  ret
    


the best is to never use putpixel


Last edited by edfed on 14 Oct 2007, 02:00; edited 1 time in total
Post 09 Oct 2007, 16:36
View user's profile Send private message Visit poster's website Reply with quote
rugxulo



Joined: 09 Aug 2005
Posts: 2341
Location: Usono (aka, USA)
rugxulo
But where's the inc in that code? Razz
Post 13 Oct 2007, 21:22
View user's profile Send private message Visit poster's website Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4240
Location: 2018
edfed
sorry i've forget it

but in fact??!
a put pixel function don't need any inc !
if it inc, then it's an horizontal line loop Smile
Post 14 Oct 2007, 02:12
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page Previous  1, 2

< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on YouTube, Twitter.

Website powered by rwasa.