You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
IO means the parameter is both an input (IN) parameter and an output (OUT) parameter.
Input parameters are set to the value that is passed into CALL when the subcall starts. Output parameters set the variable passed to CALL when the subcall return. So IO does both.
vmthread {
DATA16 x
MOVE16(5,x)
// x has value of 5
CALL(AddOne,x)
// x still has value of 5
}
subcall AddOne {
IN_16 n
// n has value of 5
ADD16(n,1,n)
// n has value of 6
}
vmthread {
DATA16 x
MOVE16(5,x)
// x has value of 5
CALL(AddOne,x)
// x has value of 1
}
subcall AddOne {
OUT_16 n
// n has value of 0
ADD16(n,1,n)
// n has value of 1
}
vmthread {
DATA16 x
MOVE16(5,x)
// x has value of 5
CALL(AddOne,x)
// x has value of 6
}
subcall AddOne {
IO_16 n
// n has value of 5
ADD16(n,1,n)
// n has value of 6
}
Title says it all! I was wondering what the difference between "IN_16" vs "IO_16" was with respect to subcall parameters. Could you clarify this?
The text was updated successfully, but these errors were encountered: