RE: Assembly as a first language? 02-27-2017, 07:05 AM
You *could* do it, but like other posters have said, assembly is way harder than most anything else.
Maybe if you are a masochist and want to do it learn C first to give you a baseline. Then use something like Visual C++ in Visual Studio to write inline assembly.
Inline assembly is way easier to get your head around than straight assembly. Leastways that's how I'm doing it.
(This post was last modified: 02-27-2017, 07:28 AM by PhargedPhreak.)
RE: Assembly as a first language? 02-27-2017, 07:39 AM
Okay so here's an example I just cribbed from Uncle Google:
Spin up Visual c++, create a console project and cut and paste the following code in. Then you can put breakpoints in it and step through it to see what it's doing.
(Puts on flame jacket - yeah I know it's lame as fuck but it's an example of how a total beginner could do it...)
Following code will *work*....
int power2(int num, int power);
printf_s("3 times 2 to the power of 5 is %d\n", \
int power2(int num, int power)
mov eax, num; Get first argument
mov ecx, power; Get second argument
shl eax, cl; EAX = EAX * (2 to the power of CL)
// Return with result in EAX
RE: Assembly as a first language? 02-27-2017, 08:05 AM
Here's another example. I've been playing with it the last thirty minutes.
This one takes an integer input, adds 5 to it and then returns it back to the calling c...
int subtr(int num)
mov eax, num
sub eax, 5
mov z, eax
int _tmain(int argc, _TCHAR* argv)
int num = 0;
num = subtr(5);
RE: Assembly as a first language? 02-27-2017, 03:48 PM
If someone learned Assembly without any previous programming experience... I would be amazed
Though I don't think its impossible, it'd take a lot of time and by the time you learned... you'd be bald. xD
-= I'm just surprised. But no, I'm not scared. I'm from Rio.
If you like what I post, +rep would be appreciated!
RE: Assembly as a first language? 02-27-2017, 06:04 PM
Straight assembly is tough. Not impossible as a staring language, but id reccomend something Object C based.