Already have an account? Get multiple benefits of using own account!
Login in your account..!
Remember me
Don't have an account? Create your account in less than a minutes,
Forgot password? how can I recover my password now!
Enter right registered email to receive password!
In this Lab you will code 8086 assembler equivalents (Virgo) for common C control flow instructions. This will give you an appreciation for how control flow is implemented in assembly (and machine) language. You will find that it is not quite as simple as it is with a high-level language. See special instructions for submission at the end of this file.This lab contains a BONUS section worth an additional 4 points on your final mark! Here is a list of the C instructions for which you will code assembly language equivalents:
If statementC codeif (condition) {statements}If-Else statementC codeif (condition) {then_statements} else {else_statements}While loopC codewhile (condition) {statements}Do-While loopC codedo {statements} while (condition);For loopC codefor (initialization; condition; increment) {statements}Switch statementC codeswitch (expression) {case val_1:case_1_statementscase val_2:case_2_statementscase val_n:case_n_statementsdefault:default_statements}Normally, C Switch statements have a Break statement at the end of each case. You will also need to implement Break and Continue statements which can be used inside some of these control flow instructions.Break statementsA Break statement can occur inside a C loop or Switch statement. It is implemented as an unconditional branch to a label immediately following the loop or Switch statement.Continue statementsA Continue statement can occur inside a C loop. For While and Do-While loops, it is implemented as an unconditional branch to a label for the condition test of the While or Do-While statement.A Continue statement in a For loop is implemented as an unconditional branch to a label immediately preceding the code to implement the increment statement.
Note that the assembly code you develop for these C-structure equivalents need only be shown as pseudocode; that is, since the actual conditions are not given, neither the test for the condition nor the jump statement for this test can actually be shown. Typically, the test will be some sort of compare (cmp) instruction and the jump will be one of the many jmp variants. It is only necessary to state that a test must be done at a certain point and that a jump relating to that test should then be done at some other point. In the second and third parts of the assignment, you will code and test two of these instructions using actual assembly language.
Coding for the IF statement is given below as an example of the syntax required. Use a similar syntax for the remaining control flow instructions.
If statementC codeif (condition) {statements}Assembler pseudo-codeIF:test conditionjump to Next if falseassembly code for statementsNext:Part A) Write pseudo-code for the remaining five control flow statements given above and for the Break and Continue statements.Part B) Code a Do-While loop for the following C-code example in Virgo assembly language (assumeint's are words of 2 bytes). Place each C-code statement at the appropriate place in your assembly code as a comment:int x = 0;do{x++;if (x == 5) continue;sum += x;} while (x < 10);Bonus) Code a Switch statement for the following C-code example in assembly language (assume int's are words of 2 bytes). Place each C-code statement at the appropriate place in your assembly code as a comment:
int a;int b = 0x12;int c = 0x34;int p = some constant value;switch (p){case 0: a = b + c; break;case 1: a = b - c; break;case 3: a = b; break;case 7: a = c; break;default: a = 0;}
For this assignment, I've provided a data file called 'elevation.mat', which contains the elevation data you'll be working with. Type load elevation.mat to get the varia
E v o l u t i o n of Software: In the past stage of programming the software's were developed in Machine language Using binary numbers 1's and 0's. Later it convert
We want Guys For Job in Gaming Tracks Company for a mobile game developing Project Description: I want a team of game developers for life-time as mobile dev team in my compan
Explain each of the algorithms in a way that would be understandable to an intelligent person who is not familiar with programming. You should not use any code (or even pseudo code
decodethecode
how to set text in computer graphcs
#questionhow can i add new customer and alot him a new unique id ..
How do you know that your class requires a virtual destructor? A: If at least your class has one virtual function, you must make a destructor for this class virtual. It will let
project on business management
Within C we access external devices by means of a pointer i.e. address. The address could point to any memory mapped device i.e. Ram, Rom, Duart, Disk drives etc. Therefore there i
Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!
whatsapp: +1-415-670-9521
Phone: +1-415-670-9521
Email: [email protected]
All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd