Gamingforce Interactive Forums
Day 4 - 21 days until Christmas

Go Back   Gamingforce Interactive Forums > Gamingforce Computing > OS and Software
Register FAQ GFWiki Members List Donate Arcade ChocoJournal Mark Forums Read

Welcome to the Gamingforce Interactive Forums.
GFF is a community of gaming and music enthusiasts. We have a team of dedicated moderators, constant member-organized activities, and plenty of custom features, including our unique journal system. If this is your first visit, be sure to check out the FAQ or our GFWiki. You will have to register before you can post. Membership is completely free (and gets rid of the pesky advertisement unit underneath this message).


C/C++
Reply
 
LinkBack Thread Tools
Unavailable


Member 5

Level 43.64

Feb 2006


Reply With Quote
Old Mar 6, 2006, 11:11 PM Local time: Mar 7, 2006, 12:11 PM #26 (permalink) of 58
Originally Posted by www.sega.co.jp
How much harder is it to program in assemly than it is in C/C++?
Check out the (very simple) multiplayer (via serial port) pacman game I had to write for a module last semester, and see for yourself.

http://www.bigblah.net/upload/wspg.asm

[ Sergei Karkov ]
Good Chocobo


Member 492

Level 15.73

Mar 2006


Reply With Quote
Old Mar 6, 2006, 11:24 PM #27 (permalink) of 58
Originally Posted by Arainach
On C# - I'm no expert (I've just been learning it for a couple of weeks myself), but the entire point of C# is that it's strongly typed and prevents a lot of low-level activities that C and C++ allowed to that end. MS calls it a "security feature"; the rest of us call it "a pain in the ass".

Isn't the whole point of high-level languages that you let the compiler generate all the Assembly? What's the point of using low-level code in the middle of C/C++?
TREAT?!?


Member 12

Level 35.63

Feb 2006


Reply With Quote
Old Mar 6, 2006, 11:37 PM Local time: Mar 6, 2006, 09:37 PM #28 (permalink) of 58
Optimization, it is an incredibly common thing to have C code call external functions written in asm.
oh shi-


Member 445

Level 23.83

Mar 2006


Reply With Quote
Old Mar 6, 2006, 11:50 PM Local time: Mar 6, 2006, 08:50 PM #29 (permalink) of 58
Originally Posted by Magic
Isn't the whole point of high-level languages that you let the compiler generate all the Assembly? What's the point of using low-level code in the middle of C/C++?
Because even some of the best compilers do things you don't want it to. They do make mistakes fairly often and the only way to resolve the issue is to edit the generated assembly by hand.
Sensors indicate an Ancient Civilization


Member 1200

Level 26.92

Mar 2006


Reply With Quote
Old Mar 7, 2006, 12:21 AM #30 (permalink) of 58
Originally Posted by Magic
Isn't the whole point of high-level languages that you let the compiler generate all the Assembly? What's the point of using low-level code in the middle of C/C++?
By "low-level" I refer even to thing like Pointers - to even use the damned things you must compile your code with the "unsafe" option. A fundamental concept to be sure, and not all that low-level, but one that C# doesn't like.

http://www.c-sharpcorner.com/Code/20...UnsafeCode.asp
Logic Implosion


Member 1892

Level 7.28

Mar 2006


Reply With Quote
Old Mar 7, 2006, 03:01 PM #31 (permalink) of 58
Argh. I sorry. I didn't mean best API... Ew. That was a rather sad mistake. Er... Best IDE. This is why acronyms are evil. I like VS's interface, not the library. Sorry for the misunderstanding. :/
Sensors indicate an Ancient Civilization


Member 1200

Level 26.92

Mar 2006


Reply With Quote
Old Mar 7, 2006, 03:06 PM #32 (permalink) of 58
The VS IDE is.... OK. Still can't touch vim+make in my book. Or Eclipse if you truly need an honest-to-god IDE.
TREAT?!?


Member 12

Level 35.63

Feb 2006


Reply With Quote
Old Mar 7, 2006, 09:04 PM Local time: Mar 7, 2006, 07:04 PM #33 (permalink) of 58
But vim+make isn't an IDE, so that doesn't really count.

Eclipse came out near the end of my college career, so I didn't really get into it, being set in my ways, but a few of my student teachers turned me on to it. Had I stuck with programming and Java, I would have made the switch to it eventually.
and Brandy does her best to understand
Maid Guy~


Member 188

Level 12.47

Mar 2006


Reply With Quote
Old Mar 8, 2006, 01:19 PM Local time: Mar 8, 2006, 08:19 AM #34 (permalink) of 58
I've had some time with C and C++ last semester, and now dealing with assembly this semester. It's more of a bitch to do things that would be considered "simple" in C/C++ in assembly. What could take like 3-4 lines of code in C/C++ would take 2-3 times more (occassionally even more) code in assembly.

But then again, if you saw Blah's example, you'd now this by now.

Oh yeah, forgot to mention the original post. I've compiled C/C++ programs (although all were run in a DOS window) and they worked fine in Windows XP.
Chinese Zodiac: ox. Zodiac: Leo.


Member 795

Level 2.25

Mar 2006


Reply With Quote
Old Mar 9, 2006, 09:29 PM Local time: Mar 10, 2006, 10:29 AM #35 (permalink) of 58
Using assembly you can make a program run faster than using program written in C/C++. Especially local variables, which can be removed, by using only registers (which cannot be accessed in high level language).

Most basic functions in C/C++ are written in assembly for the purpose of speed like the function strcpy, strlen. Which are written in assembly (as of the libraries of VC++). In tracing the function, you will see assembly immediately.

There are some software that fit using assembly, like hardware communication. Which includes software driver, etc. and some program that are fit using high level like C/C++, business software since maintenance is also part of the cost of developing software.
Linux: Linux Is Not UNix. Windows is Blind. Solaris is hit by solar radiation. Opera browser is to operate browser.
Sensors indicate an Ancient Civilization


Member 1200

Level 26.92

Mar 2006


Reply With Quote
Old Mar 9, 2006, 10:43 PM #36 (permalink) of 58
Nowadays, when CPU time is cheap and coding time isn't, writing assembly is just plain stupid. Your code isn't portable, is more painful to debug and read, and the speed benefit is very negligible.
TREAT?!?


Member 12

Level 35.63

Feb 2006


Reply With Quote
Old Mar 10, 2006, 12:08 AM Local time: Mar 9, 2006, 10:08 PM #37 (permalink) of 58
There are many applications where any improvement is worth it. Consider a program which is run billions of time every day versus the time it takes to code a function once.
and Brandy does her best to understand
Chinese Zodiac: ox. Zodiac: Leo.


Member 795

Level 2.25

Mar 2006


Reply With Quote
Old Mar 10, 2006, 02:16 AM Local time: Mar 10, 2006, 03:16 PM #38 (permalink) of 58
Operating system and system software like anti-virus and firewall must be written in such low level so that they will execute much quicker.

As the computer grows faster, we users install and use more software. And programmers tend to use the potential of the faster computer (Game is a good example).(I think it’s proportional: more speed = more software = more memory usage .)

Even using such low-level or high level, if the algorithm of the software is slow, any implementation will not make it faster.
Linux: Linux Is Not UNix. Windows is Blind. Solaris is hit by solar radiation. Opera browser is to operate browser.
NOT AVAILABLE


Member 1641

Level 10.58

Mar 2006


