VARS VAR SIZE CODE st 5,[SIZE] ENDCODE VAR I CODE st 0,[I] ENDCODE VAR J CODE st 0,[J] ENDCODE VAR K CODE st 0,[K] ENDCODE VAR CELL CODE st 0,[CELL] ENDCODE VARS VAR B CODE ld [SIZE],%t2 cmp %t2,0 bge L0 mov 0,%t2 L0: mov 1,%t0 add %t0,%t2,%t0 st %t0,[$a0] call PCAT$alloc add %o0,%t0,%t1 sub %t1,%t2,%t3 L1: cmp %t1,%t3 ble L2 dec %t1 st 0,[%t1] ba L1 L2: dec %t0 st %t0,[%o0] st %t1,[B] ENDCODE VARS VAR C CODE ld [SIZE],%t6 cmp %t6,0 bge L3 mov 0,%t6 L3: ld [SIZE],%t9 cmp %t9,0 bge L4 mov 0,%t9 L4: mov 1,%t7 add %t7,%t9,%t7 st %t7,[$a0] call PCAT$alloc add %o0,%t7,%t8 sub %t8,%t9,%t10 L5: cmp %t8,%t10 ble L6 dec %t8 st 0,[%t8] ba L5 L6: dec %t7 st %t7,[%o0] mov 1,%t4 add %t4,%t6,%t4 st %t4,[$a0] call PCAT$alloc add %o0,%t4,%t5 sub %t5,%t6,%t11 L7: cmp %t5,%t11 ble L8 dec %t5 st %t8,[%t5] ba L7 L8: dec %t4 st %t4,[%o0] st %t5,[C] ENDCODE VARS VAR D CODE ld [SIZE],%t14 cmp %t14,0 bge L9 mov 0,%t14 L9: ld [SIZE],%t17 cmp %t17,0 bge L10 mov 0,%t17 L10: mov 1,%t15 add %t15,%t17,%t15 st %t15,[$a0] call PCAT$alloc add %o0,%t15,%t16 sub %t16,%t17,%t18 L11: cmp %t16,%t18 ble L12 dec %t16 st 0,[%t16] ba L11 L12: dec %t15 st %t15,[%o0] mov 1,%t12 add %t12,%t14,%t12 st %t12,[$a0] call PCAT$alloc add %o0,%t12,%t13 sub %t13,%t14,%t19 L13: cmp %t13,%t19 ble L14 dec %t13 st %t16,[%t13] ba L13 L14: dec %t12 st %t12,[%o0] st %t13,[D] ENDCODE CODE st 0,[I] L15: ld [I],%t20 ld [SIZE],%t21 cmp %t20,%t21 bl L16 ba L17 L16: ld [I],%t22 cmp %t22,0 bge L18 call PCAT$bounds_error L18: ld [C],%t23 sub %t23,1,%t24 ld [%t24],%t24 cmp %t22,%t24 bl L19 call PCAT$bounds_error L19: add %t23,%t22,%t23 ld [I],%t25 cmp %t25,0 bge L20 call PCAT$bounds_error L20: ld [%t23],%t26 sub %t26,1,%t27 ld [%t27],%t27 cmp %t25,%t27 bl L21 call PCAT$bounds_error L21: add %t26,%t25,%t26 ld [I],%t28 add %t28,1,%t29 st %t29,[%t26] ld [I],%t30 add %t30,1,%t31 st %t31,[I] ba L15 L17: st 0,[I] L22: ld [I],%t32 ld [SIZE],%t33 cmp %t32,%t33 bl L23 ba L24 L23: st 0,[J] L25: ld [J],%t34 ld [SIZE],%t35 cmp %t34,%t35 bl L26 ba L27 L26: st 0,[CELL] st 0,[K] L28: ld [K],%t36 ld [SIZE],%t37 cmp %t36,%t37 bl L29 ba L30 L29: ld [CELL],%t38 ld [I],%t40 cmp %t40,0 bge L31 call PCAT$bounds_error L31: ld [C],%t41 sub %t41,1,%t42 ld [%t42],%t42 cmp %t40,%t42 bl L32 call PCAT$bounds_error L32: add %t41,%t40,%t41 ld [K],%t43 cmp %t43,0 bge L33 call PCAT$bounds_error L33: ld [%t41],%t44 sub %t44,1,%t45 ld [%t45],%t45 cmp %t43,%t45 bl L34 call PCAT$bounds_error L34: add %t44,%t43,%t44 ld [%t44],%t39 ld [K],%t47 cmp %t47,0 bge L35 call PCAT$bounds_error L35: ld [C],%t48 sub %t48,1,%t49 ld [%t49],%t49 cmp %t47,%t49 bl L36 call PCAT$bounds_error L36: add %t48,%t47,%t48 ld [J],%t50 cmp %t50,0 bge L37 call PCAT$bounds_error L37: ld [%t48],%t51 sub %t51,1,%t52 ld [%t52],%t52 cmp %t50,%t52 bl L38 call PCAT$bounds_error L38: add %t51,%t50,%t51 ld [%t51],%t46 umul %t39,%t46,%t53 add %t38,%t53,%t54 st %t54,[CELL] ld [K],%t55 add %t55,1,%t56 st %t56,[K] ba L28 L30: ld [I],%t57 cmp %t57,0 bge L39 call PCAT$bounds_error L39: ld [D],%t58 sub %t58,1,%t59 ld [%t59],%t59 cmp %t57,%t59 bl L40 call PCAT$bounds_error L40: add %t58,%t57,%t58 ld [J],%t60 cmp %t60,0 bge L41 call PCAT$bounds_error L41: ld [%t58],%t61 sub %t61,1,%t62 ld [%t62],%t62 cmp %t60,%t62 bl L42 call PCAT$bounds_error L42: add %t61,%t60,%t61 ld [CELL],%t63 st %t63,[%t61] ld [J],%t64 add %t64,1,%t65 st %t65,[J] ba L25 L27: ld [I],%t66 add %t66,1,%t67 st %t67,[I] ba L22 L24: st "Input matrix",[$a0] call PCAT$write_string call PCAT$write_newline st 0,[I] L43: ld [I],%t68 ld [SIZE],%t69 cmp %t68,%t69 bl L44 ba L45 L44: ld [I],%t71 cmp %t71,0 bge L46 call PCAT$bounds_error L46: ld [C],%t72 sub %t72,1,%t73 ld [%t73],%t73 cmp %t71,%t73 bl L47 call PCAT$bounds_error L47: add %t72,%t71,%t72 cmp 0,0 bge L48 call PCAT$bounds_error L48: ld [%t72],%t74 sub %t74,1,%t75 ld [%t75],%t75 cmp 0,%t75 bl L49 call PCAT$bounds_error L49: add %t74,0,%t74 ld [%t74],%t70 st %t70,[$a0] call PCAT$write_int st " ",[$a0] call PCAT$write_string ld [I],%t77 cmp %t77,0 bge L50 call PCAT$bounds_error L50: ld [C],%t78 sub %t78,1,%t79 ld [%t79],%t79 cmp %t77,%t79 bl L51 call PCAT$bounds_error L51: add %t78,%t77,%t78 cmp 1,0 bge L52 call PCAT$bounds_error L52: ld [%t78],%t80 sub %t80,1,%t81 ld [%t81],%t81 cmp 1,%t81 bl L53 call PCAT$bounds_error L53: add %t80,1,%t80 ld [%t80],%t76 st %t76,[$a0] call PCAT$write_int st " ",[$a0] call PCAT$write_string ld [I],%t83 cmp %t83,0 bge L54 call PCAT$bounds_error L54: ld [C],%t84 sub %t84,1,%t85 ld [%t85],%t85 cmp %t83,%t85 bl L55 call PCAT$bounds_error L55: add %t84,%t83,%t84 cmp 2,0 bge L56 call PCAT$bounds_error L56: ld [%t84],%t86 sub %t86,1,%t87 ld [%t87],%t87 cmp 2,%t87 bl L57 call PCAT$bounds_error L57: add %t86,2,%t86 ld [%t86],%t82 st %t82,[$a0] call PCAT$write_int st " ",[$a0] call PCAT$write_string ld [I],%t89 cmp %t89,0 bge L58 call PCAT$bounds_error L58: ld [C],%t90 sub %t90,1,%t91 ld [%t91],%t91 cmp %t89,%t91 bl L59 call PCAT$bounds_error L59: add %t90,%t89,%t90 cmp 3,0 bge L60 call PCAT$bounds_error L60: ld [%t90],%t92 sub %t92,1,%t93 ld [%t93],%t93 cmp 3,%t93 bl L61 call PCAT$bounds_error L61: add %t92,3,%t92 ld [%t92],%t88 st %t88,[$a0] call PCAT$write_int st " ",[$a0] call PCAT$write_string ld [I],%t95 cmp %t95,0 bge L62 call PCAT$bounds_error L62: ld [C],%t96 sub %t96,1,%t97 ld [%t97],%t97 cmp %t95,%t97 bl L63 call PCAT$bounds_error L63: add %t96,%t95,%t96 cmp 4,0 bge L64 call PCAT$bounds_error L64: ld [%t96],%t98 sub %t98,1,%t99 ld [%t99],%t99 cmp 4,%t99 bl L65 call PCAT$bounds_error L65: add %t98,4,%t98 ld [%t98],%t94 st %t94,[$a0] call PCAT$write_int call PCAT$write_newline ld [I],%t100 add %t100,1,%t101 st %t101,[I] ba L43 L45: call PCAT$write_newline st "Input matrix squared",[$a0] call PCAT$write_string call PCAT$write_newline st 0,[I] L66: ld [I],%t102 ld [SIZE],%t103 cmp %t102,%t103 bl L67 ba L68 L67: ld [I],%t105 cmp %t105,0 bge L69 call PCAT$bounds_error L69: ld [D],%t106 sub %t106,1,%t107 ld [%t107],%t107 cmp %t105,%t107 bl L70 call PCAT$bounds_error L70: add %t106,%t105,%t106 cmp 0,0 bge L71 call PCAT$bounds_error L71: ld [%t106],%t108 sub %t108,1,%t109 ld [%t109],%t109 cmp 0,%t109 bl L72 call PCAT$bounds_error L72: add %t108,0,%t108 ld [%t108],%t104 st %t104,[$a0] call PCAT$write_int st " ",[$a0] call PCAT$write_string ld [I],%t111 cmp %t111,0 bge L73 call PCAT$bounds_error L73: ld [D],%t112 sub %t112,1,%t113 ld [%t113],%t113 cmp %t111,%t113 bl L74 call PCAT$bounds_error L74: add %t112,%t111,%t112 cmp 1,0 bge L75 call PCAT$bounds_error L75: ld [%t112],%t114 sub %t114,1,%t115 ld [%t115],%t115 cmp 1,%t115 bl L76 call PCAT$bounds_error L76: add %t114,1,%t114 ld [%t114],%t110 st %t110,[$a0] call PCAT$write_int st " ",[$a0] call PCAT$write_string ld [I],%t117 cmp %t117,0 bge L77 call PCAT$bounds_error L77: ld [D],%t118 sub %t118,1,%t119 ld [%t119],%t119 cmp %t117,%t119 bl L78 call PCAT$bounds_error L78: add %t118,%t117,%t118 cmp 2,0 bge L79 call PCAT$bounds_error L79: ld [%t118],%t120 sub %t120,1,%t121 ld [%t121],%t121 cmp 2,%t121 bl L80 call PCAT$bounds_error L80: add %t120,2,%t120 ld [%t120],%t116 st %t116,[$a0] call PCAT$write_int st " ",[$a0] call PCAT$write_string ld [I],%t123 cmp %t123,0 bge L81 call PCAT$bounds_error L81: ld [D],%t124 sub %t124,1,%t125 ld [%t125],%t125 cmp %t123,%t125 bl L82 call PCAT$bounds_error L82: add %t124,%t123,%t124 cmp 3,0 bge L83 call PCAT$bounds_error L83: ld [%t124],%t126 sub %t126,1,%t127 ld [%t127],%t127 cmp 3,%t127 bl L84 call PCAT$bounds_error L84: add %t126,3,%t126 ld [%t126],%t122 st %t122,[$a0] call PCAT$write_int st " ",[$a0] call PCAT$write_string ld [I],%t129 cmp %t129,0 bge L85 call PCAT$bounds_error L85: ld [D],%t130 sub %t130,1,%t131 ld [%t131],%t131 cmp %t129,%t131 bl L86 call PCAT$bounds_error L86: add %t130,%t129,%t130 cmp 4,0 bge L87 call PCAT$bounds_error L87: ld [%t130],%t132 sub %t132,1,%t133 ld [%t133],%t133 cmp 4,%t133 bl L88 call PCAT$bounds_error L88: add %t132,4,%t132 ld [%t132],%t128 st %t128,[$a0] call PCAT$write_int call PCAT$write_newline ld [I],%t134 add %t134,1,%t135 st %t135,[I] ba L66 L68: return ENDCODE