Date: Wed, 1 Aug 2001 11:56:06 +0300 (IDT) From: Eli Zaretskii X-Sender: eliz AT is To: "Rafal Maj (Raf256)" cc: djgpp AT delorie DOT com Subject: Re: Assembler In-Reply-To: <9k7jsa$l5l$1@info.cyf-kr.edu.pl> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Wed, 1 Aug 2001, Rafal Maj (Raf256) wrote: > I have found quite interesting code, that returns exacly number of CPU > cycles since last reset/power off. > > But I have this "program" writtne in Pascal, how can I translate this into > C++ DJGPP inlie asembler ? > 1) Can I write assembler instructions anywhere inside C++ code in DJGPP ? Yes, you can use inline assembly; it's documented in the GCC manual. > 2) How can I wrtie\compile in RHIDE assembler files (any tutuorial ?) No need for any tutorials, just compile them as usual. GCC already knows what to do. > 3) Ther are two diffrent syntaxes of ASM AFAIK, with ist best, what are they > names ? See chapter 17 of the FAQ. > 4) AFAIR assembler can be written using functions for calling interrupts, > using > inline($AA/...) statment or in real assebler syntax... I'm most interested > in 3rd > possibility... I have no clue what you are talking about here. > "e" - is a hmm... pointer to 64-bit integer > 0fh is 0x0F in Pascal > asm > db 0fh, 31h > db 66h > mov c, dx > db 66h > mov e, ax > end; 0F31h is the opcode of the RDTSC instruction. So there's nothing exciting about this code, a couple of programs that use RDTSC were posted here recently, perhaps in this very thread.