Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

Assembler optimalisation - how to avoid a jump? (Developers)

posted by Laaca(R) Homepage, Czech republic, 13.05.2012, 20:38

I write some kind of RLE sprite routine with clipping.
I would like to write nice code. I know I could somehow remove the ugly jump "jnc @RLE_CLIP_MOVE_CONT" but I don't know how.

In EDX is length of displayable scanline (computed by clipping routine)
In ECX is number of pixels which could be copyied. It is always>0
After clipping I sometimes can't copy all ECX bytes but only EDX bytes.
That it what this code does.

sub edx,ecx

add ecx,edx

shr ecx,1;rep movsd;adc ecx,ecx;rep movsw {fast 32bit write}

cmp edx,0



Complete thread:

Back to the forum
Board view  Mix view
15296 Postings in 1378 Threads, 254 registered users, 19 users online (0 registered, 19 guests)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum