Here's the equivalent CSC-1 assembler code, which is a complete program ready to run in CASM: MAIN: ; x and y are already declared and set at the end ; call the subroutine and leave the result in A register LOD X STD MONUS_PARM1 LOD Y STD MONUS_PARM2 CAL MONUS LOD MONUS_RETVAL ; leave it in Acc STD 4095 ; print answer HLT ; variables for main X: NUM 8 Y: NUM 5 ANSWER: NUM 0 MONUS: MONUS_IF1: LOD MONUS_PARM1 SUB MONUS_PARM2 JN MONUS_ELSE1 STD MONUS_RETVAL JMP MONUS_ENDIF1 MONUS_ELSE1: LDI 0 STD MONUS_RETVAL MONUS_ENDIF1:NOP RET ; variables for monus MONUS_PARM1: NUM 0 MONUS_PARM2: NUM 0 MONUS_RETVAL:NUM 0 |