assembly - When Will the Code Under DATA SEGMENT execute in this code? -


I'm the start of assembly programming ... I did a lot of holes in Google. There is a lot of information in it, but I still The following code does not understand.

MOV AX, DATA

I also do not understand that when the code in the data segment is executed in this program.

  Approval CS: Code, DS: Data Code SEV MOV AX, @ Data Mf, Ax ... ... Code Data Clause ... ... ... / / SOMECODE DATA ENDS   

Also, can someone tell me what the following instructions do? ..

MOV AH, ?? H (??) can be filled with 09,4c etc).

MOV DS, AX

MOV ES, AX

Warning: I have never written 8086 assembly meetings in my life, but what I do about it.

MOV AX, @ data is the first line of code that gets run. I believe DATA is a variable that keeps the value of space in memory where the data segment remains. It transfers the memory location of @ATA to AX register (16 bit register). One thing to note here is @ in front of the word of the word. I believe this is due to the fact that @DATA has been evaluated during the linking process and it will be replaced by its actual value. Note that other instances should not be in front of @ because they are starting a real memory space.

MOV DS, AX will then set that memory location to the 8086 assembly variable DS which is a standard variable (or register in this case) It should always point at the place of your storage where you want to keep the value (if you are familiar with the C ++ terminology, the heap).

The X register is simply a temporary place holder that you can load against prices and executed orders.

Move AH, HK? H First, the AHH X represents the "high" side of the letters. This brother will be AL, which refers to the "low" side of the AX register. It is used when you want to command instead of 8 bits instead of 16 bit. The second part of this, H? H as you mention it is the price you want to deposit in the AH register. In the end H means "hexadecimal" so if you have 00 h which means zero (in hex). If you put in FFH, the decimal number will be equal to 255 in the system.

On the initial question "When will code be executed under code code under code code?" - I believe that you are asking when the data will be executed. This should not be executed normally because it is about to store the data (variable) for use in your code section. On some operating systems you can get around it which I believe and just jump into that section of code or treat it as branch and a regular code category. Sometimes it does all the work of stack overflow, heap overflow, (hacks) etc.

Comments