Convert simple c++ program to assembly (68000) -


i have existing program written in c++ counts number of words. how go converting assembly run on 68000 processor? should start?

int _tmain(int argc, _tchar* argv[]) {     int i=0;     int words=0;     bool last_space=true;     while( test_string[i]!=0)     {         if(!last_space && test_string[i]==' ')//end of word - space preceded not space must handle multi spaces             words=words+1;         if (test_string[i]==' ')             last_space=true;         else             last_space=false;         i++;     }      return 0; } 

a few hints seems typical homework assignment:

you have loop until condition fullfilled. should assmebly instruction book , find commands can read byte memory compare it, branch , jmp instructions.

i start simple loop , when know how this, add next conditions, checking spaces , on.


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -