Machine coding the programs-microprocessor, Assembly Language

Assignment Help:

Machine Coding the Programs

So far we have describe five programs which were  written  for hand coding  by a programmer. In this, we will now have a deep look at how these programs may be  translate to machine codes. In Appendix, the instruction set along with the Appendix is presented. This Appendix is self-explanatory to hand code mostly of the instructions. The V,S W, D, MOD, REG  and R/M  fields are appropriate decided depending upon the data types, addressing mode and the registers  used. The table shows the details about how to select these fields.

Most of the instructions either have particular opcodes or they may be decided only by setting the V,S, W, D, REG, MOD and R/M fields suitably but the critical point is  the calculation of jump addresses for intra segment branch instructions. Before beginning the coding of call or jump instructions, we will see some simpler coding examples.

Example :

MOV BL, CL

For hand coding this instruction, first we will have to note down the following features.

(i) It sets in the register/memory to/from register format.

(ii) It is an 8-bit operation.

(iii) BL is the destination register and CL is a source register.

Now from the feature (i) by using the Appendix, the op code format is given below.

1485_mcp.jpg

If d =1, then transformation of data is to the register shown by the REG field, for example the destination is a register (REG). If d = 0, the source is a register shown by the REG field. It is an 8-bit operation, therefore w bit is 0. If it had been a 16-bit operation, the w bit would have been 1.From referring to given table to search the REG to REG addressing in it, for example the last column with MOD 11. According to the Appendix when MOD is 11, the R/M field is treated as a REG field. The REG field which is used for source register and the R/M field are used for the destination register, if d is 0. If d =1, the REG field is utilized for destination and the R/M field is used to indicate source. the complete machine code of this instruction comes out to be now.

code    dw       MOD   REG    R/M

MOV BL, CL 1 0 0 0 1 0 0 0     1   1   001    0 1 1= 88 CB


Related Discussions:- Machine coding the programs-microprocessor

Machine coding the programs-microprocessor, Machine Coding the Programs ...

Machine Coding the Programs So far we have describe five programs which were  written  for hand coding  by a programmer. In this, we will now have a deep look at how these prog

Generating random number using 8086, I need to generate a random number bby...

I need to generate a random number bby using 8086 assembly language

Merge Sort, Write a program to merge two sorted arrays to create a third so...

Write a program to merge two sorted arrays to create a third sorted array containing all values from the two original arrays. Merge is a key component to the mergesort algorithm.

Display control-microprocessor, Display control 8279  provides  a  16  ...

Display control 8279  provides  a  16  byte  display  memory  and  refresh  logic.  Every address in the display memory corresponds to a display unit with address zero represen

input and output, Description: LC3 allows input from keyboard and out...

Description: LC3 allows input from keyboard and output to display on the screen. This lab will exercise the input/output capability using LC-3 Assembly language. Procedure

The processor 8088-microprocessor, The processor 8088 The launching of ...

The processor 8088 The launching of the processor 8086 is consider as a remarkable step in the development of high speed computing machines. Before the introduction  of 8086 mo

Cmp-arithmetic instruction-microprocessor, CMP: Compare: - This instructio...

CMP: Compare: - This instruction compares the source operand, which can be a register or memory location an immediate data with a destination operand that might be a register or a

Operating System, Why is the capability to relocate processes desirable?

Why is the capability to relocate processes desirable?

Prime finder - assembly program, Prime Finder - assembly program: Pro...

Prime Finder - assembly program: Problem:  Prime Finder   In this problem you will write a small program that tests whether a given integer is a prime number or not.  Let's

Queue operation-microprocessor, Queue Operation :   RQ/CT0, RQ...

Queue Operation :   RQ/CT0, RQ/G1-Request/Grant:   These pins are utilized by other local bus masters, in themaximum mode, to force the processor to release the loca

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

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!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd