Z
Z
ZIK12017-11-17 20:04:10
assembler
ZIK1, 2017-11-17 20:04:10

Move the data from the second to the third variable. Absolute addressing in assembler?

Good day, I need help with 2 simple tasks in
Visual studio 2017 assembler
1) Declare 3 variables. Using assembler commands, send data from the 1st variable to the second, from the 2nd to the 3rd.
From 1 to 2 I sent, but how to send from 2 to 3?

#include "stdafx.h"


int _tmain(int argc, _TCHAR* argv[])
{int A = 1;
int B = 2;
int C = 3;
_asm {
    mov EAX,A;
    mov B,EAX;
    MOV EAX,C;
    MOV EAX,B;
}

}

2) Transfer data from one variable to another using absolute addressing.
I only know how to forward using indirect addressing:
#include "stdafx.h"


int _tmain(int argc, _TCHAR* argv[])
{
  int A;
  int B;
  A = 1;
  B = 7;
  _asm MOV EAX, A;
  void *pB = &B;
  _asm MOV EBX, pB;
  _asm MOV[EBX], EAX;
    return 0;
}

And how to send using absolute?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
jcmvbkbc, 2017-11-18
@ZIK1

how to forward from 2 to 3?

Understand how the transfer from 1 to 2 was done and repeat the same for 2 and 3.
Read what absolute addressing looks like, understand that it can't work with variables on the stack, put the variables in the right place, and forward using absolute addressing.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question