what is passing parameter
Page 1 of 1

Author:  pinkberry [ Wed May 18, 2011 1:04 am ]
Post subject:  what is passing parameter

hi everyone!
i have a total newbie in easy68k.i would like to know what is passing parameter?

Author:  clive [ Wed May 18, 2011 2:57 am ]
Post subject: 

Do you have familiarity with any high level language like C or PASCAL? Passing parameters is how you convey information to subroutines.

test1(123, 456); // Parameter#1 123, Parameter#2 456
test1(654, 321);

68K equivalent using registers to pass parameter to a subroutine.

 MOVE.W #123,D0 ; Parameter#1, First Call
 MOVE.W #456,D1 ; Parameter#2
 BSR  test1

 MOVE.W #654,D0 ; Parameter#1, Second Call
 MOVE.W #321,D1 ; Parameter#2
 BSR  test1

Author:  pinkberry [ Wed May 18, 2011 6:59 pm ]
Post subject: 

thanks for the reply clive!yup,i learn abit of java and c...

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group