Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/400.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
ARM汇编类程序到Java?_Java_Algorithm_Methods - Fatal编程技术网

ARM汇编类程序到Java?

ARM汇编类程序到Java?,java,algorithm,methods,Java,Algorithm,Methods,到目前为止,这就是我的代码。我搜索了一些链接,但不知道它们是否正确 if(op==addCode){ a=b+c; *我应该还点什么吗* } else if(op==子代码){ a=b-c; *我应该还点什么吗* } 否则如果(op==multCode){ a=b*c; *我应该还点什么吗* } else if(op==divCode){ a=b/c; *我应该还点什么吗* } else if(op==remCode){ a=b%c; *我应该还点什么吗* } 否则如果(op==相等代码){ 如

到目前为止,这就是我的代码。我搜索了一些链接,但不知道它们是否正确

if(op==addCode){
a=b+c;
*我应该还点什么吗*
}
else if(op==子代码){
a=b-c;
*我应该还点什么吗*
}
否则如果(op==multCode){
a=b*c;
*我应该还点什么吗*
}
else if(op==divCode){
a=b/c;
*我应该还点什么吗*
}
else if(op==remCode){
a=b%c;
*我应该还点什么吗*
}
否则如果(op==相等代码){
如果(b==c){
**我不知道该怎么办**
}
否则{
System.out.println(“数字不相等”);
}
}
else if(op==notEqualCode){
如果(b!=c){
**我不知道该怎么办**
}
否则{
系统输出打印(“数字相等”);
}
}
else if(op==lessCode){
if(b如果(b)你能解释一下你的问题到底是什么吗?因为你问的不清楚。我想看看我的算术是否正确,以及我从这种语言到Java的翻译是否正确。因为我认为我的算术翻译不对。我在你的问题中没有看到任何ARM asm。你似乎已经有Java代码了它使用一系列条件而不是开关来决定做什么。如果它不做你想做的,那么用英语解释你想让它做什么。
   if( op == addCode) {
      a = b + c;
      *should I return something?*
  }
  else if (op == subCode){
      a = b - c;
      *should I return something?*
  }
  else if (op == multCode){
      a = b * c;
      *should I return something?*
  }
  else if (op == divCode){
      a = b / c;
     *should I return something?*
  }
  else if (op == remCode){
      a = b % c;
      *should I return something?*
  }
  else if (op == equalCode){
      if( b == c){
         **not sure what to do here**
      }
      else {
      System.out.println("The numbers are not equal");
      }

  }
  else if (op ==notEqualCode){

      if (b != c){
          **not sure what to do here**
      }
      else {
      System.out.print("The numbers are are equal");
      }
  }
  else if (op == lessCode){
      if (b < c){
          **not sure what to do here**
      }
      else {
      System.out.println("The numbers is not less than each other");
      }
  }
  else if (op == lessEqualCode){
      if (b <= c){
         **not sure what to do here**
      }
      else{
      System.out.println("The numbers is not less than or equal to each other");
      }


}
9 a b c     add         Add the values in cell b and cell c and store the 
result in cell a. 
10 a b c        subtract            Same as 9, but do cell b − cell c. 
11 a b c        multiply            Same as 9, but do cell b ∗ cell c. 
12 a b c        divide          Same as 9, but do cell b / cell c.
13 a b c        remainder       Same as 9, but do cell b % cell c. 
14 a b c        equal           Same as 9, but do cell b == cell c. 
15 a b c        not equal       Same as 9, but do cell b != cell c. 
16 a b c        less than       Same as 9, but do cell b < cell c. 
17 a b c        less than or equal      Same as 9, but do cell b <= cell c