Xref: news2.mv.net comp.os.msdos.djgpp:1659 From: a920101 AT zipi DOT fi DOT upm DOT es Newsgroups: comp.os.msdos.djgpp Subject: ASM code & Random Date: 5 Mar 96 16:48:31 +0100 Organization: Facultad de Informatica - (UPM) Lines: 40 Message-ID: <1996Mar5.164831@zipi.fi.upm.es> NNTP-Posting-Host: zipi.fi.upm.es To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Hello everybody! Can you please take a look at this code and tell me if it can be done faster??? I use it to copy a 'virtual screen' to the VGA in my game, but it is too slow... If this can't be done faster, i will have to use some kind of tweaked mode with 2 pages and do page-flipping using VGA hardware... but i have no time now to get into it! This is the code: asm(" pushw %es pushl %edi pushl %esi pushl %ecx movl $0xa0000,%edi movl _virt,%esi # virt declared somewhere movl $32000,%ecx movw _dos_seg,%es COPY: movsw dec %ecx jnz COPY popl %ecx popl %esi popl %edi popw %es ") Wait! One more thing (*stupid thing*) How can i get a random int from zero to a fixed value??? I don't know how to use the random functions in DJGPP! They talk about MAXINT, but i do not know what is that! Thanks in advance. Juanje.