Reply With Quote
Old Mar 19, 2006, 09:19 PM #39 (permalink) of 58
Originally Posted by Arainach
Nowadays, when CPU time is cheap and coding time isn't, writing assembly is just plain stupid. Your code isn't portable, is more painful to debug and read, and the speed benefit is very negligible.
Isn't it stupid when one pays about 2x the price of a processor for a faster model, then happily wastes CPU cycles because the software isn't properly optimized?
ASM, used wisely, is used to optimize concrete areas of an application, not to develop entire applications (that's just overkill, and one could end up reinventing the square wheel if not careful).
As for portability, it's ok when an application is portable between OSes, but most times you aren't going outta the x86 architecture so it's not much of a deal.

Last edited by Tek2000 : Mar 19, 2006 at 09:24 PM.
oh shi-


Member 445

Level 23.83

Mar 2006


Reply With Quote
Old Mar 19, 2006, 09:46 PM Local time: Mar 19, 2006, 06:46 PM #40 (permalink) of 58
Originally Posted by BlueMikey
There are many applications where any improvement is worth it. Consider a program which is run billions of time every day versus the time it takes to code a function once.
Exactly. When you have a program where 1% of your code accounts for 50% of your runtime (which is VERY common) then why the hell would you not recode that 1% in Assembly?
I expected someone like you. What did you expect?


Member 2001

Level 17.98

Mar 2006


Reply With Quote
Old Mar 21, 2006, 12:01 AM #41 (permalink) of 58
Originally Posted by Arainach
Nowadays, when CPU time is cheap and coding time isn't, writing assembly is just plain stupid. Your code isn't portable, is more painful to debug and read, and the speed benefit is very negligible.
And this is precisely why it takes 256MB of RAM and a 700+Mhz CPU to run a spreadsheet today. When spreadsheets did the same shit on a 486. The same reason why an itty-bitty VB database frontend takes 30MB of RAM to run a simple query.
"The avalanche has already started. It is too late for the pebbles to vote."
NOT AVAILABLE


Member 1641

Level 10.58

Mar 2006


Reply With Quote
Old Mar 21, 2006, 07:02 PM #42 (permalink) of 58
Usually, such high requirements aren't due to high language coding but because of inadequate data structures and/or bloatware.
Sensors indicate an Ancient Civilization


Member 1200

Level 26.92

Mar 2006


Reply With Quote
Old Mar 21, 2006, 09:28 PM #43 (permalink) of 58
Originally Posted by PUG1911
And this is precisely why it takes 256MB of RAM and a 700+Mhz CPU to run a spreadsheet today. When spreadsheets did the same shit on a 486. The same reason why an itty-bitty VB database frontend takes 30MB of RAM to run a simple query.
First off, x86 hit your complaints on the head.

Second, who DOESN'T have 256MB of RAM and 700Mhz? I have 6 machines meeting those qualifications in my house (0 that don't), a stack of 550-700Mhz Pentium III chips sitting on my desk that I have nothing to do with, and a bag of 128MB PC100 and PC133 RAM sticks that I have nothing to do with. You can find better hardware at Goodwill.

And I guess "Third" would be stop using MS Office 2003. I've ran OpenOffice 2.0 on Pentium-75s with 128MB of RAM.
Logic Implosion


Member 1892

Level 7.28

Mar 2006


Reply With Quote
Old Mar 21, 2006, 11:30 PM #44 (permalink) of 58
Even though ASM is useful in cases, I'd much rather avoid it when possible. Just let the compiler do its job.

Personally, I dig Python a lot more than C/C++, and Python is an interpretted language, so it's even slower than C. But really, it makes up for the slowness with awesome. I'm sure some of you hate it because it doesn't have strict variable typing and indentation rules and whatnot, but I love it. The library, the simplicity, the forced convention of spacing, generator functions, lists, tuples, dictionaries, not having to use confusing templates... <3.
Chinese Zodiac: ox. Zodiac: Leo.


Member 795

Level 2.25

Mar 2006


Reply With Quote
Old Mar 22, 2006, 03:37 AM Local time: Mar 22, 2006, 04:37 PM #45 (permalink) of 58
Even I am using Java, which I considered the slowest language that I have used, since it is both compiled and interpretted.

More program especially business program doesn't need to run very efficient that it must be written in assembly. It's the logic and algorithm that count. Even you use assembly but the logic takes n * n to finish(I don't know how to write n square). It will be defeated by a logic that takes log n, n or even n * log n written in latest language.

Programmers tends to choose language which they can work/compatible with so that they can create software much faster.

The compilers are also being develop/upgrade so that it can be more efficient and have more options to give.
Linux: Linux Is Not UNix. Windows is Blind. Solaris is hit by solar radiation. Opera browser is to operate browser.

Last edited by vincent_ray21 : Mar 23, 2006 at 12:21 AM.
Sensors indicate an Ancient Civilization


Member 1200

Level 26.92

Mar 2006


Reply With Quote
Old Mar 22, 2006, 09:28 AM #46 (permalink) of 58
The main