Wednesday | 04 OCT 2023

2023-09-07
# Learning Assembly - Day 3

### Lesson 11 - Counting to 10 Properly

### Lesson 12 - Addition

### Lesson 13 - Subtraction

### Lesson 14 - Multiplication

### Lesson 15 - Division

I tried to do this myself and this was a bit difficult. It definitely is a mindbend trying to thing through the algorithm and work out how to juggle all the registers properly. I enjoyed doing this even if it wasn't optimal. There seems to be 4 registers, eax, ebx, ecx and edx. eax is the main register everything works with. ecx is a register used for counting but that seems to be just convention. I think assembly probably has patterns that arise out of it and eventually I'll see the general structure be able to tell what it's trying to do. Hopefully!

I need to keep a list of the registers

Very straightforward.

Straightforward for positive numbers but I can alreayd see how problematic this will be when I need to flip the signs.

Multiplication is special in that it takes just one register and assumes eax is what will be multiplied.

Divison is similar to multiplication in that it takes just one register and assumes eax is what will be divided. It also loads the remainder into edx.