I am trying to write subfunction for nachOS, but when I add it it does not work.
Cause not know details: Add ../userprog/syscall.h
to:
define # SC_Sub 11 int (int a, int b); ../ test /
.globl sub in
Sub sub: addiu $ 2, $ 0, SC_Sub syscall j $ 31 .end sub
Then I write a sub-quote:
# Include "syscall.h" int main () {int results; Result = sub (100,99); Halt (); }
In exception.cc: I try to catch exception:
case SC_Sub: op1 = machine-> ReadRegister (4); Op2 = Machine-> ReadRegister (5); Results = op1 - op2; Printf ("OP1:% d \ n", OP1); Printf ("op2:% d \ n", op2); Printf ("result:% d \ n", result); Machine & gt; WriteRegister (2, results); Machine & gt; WriteRegister (PCReg, Machine> ReadRegister (PCReg) 4); break;
I go to / code / gmake all
and I have an error: (
. /../../gnu-decstation-ultrix/decstation-ultrix/2.95.3/gcc-B../../ gnu-decstation-ultrix / -t script-n sub-oo-sub ../ ./../gnu-decstation-ultrix/decstation-ultrix/2.95.3/ld: crt0.o can not open: [1] by making such a file or directory: *** [sub] error 1 create [1]: excluding directory `/home/nxqd/Desktop/nachos-3.4/code/test 'gmake: *** [All] Error 2
This dance folder It does not have a "bug" sub-funk included.
P: //www.mediafire.com/? G3mnjxz4wdc Enter the code here
No comments:
Post a Comment