Re: std::string-to-int converter
Posted: Fri Jul 10, 2009 9:35 pm
I agree completely!
The Next Generation of 2D Roleplaying Games
http://elysianshadows.com/phpBB3/
I recommend learning Assembly if you haven't already. It's really fun and you really learn a lot about computers.programmerinprogress wrote:yeah me too, i'm very much interested in the low-level stuff as a side-project type thing.eatcomics wrote:Wow you guys, I like seeing this kind of stuff, I'm sick of the C++ "I need code help stuff" I want more low level! && Hardware! Maybe the owners can make a few more dedicated threads wink wink...
some times it's fun to mess around with 1's and 0's
what assembly exactly?Joeyotrevor wrote:I recommend learning Assembly if you haven't already. It's really fun and you really learn a lot about computers.programmerinprogress wrote:yeah me too, i'm very much interested in the low-level stuff as a side-project type thing.eatcomics wrote:Wow you guys, I like seeing this kind of stuff, I'm sick of the C++ "I need code help stuff" I want more low level! && Hardware! Maybe the owners can make a few more dedicated threads wink wink...
some times it's fun to mess around with 1's and 0's
http://www.drpaulcarter.com/pcasm/index.php has a great, free, modern book on Assembly.
Assembly is fun, but it is really a pain in the ass to actually make useful stuff in.
I meant it quite literally;programmerinprogress wrote:It's a second generation programming language, they invented it back in the 60's to cut down on the alarming rate of nervous breakdowns that computer operators were sufferring from by tapping in 1's and 0's all day
But, being serious now, it's a form of programming language which uses mnemonics (aides to the memory) to carry out machine code instructions.
Until assembly came along, you were expected to flick switches on the front panel of your computer terminal, and that was fine for small programs, but as programs grew in size, so did the demand for languages that simplifed the understanding of code, thus assembly was born
In assembly, you spend most of your time either loading or storing numbers from different memory locations (wither registers in your CPU or memory in your computer), and then doing some arithmetic, such as adding, subtraction, multiplying and division, you also do bitwise operations on numbers such as AND, OR, NOT etc, oh and bit shifting.
you have branching statements which are the equivalents to if, else if and else, the way all of the things mentioned above are implemented into the assembler vary depending on the CPU architecture you use, the most straightforward one I've tried is Acorn RISC assembly on an Acorn Archemedies, it had 14 registers to mess around with, and the mnemonics it used were easy to understand, it was also 32-bit, so you could do quite a few operations without the monotomy of having to do several operations for multiplication, because there was a multiplication instruction, which took a few operands at once.
PS: i'm not expert by the way, I've only been introduced to assembly, I believe Gyro is a lot more acquainted with the assembler than me
.Netwatcher wrote:What assembly exactly
...because subtracting 48 is simply too hard to understand :)programmerinprogress wrote:basically, chars can be any value from 0 to 255 (with it being an 8 bit number), each of these numbers represent a different action and/or character.
in ASCII, codes 48 to 57 represent the digits '0' to '9', what you have to do to convert these characters to digits is to turn the value 48 into 0, 49 into 1, 50 into 2 etc [using bitmasks]