diff --git a/sys/arch/mips/mips/syscall.c b/sys/arch/mips/mips/syscall.c
index 7a347cc66cc6..488f32060c49 100644
--- a/sys/arch/mips/mips/syscall.c
+++ b/sys/arch/mips/mips/syscall.c
@@ -1,4 +1,4 @@
-/*	$NetBSD: syscall.c,v 1.5 2001/09/22 21:29:21 manu Exp $	*/
+/*	$NetBSD: syscall.c,v 1.6 2001/12/02 08:28:18 manu Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -80,7 +80,7 @@
 
 #include <sys/cdefs.h>			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.5 2001/09/22 21:29:21 manu Exp $");
+__KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.6 2001/12/02 08:28:18 manu Exp $");
 
 #include "opt_ktrace.h"
 #include "opt_syscall_debug.h"
@@ -170,7 +170,7 @@ EMULNAME(syscall_plain)(struct proc *p, u_int status, u_int cause, u_int opc)
 			/*
 			 * Code is first argument, followed by actual args.
 			 */
-			code = frame->f_regs[A0];
+			code = frame->f_regs[A0] - SYSCALL_SHIFT;
 			args[0] = frame->f_regs[A1];
 			args[1] = frame->f_regs[A2];
 			args[2] = frame->f_regs[A3];
@@ -180,7 +180,8 @@ EMULNAME(syscall_plain)(struct proc *p, u_int status, u_int cause, u_int opc)
 			 * Like syscall, but code is a quad, so as to maintain
 			 * quad alignment for the rest of the arguments.
 			 */
-			code = frame->f_regs[A0 + _QUAD_LOWWORD];
+			code = frame->f_regs[A0 + _QUAD_LOWWORD] 
+			    - SYSCALL_SHIFT;
 			args[0] = frame->f_regs[A2];
 			args[1] = frame->f_regs[A3];
 			nsaved = 2;
@@ -288,7 +289,7 @@ EMULNAME(syscall_fancy)(struct proc *p, u_int status, u_int cause, u_int opc)
 			/*
 			 * Code is first argument, followed by actual args.
 			 */
-			code = frame->f_regs[A0];
+			code = frame->f_regs[A0] - SYSCALL_SHIFT;
 			args[0] = frame->f_regs[A1];
 			args[1] = frame->f_regs[A2];
 			args[2] = frame->f_regs[A3];
@@ -298,7 +299,8 @@ EMULNAME(syscall_fancy)(struct proc *p, u_int status, u_int cause, u_int opc)
 			 * Like syscall, but code is a quad, so as to maintain
 			 * quad alignment for the rest of the arguments.
 			 */
-			code = frame->f_regs[A0 + _QUAD_LOWWORD];
+			code = frame->f_regs[A0 + _QUAD_LOWWORD] 
+			    - SYSCALL_SHIFT;
 			args[0] = frame->f_regs[A2];
 			args[1] = frame->f_regs[A3];
 			nsaved = 2;