Home computickets What is needed here nop

What is needed here nop




Why in this training code nop ? The code changes lowercase letters to the title.

Datasg Segment Para
MyText DB 'OUR Native Town', 13.10, '$'
Datasg Ends.
Stacksg Segment 'Stack'
   DB 12 dup (?)
Stacksg Ends.
CodeSG Segment Para 'Code'
Begin Proc Far.
Assume SS: Stacksg, CS: CodeSG, DS: Datasg
   Push ds.
   Sub AX, AX
   Push AX.
   LEA BX, MyText
   MOV CX, 10H
   CMP AH, 61H
   JB MT2.
   CMP AH, 7Ah
   JA MT2.
   Call Cor.
   Loop MT1.
   LEA DX, MyText
   MOV AH, 09H
   INT 21H.
Begin Endp.
Cor Proc Near.
   And ah, 0dfh
   MOV [BX], AH
Cor Endp.
Codesg Ends.
End Begin.

Answer 1, Authority 100%

There are several reasons to insert into the NOP code. One of them is to fit the size of the program under the desired to say, it occupied a certain amount of memory. The second is the alignment of command addresses that are executed (for optimization). The most common reason is to improve the work of the conveyor. To ensure the correct unconditional transitions, and that the predictor of the branches is less tupil, NOP is inserted, in case the predictor is mistaken. In case of an error, he will not do anything. With manual coding, the assembler does not make sense to do this. This is if briefly, because you can get a more deployed answer if you understand the processor architecture well. More NOP is often used to debug. In your code it is not needed.

Answer 2

I can assume that:

  1. This place where you can in the already working program put the “Point stop” or “Transition to the debugger”.
  2. place where you can put RET to make the plug procedure.

Answer 3

nop is the instruction “not surgery”, that is nothing.
Formally not needed.

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions