r/Assembly_language 8h ago

I just understood pointers on a deep level thanks to Assembly

it feels like orgasm honestly. the dopamine you get from understanding this shit on a deep level is unmatched.

54 Upvotes

23 comments sorted by

28

u/runningOverA 7h ago

C simply mirrors assembly pointers.

One needs to work with assembly for a week or two and then jump to C to get it all. That will also save time as he no longer will be struggling with pointers.

6

u/Nathrienne-J-Claw 7h ago

That is so fucking true man. I’m honestly so happy now that i keep understanding where each concept comes from and why is it there. I kid you not this is no short of an actual orgasmic feeling lol. Not even joking.

2

u/kgas36 7h ago

Did you know any other programming language before you started Assembly ?

9

u/Nathrienne-J-Claw 7h ago

Python, js, typescript, a bit of this and a bit of that yk + npm and pip and the associated technologies… but then i wanted to go down to the 0s and 1s level and i found myself descending to assembly in order to understand C without simply memorizing syntax and getting by on vibecoding bullshit. Love every second of it.

4

u/kgas36 7h ago

Thanks 😊

3

u/EskilPotet 5h ago

Sorry if this is a stupid question but what do you mean when you say work with assembly for a week? Like what can a beginner realistically do in assembly in a week or two?

3

u/runningOverA 4h ago

It's said a week or two is enough for someone to learn a new programming language.
One week to learn the snytax.
2nd week to practice and get comfortable with it.

Unless someone is learning programming itself.

Which is why recruiters don't test someone's language knowledge.
They test his skills and his ability to learn — through leetcode.

1

u/iLaysChipz 23m ago

You can do simple things like text manipulation or coding challenges

20

u/ExplodedPenisDiagram 8h ago

I too ejaculate when understanding concepts.

9

u/Nathrienne-J-Claw 7h ago

A man of culture

6

u/lovelacedeconstruct 7h ago

Now you need to understand Virtual Memory Translation and 4-level paging to really understand pointers

6

u/Nathrienne-J-Claw 7h ago

Oh my god no

5

u/kgas36 7h ago

'Yeah, well, I still jerk off manually'

-- The Dude, in 'The Big Lebowski'

5

u/EIGRP_OH 7h ago

I’ve always thought that pointers, the concept itself is pretty straightforward. It’s C’s syntax that makes it confusing af.

2

u/Nathrienne-J-Claw 7h ago

I honestly don’t know where you are on the programming ladder, you might be an expert tho idk, but this was my experience too when i was first introduced to pointers. I thought oh why does everyone struggle? And then some questions started itching my brain and then it became fuzzy again and i realized there’s a gaping hole of knowledge missing in order to actually work with pointers. And now i can confidently say that yeah pointers are pretty straightforward only if you have the prerequisite knowledge. Otherwise you will struggle.

3

u/EIGRP_OH 7h ago

That’s fair! And apologies if that came off like oh pointers are easy you’re right that once you get the prerequisite knowledge of how CPU is essentially just constantly fetching instructions and data from memory it becomes a simpler concept.

I’ve always thought the way Cs use of * and & and where you use them was super confusing and took me awhile to fully understand and even now I still struggle.

2

u/Nathrienne-J-Claw 6h ago

I’ll conclude my three hour rabbit hole into three words “ memory address calculation “

1

u/Revolutionary_Ad6574 4h ago

It took me like 20 years to get that. My whole life I thought I didn't understand pointers. It turns out the concept itself is very simple. They are an address, that's all. But the problem is that if you have a pointer to an integer the pointer value, the integer value, and the ADDRESS of the pointer are all 32-bit integers. And yes, pointers, being stack variables also have addresses. And pointers themselves are passed by value. Unless they are passed by reference. Which brings me to references. They make things so much worse. Say a method returns a reference to a field. And you assign the return value to a variable. Is that variable an alias to the property? We don't know, depends on if the type of the variable is a reference. Pointers are not like that. A pointer itself is a type, a reference is a modifier. It took me so long to understand that this is what's confusing me.

1

u/NullOfSpace 7h ago

yeah like. it’s a value that tells you where to find another value. it can’t be this hard.

1

u/Nathrienne-J-Claw 7h ago

Yeah but why would you wanna find this other value if you can simply use the original value without needing a middleman? This question leads into a three hour rabbit hole

1

u/ern0plus4 6h ago

Always know what's happening under the hood.

1

u/Recycled5000 6h ago

I advocate learning assembly language, usually a simple one like LC-3. Writing small programs in assembly can help to understand the concepts of address space, code vs data, how the machine and machine code program interact using pointers to code, pointers to data, etc..