1

I am totally new to Assembly68k and it is difficult for me to find instructive code that helps me learning. I want to write a very simple program to begin with:

  • Define variable A = 100.
  • Calculate the inverse i.e. calculate 1/A
  • Divide by the outcome by another constant such as 5
  • store the result

Could anyone help me out here? I know this is a very basic question, but I guess I need a starting point somewhere.. Thank's so much!!

spadel
  • 998
  • 2
  • 16
  • 40
  • 2
    With integer arithmetic, 1/A is 0 for every A except 1. (And A=0 has no mathematical answer; I forget whether m68k's division instruction faults.) Did you want to use a hardware FPU to do this with floating point math? Or what? So basically I'd recommend picking a different starting point, like writing a loop to calculate Fibonacci numbers or something easy like that. (You can even write it in C and look at optimized compiler output for m68k, if you have m68k GCC or clang, to [get the compiler to make examples for you](https://stackoverflow.com/q/38552116)) – Peter Cordes Mar 11 '21 at 13:53

0 Answers0