I have to create a program with assembly language K & S Model 2 that multiplies a number by another, the problem is that this language does not provide a multiplication operation. I thought of doing multiplications with additions, for example:
3 x 5 = 5 + 5 + 5 (3 vezes o 5) = 15
This language also does not provide a direct way to loop (or loop), nor a statement of comparison of records, for example to see if they are equal, or if it has the same number.
This assembly language provides only bitwise operators with which I am not very familiar. I know that doing AND bitwise is like doing a multiplication of numbers but converted into binaries, for example:
3 & 2
First we have to convert to binary:
11 (3)
& 10 (2)
====
10 (2)
I'm really not seeing how I can do a multiplication using only this operations, if I could at least loop it anyway ...