CSC231 Exercises with the MOV instruction

From dftwiki3
Revision as of 11:58, 28 September 2015 by Thiebaut (talk | contribs) (Created page with "--~~~~ ---- =Problem #1= <br /> Translate this program in a language close to Java and C/C++, into assembly <br /> <source lang="java"> int Table1[5] = { 1, 10, 20, 30, 40...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

--D. Thiebaut (talk) 12:58, 28 September 2015 (EDT)


Problem #1


Translate this program in a language close to Java and C/C++, into assembly

    int Table1[5] = { 1, 10, 20, 30, 40};
    int Table2[5];
    String msg1 = "Hello world!";
    String msg2 = "                 ";

    // some assignments
    Table2[0] = 3;
    Table2[1] = 4;
    Table2[2] = 5;
    Table2[3] = 6;
    Table2[4] = 10;

    Table1[0] = Table0[0]
    Table1[1] = Table0[4]

    msg2[0] = msg1[0];
    msg1[11] = '\n';


Problem #2


How long does it take a 1GHz Pentium to execute the section labeled "some assignments"?