I need to do this:
Make a JAS program that does the following:
Read in x, y
print characters x, x + 2, x + 4, x + 6, ..., x + 2*y
You can assume that y is >= 0.
Do not use local variables (OP_ILOAD, OP_ISTORE),
currently i have this:
.main
IN
IN
SWAP
L1:
DUP
IFEQ END
SWAP
DUP
OUT
BIPUSH 2
IADD
SWAP
BIPUSH 1
ISUB
GOTO L1
END:
IADD
OUT
HALT
.end-main
which only works for 1 input
Input:
!!
Expected output:
!#%')+-/13579;=?ACEGIKMOQSUWY[]_ac
Actual output:
!#%')+-/13579;=?ACEGIKMOQSUWY[]_ac
but not for other inputs like:
Input:
#+
Expected output:
#%')+-/13579;=?ACEGIKMOQSUWY[]_acegikmoqsuwy
Actual output:
+-/13579;=?ACEGIKMOQSUWY[]_acegikmoq
what do i do...