CALL MULTIPLY Function in Assembler

277 Views Asked by At

so i have a small practika in a couple of hours and im nearly done with preparations. Theres one task i dont really understand tho.

The task:

For further processing, measured values m (0 ≤ m ≤ 255) are stored in memory starting at address 0x81. The number n of measured values to be processed is at address 0x80 (1 ≤ n ≤ 15). Write an EVALUATION program in which the value 310 is multiplied for each measured value and then the value 510 is added. The calculated measured values should be written back to the same memory locations. To realize the multiplication, the program MULTIPLY from the previous task is to be called up as a subprogram. To return from the subprogram to the main program, the subprogram must be terminated with the RET instruction. Make sure that no relevant data is lost in the main program when you call the subroutine. The stack can be used to save data. The main program should start with address 0x60, the subprogram with 0x40. Enter the program into the table!

The Table

And my programm MULTIPLY i have to call.

multymulty2

i really only need to know how to implement a new function, call this one and return without losing my values. i already checked my function in a simulator and it works so no worries here. Any help is greatly appreciated!

0

There are 0 best solutions below