Guidance
指路人
g.yi.org
software / rapidq / Examples / ASM / rqasm / readme.txt

Register 
注册
Search 搜索
首页 
Home Home
Software
Upload

  
Any ideas? suggestions? questions? E-mail me at evilone@omen.ru

This program demonstrates how to insert compiled assembler
code into your programs for faster execution. The example
program calculates sum of 10000 vectors - one version uses
assembler subprogram, another one is written in pure Rapid-Q.
Run them and notice the difference in speed. On my computer,
resolution of GetTickCount function is sometimes not enough
to measure elapsed time for the assembler version!

The assembler routine is written in Netwide Assembler (aka
NAsm, http://www.cryogen.com/Nasm). In case you don't have
it and don't want to download it, I have included the compiled
version of the code, so both demos only need Rapid-Q to
compile.

There are some limitations though. First of all, you can't
access global variables. Second, you can't define non-local
data storage - well you can, but you simply won't be able
to access it; if you need to store some data between calls,
you'll have to allocate memory for this in your Rapid-Q
program and then pass it to assembler routine each time
you call it. I didn't check far jumps and calls, so I can't
say if they work or not; but even if they don't, one could
write a more sophisticated loading routine that'd correct
all the addresses in the file.

Anyhow, this method can be helpful if you want to write
something fast, with heavy math calculations and such, in
Rapid-Q...
掌柜推荐
 
 
 
 
 
 
 
 
 
 
 
 
© Mon 2023-2-6  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0 Last modified:2001-08-06 16:59:58