RosettaCodeData/Task/Pointers-and-references/68000-Assembly/pointers-and-references-10.68000
2023-07-01 13:44:08 -04:00

15 lines
289 B
Text

;implements:
;uint64_t foo (uint16_t a,uint16_t b,uint16_t c){return a+b+c;}
MOVE.L #arg2,-(SP)
MOVE.L #arg1,-(SP)
MOVE.L #arg0,-(SP)
JSR foo
LEA (12,SP),SP ;discard the three values pushed prior to the call.
RTS
foo:
;outputs to D0
MOVE.L (4,SP),D0
ADD.L (8,SP),D0
ADD.L (12,SP),D0
RTS