i am writing a subroutine which that could be called to meet the following specifications;
A company has a number of employees and a boss. They have a party with Pizza and pop if the number of employees is larger than 15, then the boss will pay $50 and each employee will equally share the remaining amount, else, the boss will pay half of the overall amount and each employee will equally share the remaining amount. In the subroutine, use appropriate data and address registers for all inputs and outputs.
this how i started but i am stock on this one...
CLR.W D5
ClR.W D6
CMPI #15, D2
BLE LOOp
MOVE.W D4,D5
SUBQ.W #50, D5
DONE
Loop MOVE.W D4, D6
DIVU #2, D4
SUB.W D4, D6
DiVU D2, D6
Done MOVE.L (SP)+, D4, D6
RTS
END