Quote Originally Posted by The_PC_Gamer View Post
I must Write a function "function (A, S)" which will accept the values for registers A and S and return the value of result Y to the main line.
Quote Originally Posted by The_PC_Gamer View Post
the function (a,S) should create the 4 loops, and using the printvalues, print them out.
If I ask another time, will I get a third answer?

If we take it as read then that A is really the low four bits of the parameter input, and B is really the high four bits of that parameter, do you understand:
(1) How to build the parameter input out of A and B?
(2) How to compute Y given the parameter input and S? (Note: this part is writing function(a,s).)
(3) How to write a loop to get A or B through all of its possible values?
(4) How to set up the loops in (3) to get the specific values of the input parameter that you're supposed to get in your examples?