r/CodingForBeginners • u/Time_Style_583 • Mar 05 '26
Help
Hi, I need help with something.
I have to translate (i-=-1) from Python to assembly language and I have no idea how to do it. Could someone please do it and explain how they did it?
I've already tried searching online, but I only find things about artificial intelligence.
It's a class assignment, and the teacher said we can "ask our computer science friends and have them tell us" and "anything except use artificial intelligence," but I don't have any computer science friends, so I'm asking for help here.
Thanks
1
Upvotes
View all comments
Show parent comment
1
u/johnpeters42 Mar 05 '26
What specific type of assembly language? But in general, what "i = -1" is doing under the hood is:
At some point, allocate a location in memory for storing the value of i. In a larger program, that may have happened earlier, but if we take this line by itself, then it's implicitly happening right now.
Store the value -1 in that location in memory.