From the course: Learning Assembly Language

Unlock the full course today

Join today to access over 25,200 courses taught by industry experts.

Arithmetic operators

Arithmetic operators

- [Instructor] The next set of data manipulation instructions that we'll look at, are the integer arithmetic operators, add, subtract, multiply and divide. I've coded the starter program as a demonstration, so let's build and debug it. build starter dot EXE, debug starter dot EXE. we'll run to user code, go down, and into the starter code. As we're going through this, keep your eyes on the registers in the top right. We'll load the value 42 into racks and then negate it. We can see the result in racks, leading F's ending with D six, the leading F's are the sign extension. We can increment a value which adds one to it. Load 42 into racks and increment it. And we can also decrement, which takes one away. Load 42 into racks and decrement it. We use increment and decrement because they're very fast operations, but we can also add and subtract larger numbers. Here we'll move 42 into racks and add 13. And we get…

Contents