Machine coding the programs-microprocessor, Assembly Language

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 :


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.


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

Posted Date: 10/12/2012 6:47:59 AM | Location : United States

Related Discussions:- Machine coding the programs-microprocessor, Assignment Help, Ask Question on Machine coding the programs-microprocessor, Get Answer, Expert's Help, Machine coding the programs-microprocessor Discussions

Write discussion on Machine coding the programs-microprocessor
Your posts are moderated
Related Questions
Zero flag: The next line compares the value in register. A with the value 1. If they are equivalent, the Zero flag is set (to 1). The next line then jumps to start: only if th

Overview of Intel Pro-Pentium : The 2 chief players in the PC CPU market are Motorola and Intel.  Intel has enjoyed incredible success with its processors since the early 1980

MLIL: Unsigned Multiplication Byte or Word: This instruction multiplies an unsigned byte or word by the contents of the AL. The unsigned byte or word can be in any one of the gene

Pin diagram of 8088 : The pin diagram of 8088 is shown in given figure. Most of the 8088 pins and their functions are exactly similar to the corresponding pins of 8086.  Hence

You will need to upload your main.c and factorial.s files and a .jpg photo of the output on your board using the Vista assignment upload features.  It must be submitted by the dead

Part A: Bitwise Logical and Shift Operations Create a SPARC assembly language program that extracts a bit-field from the contents of register %l0. The position of the rightmos

hi, i''m new to assembly language and my teacher told us to look for an example of the odd and even numbers program using debug.exe in ms dos as a guide since we just started. plea

8254 Programmable Timer A diagram of Intel's 8254 interval event/timer counter is given in Figure. The 8254 consists of 3 identical counting circuits, per of which has GATE and

what will be the value of EAX after following instructions execute? mov bx, 0FFFFh and bx, 6Bh

I need a division subroutine. Asks for two inputs, then displays the inputs and shows the answer with a remainder. Mine isnt displaying the inputs correctly.