Now, I want to call a subroutine by value.
My source said you do so by
call subroutineName, (var1, var2)
subroutineName(var3, var4):
;code
I don't know how, it gives me a "invalid combination of opcode and operands"
I also tried formatting it differently (putting a colon in between, putting nothing in between and so on.
https://people.cs.clemson.edu/~mark/sparc/subroutines.txt here is the source and what he wrote:
main
a = 1 a: 1
b = 2 b: 2
call subr(a,b) pass 1,2 via stack
print a,b print 1,2
subr(x,y) copy 1,2 into x,y ^
x = x + 1 x: /1/ 2 |
y = x + y y: /2/ 4 |
return ---------------------'
I am really confused to how to call and return with value and result.
Thanks for your Help though!