Click here to Skip to main content
15,891,431 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralService for serial port on Visual C++ 6.0 (Win2K) Pin
ILIA_M20-Feb-05 21:59
ILIA_M20-Feb-05 21:59 
GeneralRe: Service for serial port on Visual C++ 6.0 (Win2K) Pin
Antony M Kancidrowski21-Feb-05 1:09
Antony M Kancidrowski21-Feb-05 1:09 
QuestionThere is a better way to achieve that? Pin
Stephan Poirier20-Feb-05 19:25
Stephan Poirier20-Feb-05 19:25 
AnswerRe: There is a better way to achieve that? Pin
22491720-Feb-05 23:10
22491720-Feb-05 23:10 
AnswerRe: There is a better way to achieve that? Pin
V.21-Feb-05 0:34
professionalV.21-Feb-05 0:34 
GeneralRe: There is a better way to achieve that? Pin
22491721-Feb-05 0:37
22491721-Feb-05 0:37 
GeneralRe: There is a better way to achieve that? Pin
V.21-Feb-05 4:35
professionalV.21-Feb-05 4:35 
AnswerRe: There is a better way to achieve that? Pin
Zdeslav Vojkovic21-Feb-05 5:58
Zdeslav Vojkovic21-Feb-05 5:58 
if you are only concerned about speed, there is no need for the assembly in this case:
<br />
inline void UltraSwap( LONG* a, LONG* b )<br />
{<br />
	LONG x = *a;<br />
	LONG y = *b;<br />
	__asm mov eax, x<br />
	__asm mov ebx, y<br />
	__asm mov x, ebx<br />
	__asm mov y, eax<br />
		<br />
		*a = x;<br />
	*b = y;<br />
}<br />
<br />
inline void UltraSwap2( LONG* a, LONG* b )<br />
{<br />
	LONG t = *b;<br />
	<br />
	*b = *a;<br />
	*a = t;	<br />
}<br />
<br />
inline void UltraSwap3( LONG* a, LONG* b )<br />
{<br />
	*b ^= *a ^= *b ^= *a;<br />
}<br />

of these three methods UltraSwap2 is simplest and fastest (almost twice as UltraSwap) and
UltraSwap3 is approx. same as UltraSwap.
GeneralRe: There is a better way to achieve that? Pin
22491721-Feb-05 16:35
22491721-Feb-05 16:35 
GeneralRe: There is a better way to achieve that? Pin
Stephan Poirier21-Feb-05 19:57
Stephan Poirier21-Feb-05 19:57 
GeneralRe: There is a better way to achieve that? Pin
Zdeslav Vojkovic22-Feb-05 0:36
Zdeslav Vojkovic22-Feb-05 0:36 
GeneralRe: There is a better way to achieve that? Pin
Stephan Poirier21-Feb-05 21:00
Stephan Poirier21-Feb-05 21:00 
GeneralRe: There is a better way to achieve that? Pin
Zdeslav Vojkovic22-Feb-05 2:27
Zdeslav Vojkovic22-Feb-05 2:27 
GeneralRe: There is a better way to achieve that? Pin
Stephan Poirier22-Feb-05 14:47
Stephan Poirier22-Feb-05 14:47 
GeneralRe: There is a better way to achieve that? Pin
Stephan Poirier22-Feb-05 14:56
Stephan Poirier22-Feb-05 14:56 
AnswerRe: There is a better way to achieve that? Pin
Stephan Poirier21-Feb-05 16:18
Stephan Poirier21-Feb-05 16:18 
Questionhow to achieve a secure file system against information leak? Pin
zymoonstone20-Feb-05 19:12
zymoonstone20-Feb-05 19:12 
AnswerRe: how to achieve a secure file system against information leak? Pin
22491721-Feb-05 0:45
22491721-Feb-05 0:45 
GeneralRe: how to achieve a secure file system against information leak? Pin
zymoonstone21-Feb-05 13:54
zymoonstone21-Feb-05 13:54 
QuestionConnected or not? Pin
wasife20-Feb-05 18:58
wasife20-Feb-05 18:58 
AnswerRe: Connected or not? Pin
ThatsAlok20-Feb-05 19:11
ThatsAlok20-Feb-05 19:11 
AnswerRe: Connected or not? Pin
David Crow21-Feb-05 4:10
David Crow21-Feb-05 4:10 
AnswerRe: Connected or not? Pin
Michael Dunn21-Feb-05 6:58
sitebuilderMichael Dunn21-Feb-05 6:58 
GeneralTitle bar Color Pin
Anonymous20-Feb-05 18:54
Anonymous20-Feb-05 18:54 
QuestionHow to fix first four coumns of the List ctrl and all other columns to allow scrolling Pin
sureshpillai20-Feb-05 18:40
sureshpillai20-Feb-05 18:40 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.