Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
lOMoARcPSD|12084276 1 LAB 3 question Computer Organization (Universiti Teknologi MARA) StuDocu is not sponsored or endorsed by any college or university Downloaded by AZRA ALEEYA MAISARAH ABDUL GHONI ([email protected]) lOMoARcPSD|12084276 CSC 159 / MARCH 2019 NAME SAFINA AKILAH BINTI MOHAMMAD SABRI MATRIC NO. 2018212834 SUBJECT CSC159 GROUP CS1102D LECTURER’S NAME MADAM NORMALINA LAB ASSIGNMENT 3 DUE DATE: 23 MAY 2019 Downloaded by AZRA ALEEYA MAISARAH ABDUL GHONI ([email protected]) lOMoARcPSD|12084276 CSC 159 / MARCH 2019 LAB 2 For questions no 1 to no 3, trace the program and show the contents of registers and memory (if related) after each instruction is executed. 1. mov mov shr rcl shl al, 0fch cl, 4 al, cl al,2 al, 1 SECTION A SECTION B Downloaded by AZRA ALEEYA MAISARAH ABDUL GHONI ([email protected]) lOMoARcPSD|12084276 CSC 159 / MARCH 2019 2. mov mov sar sal rol ax, cl, ax, al, al, -4 2 cl 1 2 SECTION A SECTION B Downloaded by AZRA ALEEYA MAISARAH ABDUL GHONI ([email protected]) lOMoARcPSD|12084276 CSC 159 / MARCH 2019 3. total dw 6000 mov cl, 3 rcr total, cl shr total, 1 mov ax,total rol al, 1 SECTION A SECTION B Downloaded by AZRA ALEEYA MAISARAH ABDUL GHONI ([email protected]) lOMoARcPSD|12084276 CSC 159 / MARCH 2019 4. Why are these instructions error? shr 4, 1 ror 4, ax mov al, 256 mov AL, 25 mov cl, 256 shr al, cl 4 is the destination Destination cannot be an immediate data Only source can be an immediate value,a register or a memory operand Only immediate data or CL can be used as second parameter 256 is more than 8 bits Second operand is more than 8 bits Second operand is more than 8 bits 5. In SIX (6) lines of instruction, convert this equation into Assembly Language programme. TOTAL=( 7∗12 )∧38 Answer: total dw ? mov ax,7 mov bx,12 mul bx and ax,38 mov total,ax Downloaded by AZRA ALEEYA MAISARAH ABDUL GHONI ([email protected])