|
-
Apr 5th, 2000, 09:09 PM
#1
Thread Starter
Frenzied Member
I'm trying to write an ActiveX controll that will let you increase the speed of VB for simple operations, for example say you wanted to do 50,00 simple calculations on a byte array (If you wanted to do nonlinear transformatins on a bitmap for example, this would let you write the code to do your calculations in the controls property page and then the controll would compile this into assembler, and hopefully speed up your code, it would also let you enter mathematical equations and do them at run time.
My plan involves declaring a large byte array to hold the code, writing the assembler into that with a set interface with four long parameters as pointers to any neccacerry data
eg a pointer to the input parameters, a pointer to the space allocated for the return value, a pointer to the start point and a pointer to something else, then call this using
Code:
CallWindowProc VarPtr(bytProgram(0)), VarPtr(uParamInfo), lngStartLine , VarPtr(dblReturnValue), lngOtherParameter
which would call the code in my byte array It works if I copy a VB function into a byte array using copy memory and the addressof operator.
The trouble is I've never used PC assembler, only PIC assembler( and not too much of that) and don't know how possible it is to make this Idea work.
So I need answers to the following questions
1 Is Assembler processor specific, eg if I've got an Intel Pentium III and I write the assembler so It runs on My machine will it still run on someone elses machine using a different processor?
2 If not how many different assembley languages will I have to learn, it it easy to translate between them, eg can I write the code for a pentium III and have a function that says, the user is using a Pentium Pro so where sam's got command XXAA change this to YYAA.
3 How easy it it to get at the windows memory, can I just use App.hInstace + VarPtr(uSomeMemory) as an address or is there some wierd stuff to get through.
4 Is windows going to object to me writing this and decide I'm a hacker or a virus.
If anyone's tried something similar to this or has used assembler with windows Please help, I really like this Idea but want to know if I can get it off the ground.
-
Apr 5th, 2000, 11:40 PM
#2
Member
All processors in the X86 and pentium series, are upward compatible. This means software written in assembly for 286 would still run on a Pentium III. The mnemonic codes used in 286 are still the same. When a newer processor was developed, It kept the same mnemonics and added new ones. But the newer mnemonics in the higher processor are not downward compatible.
So you have decide how low of a processor you want to go and write assembly using mnemonic codes used by that processor. It is always an advantage to select a highest processor. For example, If you are working with 32 bit numbers,like dividing, and you limited yourself to XT processor mnemonics, you will have do writen a whole routine (hundreds of mnemonic codes) to do this operation. Where as, a 486 processor has a single mnemonic code to do the operation in less time. So keep this in mind.
Hope this answers some of your questions.
-
Apr 5th, 2000, 11:52 PM
#3
Thread Starter
Frenzied Member
Thanks, that means it's probably quite possible, When you say the mnemnomic codes are compatible do you mean the actual values, or just the Memnomics, I won't be able to use memnomics I'll have to set the bit values directly.
Do you know where I could find some info on how to start?
-
Apr 6th, 2000, 09:09 PM
#4
Member
Sorry for the late reply.
The mnemonics codes and the numeric values would be all upward compatible. As for finding where to start, use your search engine for ASM and other keywords. I have zero experience programming in machine language with PC's, only with Motorala base microprocessors.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|