|
Anonymous wrote:
ok so how does the assembler do it?
Tables. Big tables. Lots of them.
"We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation."
-- Caius Petronius, Roman Consul, 66 A.D.
|
|
|
|
|
The Assembly is the lowest-level HIL (Human Interface Language) on a computer system above the actual machine code.
What the assembler does is take a piece of assembly code and then rewrite the required process as machine-level instructions. Here is a hands-on example to give you the idea. The instructors written by the assembler are direct commands for the processor. When this command is executed in a program, the processor knows precisely on what it is supposed to do and where.
Consider that you have an assembly language routine called ADD A . On an x86-processor system, this routine causes three types of operations: first, it fetches the contents of A into the local register, called 'battery', or AX. Then, it uses the arithmetic unit to add +1 into this value. Finally, it stores the value back to it's original place.
You can find a list of x86 Assembler commands from here: http://newsite.herbie.is-a-geek.com/Development/Instructions.asp
In order to receive the instruction set of Intel's x86 architecture, you must order a hardcopy from Intel. Here is a direct link to a page with more information: http://www.intel.com/design/pentium4/manuals/245471.htm
As for the thing you asked, what is a logic 1 and a logic 0. This is called a Logic Agreenment, and in 99% of world's systems, they stands for a TTL (Transistor to Transistor Level) logic voltage signals of +5 V and +0 V DC. On a non-TTL system, or in an environment where this agreenment is not set, the logic 1 and logic 0 can mean whatever desired. For example, if you take a common logical sequence of thought, determining whether you should go to the men's room or not, then you might have logical 1 meaning that yes, you should, and logical 0 as no, you should not.
Is this in-depth enough ?
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
like i said
1 is logic 1, on state of the transistor in the microprocessor,ram,dram, etc
0 is logic 0, off state of the transistor ....
now for some reason i dont know why, they made 8bits equal to one byte i.e the building block of most of digital system
thats why 'A' is 0x41 that is 00000100 00000001 binary.
Last time I was sober, man I felt bad
Worst hangover that I ever had
It took six hamburgers and scotch all night
Nicotine for breakfast just to put me right.... Dire Straits
|
|
|
|
|
|
Love Olly and REA?
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
I need to know how is it possible to route jobs to a particular tray in a multi-tray printer programmatically.
Is there any way in which i can select trays in a printer(multi-tray printer), assign the jobs to that tray and print. I need to be able to do this programmatically. For ex. document 1 has to be to assigned to printer 1 tray 1, document 2 to printer 1 tray 2 etc.
Development environment is VC++ 6.0
Thanks
|
|
|
|
|
DEVMODE is your friend.
On multi-input capable printers, the printer driver generally allows you to select the input bin (or tray) on a page by page basis, but most applications don't bother, they just set appropriate values in the DEVMODE structure, and send the whole job there.
One exception is an app like Word, where you might want the first page on any document to come from a tray with say, letter-headed paper, and subsequent pages to come from a tray with continuation paper in it.
Steve S
|
|
|
|
|
Hi
Formerly i installed VC.Net on my computer and now in debug mode i can't go into MFC source code.When i try to make step inside MFC routine ,notice window is appeared - "There is no source code available on this location".This all happens in ATL project. I try to climb in CDialog::Create(...) function which allocated in afxwin1.inl file.This file hold in properly directory $(VCInstallDir)\atlmfc\include.And this path is seted up in
Tools->Options->Projects->VC++ Directories->Sorce Files.But my stupid studio are looking for it in an other dirctory (this directory even not exist on my mashine).
Where is trouble????
Thanks.
|
|
|
|
|
hi, every body.
I have a problem here.
I want to use the structure "CURSORINFO" and API "GetCursorInfo", but the compiler told me that they are undeclared identifer.
I checked about them in MSDN and also found definitions in winuser.h.
But still, it can not be compiled.
My platform is:
Hardware: P4 1.8GHz 512MB
Software: WINDOWS2000 Professional + SP4 Visual C++ 6.0 + SP5
Can anyone give me some information what should I do to make my code compiled ?
Thanks in advance.
|
|
|
|
|
|
dear sir, thanks for your help.
I read the FAQ 2.2 and realize that "I am using a older version header file", it that right ?
Now, what do I suppose to do is to download and install new version of SDK ?
I am puzzled now that I checked the definition of these function and structure in the "winuser.h" and there they are.
And I try to put "#define WINVER 0x0500" in my code, and it can be compiled now. But still, these function and structure do now work the way they should be.
Are there ways that I can use these function and structure without downloading the SDK ? (because if I use the SDK, other programmer will have to use the SDK too in order to compile my code)
Thanks very much for your help.
|
|
|
|
|
oliverlin wrote:
...if I use the SDK, other programmer will have to use the SDK too in order to compile my code
Nothing wrong with that, unless there is a fundamental reason for not using it.
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
Yes, out software environment has been fixed.
Since this was a small part of a large project, a large number of SDK upgrade would have to be done.
-----------------
Today, memory either forgets things when you don't want it to, or remembers things long after they're better forgotten.
|
|
|
|
|
hi ..
i am trying to create an ODBC for database from vc++ application where i specify DSN i want and path for MSSQl
server database (data file *.MDF)
but i keep give me the error message the it "Cannot create data source"
this is the code:
=================
CString mdbpath=(CString)m_EFPATH;
char* szDesc;
int mlen;
szDesc=new char[256];
sprintf(szDesc,"DSN=%s: DESCRIPTION=: FIL=SQL Server: DEFAULTDIR=: DBQ=%s\0",m_EDSN,mdbpath);
mlen = strlen(szDesc);
int numPath=0;
for (int i=0; i
|
|
|
|
|
Two lines of code that are suspect:
sprintf(szDesc,"DSN=%s\0DBQ=%s\0", m_EDSN, mdbpath);
...
if (FALSE == SQLConfigDataSource(NULL, ODBC_ADD_DSN, "SQL Server", szDesc))
If SQLConfigDataSource() returns FALSE, what does SQLInstallerError() return?
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
|
Odd, as the docs indicate it should be one of eight ODBC_ERROR_xxx error codes.
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
Hi!
Is there a command that works like sprintf, but it is like strcat? Because I will catenate (probably wrong spelling) some hex numbers to the same char value.
Have a nice day,
Stefan
|
|
|
|
|
You can just use sprintf like this:
char buffer[1024];
char * tmp;
tmp = buffer;
tmp += sprintf(tmp, "Line %d\r\n", 1);
tmp += sprintf(tmp, "Line %d\r\n", 2);
tmp += sprintf(tmp, "Line %d\r\n", 3);
Another, and better, solution is to use a strstream:
strstream out;
out<<"Line "<<1<<endl;
out<<"Line "<<2<<endl;
out<<"Line "<<3<<endl;
"After all it's just text at the end of the day. - Colin Davies
"For example, when a VB programmer comes to my house, they may say 'does your pool need cleaning, sir ?' " - Christian Graus
|
|
|
|
|
If you use fixed number of hex numbers, use:
<br />
sprintf("%c%x%x", 'c', 0x544, 0xbff)<br />
or if you use variable number:
<br />
ostrstream os;<br />
os << 'c' << hex << 0x544 << 0xbff << ....<br />
and the char* string you obtain by os.str()
Robert-Antonio
"I launched Norton Commander and saw, drive C: on the left, drive C: on the right...Damn, why I need two drives C:???So I formatted one..."
|
|
|
|
|
Here's a somewhat cheesy example:
char szBuffer[128];
for (int x = 0, num = 1; x < 10; x += 2)
{
sprintf(&szBuffer[x], "%02x", num);
num *= 2;
}
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
or even another choice:
CString S;
for ( int x = 0, num = 1; x < 10, x += 2 )
{
S.AppendFormat( _T("%02x"), num );
num *= 2;
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<A HREF="http://www.santacruznetworks.com">Santa Cruz Networks</A>
|
|
|
|
|
hi,
i am using gdi+ in VC++ 6.0. i want to know how can i use Bitmap::FromStream ? it need to pass a Stream pointer. i have a bitmap array already. but, how can i turn it into such a stream?
any help?
thanks!
jim
|
|
|
|
|
|
i want to get jpeg data stream from a valid HBITMAP and transfer it through network. I can do this by first creating a jpg file and then reading the data from the file and at last sending it out,but it is not effective,so is there a more effective solution?(i don't want to get into the complexity of jpeglib)
(English is not my native language,sorry for my bad English)
|
|
|
|
|