Click here to Skip to main content
15,890,947 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Inline assembly - what good is it? Pin
geo_m2-Dec-04 4:29
geo_m2-Dec-04 4:29 
GeneralRe: Inline assembly - what good is it? Pin
BlackDice2-Dec-04 4:51
BlackDice2-Dec-04 4:51 
AnswerRe: Inline assembly - what good is it? Pin
John R. Shaw2-Dec-04 4:52
John R. Shaw2-Dec-04 4:52 
GeneralRe: Inline assembly - what good is it? Pin
BlackDice2-Dec-04 4:57
BlackDice2-Dec-04 4:57 
AnswerRe: Inline assembly - what good is it? Pin
Henry miller2-Dec-04 9:07
Henry miller2-Dec-04 9:07 
GeneralRe: Inline assembly - what good is it? Pin
BlackDice2-Dec-04 10:46
BlackDice2-Dec-04 10:46 
AnswerRe: Inline assembly - what good is it? Pin
Harold Bamford3-Dec-04 6:06
Harold Bamford3-Dec-04 6:06 
AnswerRe: Inline assembly - what good is it? Pin
Harold Bamford3-Dec-04 6:20
Harold Bamford3-Dec-04 6:20 
You should be aware that this is a religious subject; people of one faith will ignore all arguments from heretics. And converts tend to be evangelistic! Smile | :)

IMHO, unless you need to do low-level hardware access or are in an extremely tight loop, assembly code should never be seen. And if it is, it should be heavily commented. Remember, the vast majority of the life-cycle of a piece of software is in the maintenance phase, not development -- assuming it is a successful program! And assembly is harder to read and hard to port. Even when porting from one compiler to another for the same target processor, porting can be awkward as different compilers have different assembly escapes, stack conventions, internal symbol representations, etc.

Further, modern compilers are smart. Even things like x <<=1; instead of the more readable x *= 2; don't buy you anything as the compiler understands what *= 2 means and will find the best way to accomplish this.

If you really are concerned about optimization in a tight loop, then optimize your algorithm (always your best bang for the buck) and adjust variables such that a minimum of assembly-level conversions are needed. For instance, use the machine's natural size integer (usually int) instead of a short. If the compiler cannot determine the absolute maximum value and the processor doesn't handle shorts as easily as ints, then a low-level conversion might be needed. Try peeking at the generated assembly. And heavily comment such tweaks!
GeneralAPI constants value Pin
wk_vigorous2-Dec-04 2:18
wk_vigorous2-Dec-04 2:18 
GeneralRe: API constants value Pin
BlackDice2-Dec-04 2:33
BlackDice2-Dec-04 2:33 
Questionhide one property page?? Pin
includeh102-Dec-04 2:11
includeh102-Dec-04 2:11 
AnswerRe: hide one property page?? Pin
JoramW2-Dec-04 2:49
JoramW2-Dec-04 2:49 
GeneralRe: hide one property page?? Pin
includeh102-Dec-04 5:02
includeh102-Dec-04 5:02 
GeneralRe: hide one property page?? Pin
JoramW2-Dec-04 22:52
JoramW2-Dec-04 22:52 
Questionhow to know Service pack of MSVC6.0 Pin
Abhi Lahare2-Dec-04 1:58
Abhi Lahare2-Dec-04 1:58 
AnswerRe: how to know Service pack of MSVC6.0 Pin
David Crow2-Dec-04 4:05
David Crow2-Dec-04 4:05 
GeneralRe: how to know Service pack of MSVC6.0 Pin
david_gilmour2-Dec-04 22:22
david_gilmour2-Dec-04 22:22 
GeneralRe: how to know Service pack of MSVC6.0 Pin
David Crow3-Dec-04 2:50
David Crow3-Dec-04 2:50 
QuestionAVIFile file size restriction? Pin
JoramW2-Dec-04 1:26
JoramW2-Dec-04 1:26 
GeneralHELP Immediately !! Very important!! Pin
angello62-Dec-04 1:21
angello62-Dec-04 1:21 
GeneralMultiple column combo box Pin
ledallam1-Dec-04 23:46
ledallam1-Dec-04 23:46 
GeneralLaunching Notepad to open a specific file Pin
Anonymous1-Dec-04 22:56
Anonymous1-Dec-04 22:56 
GeneralRe: Launching Notepad to open a specific file Pin
vaniacilli1-Dec-04 23:05
vaniacilli1-Dec-04 23:05 
GeneralRe: Launching Notepad to open a specific file Pin
ThatsAlok1-Dec-04 23:09
ThatsAlok1-Dec-04 23:09 
GeneralRe: Launching Notepad to open a specific file Pin
Arsalan Malik1-Dec-04 23:17
Arsalan Malik1-Dec-04 23:17 

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.