// File: sthapliyal37[P]Microprocessor_8085_Updated/DataTransfer.cpp
// Function: MOV(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>>&)
void MOV (string instruction,string instruction2,string* registers,bool* flag,map<string,string> &memory)
{
	int length=instruction.length();
	int length2=instruction2.length();
	if(length==1&&length2==1)
	{
        if(instruction=="M"&&instruction2!="M")
        {
            if(validityRegisters(instruction2))
            {
                string address=registers[5]+registers[6];
                memory[address]=registers[registerNumber(instruction2)];
            }
        }
        else if(instruction!="M" && instruction2=="M")
        {
            if(validityRegisters(instruction))
            {
                string address=registers[5]+registers[6];
                registers[registerNumber(instruction)]=memory[address];
            }
        }
        else if(instruction!="M"&&instruction2!="M")
        {
            if(validityRegisters(instruction2)&&validityRegisters(instruction)){
               registers[registerNumber(instruction)]=registers[registerNumber(instruction2)];
		   }
		 }
		 }  
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x230, %rsp            # imm = 0x230
movq %rdi, -0x198(%rbp)
movq %rsi, -0x190(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
callq 0x33b0
movq -0x190(%rbp), %rdi
movl %eax, -0x2c(%rbp)
callq 0x33b0
movl %eax, -0x30(%rbp)
cmpl $0x1, -0x2c(%rbp)
jne 0x11409
cmpl $0x1, -0x30(%rbp)
jne 0x11409
movq -0x198(%rbp), %rdi
leaq 0x414a(%rip), %rsi      # 0x15010
callq 0x50a0
testb $0x1, %al
jne 0x10ed4
jmp 0x11038
movq -0x190(%rbp), %rdi
leaq 0x412e(%rip), %rsi      # 0x15010
callq 0xe630
testb $0x1, %al
jne 0x10ef0
jmp 0x11038
movq -0x190(%rbp), %rsi
leaq -0x50(%rbp), %rdi
movq %rdi, -0x1a8(%rbp)
callq 0x3110
movq -0x1a8(%rbp), %rdi
callq 0x3800
movb %al, -0x199(%rbp)
jmp 0x10f1b
leaq -0x50(%rbp), %rdi
callq 0x3190
movb -0x199(%rbp), %al
testb $0x1, %al
jne 0x10f33
jmp 0x11033
movq -0x18(%rbp), %rdx
movq %rdx, %rsi
addq $0xa0, %rsi
addq $0xc0, %rdx
leaq -0x80(%rbp), %rdi
callq 0xe6b0
movq -0x190(%rbp), %rsi
movq -0x18(%rbp), %rax
movq %rax, -0x1b0(%rbp)
leaq -0xa0(%rbp), %rdi
callq 0x3110
jmp 0x10f71
leaq -0xa0(%rbp), %rdi
callq 0x3970
movl %eax, -0x1b4(%rbp)
jmp 0x10f85
movq -0x1b0(%rbp), %rax
movl -0x1b4(%rbp), %ecx
movslq %ecx, %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq %rax, -0x1c8(%rbp)
movq -0x28(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0xe790
movq %rax, -0x1c0(%rbp)
jmp 0x10fb9
movq -0x1c8(%rbp), %rsi
movq -0x1c0(%rbp), %rdi
callq 0x3050
jmp 0x10fce
leaq -0xa0(%rbp), %rdi
callq 0x3190
leaq -0x80(%rbp), %rdi
callq 0x3190
jmp 0x11033
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x3190
jmp 0x11412
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x11025
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0xa0(%rbp), %rdi
callq 0x3190
leaq -0x80(%rbp), %rdi
callq 0x3190
jmp 0x11412
jmp 0x11407
movq -0x198(%rbp), %rdi
leaq 0x3fca(%rip), %rsi      # 0x15010
callq 0xe630
testb $0x1, %al
jne 0x11054
jmp 0x111c5
movq -0x190(%rbp), %rdi
leaq 0x3fae(%rip), %rsi      # 0x15010
callq 0x50a0
testb $0x1, %al
jne 0x11070
jmp 0x111c5
movq -0x198(%rbp), %rsi
leaq -0xc0(%rbp), %rdi
movq %rdi, -0x1d8(%rbp)
callq 0x3110
movq -0x1d8(%rbp), %rdi
callq 0x3800
movb %al, -0x1c9(%rbp)
jmp 0x1109e
leaq -0xc0(%rbp), %rdi
callq 0x3190
movb -0x1c9(%rbp), %al
testb $0x1, %al
jne 0x110b9
jmp 0x111c0
movq -0x18(%rbp), %rdx
movq %rdx, %rsi
addq $0xa0, %rsi
addq $0xc0, %rdx
leaq -0xe0(%rbp), %rdi
movq %rdi, -0x1e8(%rbp)
callq 0xe6b0
movq -0x1e8(%rbp), %rsi
movq -0x28(%rbp), %rdi
callq 0xe790
movq %rax, -0x1e0(%rbp)
jmp 0x110fa
movq -0x198(%rbp), %rsi
movq -0x18(%rbp), %rax
movq %rax, -0x1f0(%rbp)
leaq -0x100(%rbp), %rdi
callq 0x3110
jmp 0x1111a
leaq -0x100(%rbp), %rdi
callq 0x3970
movl %eax, -0x1f4(%rbp)
jmp 0x1112e
movq -0x1e0(%rbp), %rsi
movq -0x1f0(%rbp), %rdi
movl -0x1f4(%rbp), %eax
cltq
shlq $0x5, %rax
addq %rax, %rdi
callq 0x3050
jmp 0x11152
leaq -0x100(%rbp), %rdi
callq 0x3190
leaq -0xe0(%rbp), %rdi
callq 0x3190
jmp 0x111c0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0xc0(%rbp), %rdi
callq 0x3190
jmp 0x11412
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x111af
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x100(%rbp), %rdi
callq 0x3190
leaq -0xe0(%rbp), %rdi
callq 0x3190
jmp 0x11412
jmp 0x11405
movq -0x198(%rbp), %rdi
leaq 0x3e3d(%rip), %rsi      # 0x15010
callq 0xe630
testb $0x1, %al
jne 0x111e1
jmp 0x11403
movq -0x190(%rbp), %rdi
leaq 0x3e21(%rip), %rsi      # 0x15010
callq 0xe630
testb $0x1, %al
jne 0x111fd
jmp 0x11403
movq -0x190(%rbp), %rsi
leaq -0x120(%rbp), %rdi
movq %rdi, -0x200(%rbp)
callq 0x3110
movq -0x200(%rbp), %rdi
movb $0x0, -0x141(%rbp)
callq 0x3800
movb %al, -0x1f5(%rbp)
jmp 0x11232
movb -0x1f5(%rbp), %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0x201(%rbp)
jne 0x11247
jmp 0x11285
movq -0x198(%rbp), %rsi
leaq -0x140(%rbp), %rdi
callq 0x3110
jmp 0x1125c
movb $0x1, -0x141(%rbp)
leaq -0x140(%rbp), %rdi
callq 0x3800
movb %al, -0x202(%rbp)
jmp 0x11277
movb -0x202(%rbp), %al
movb %al, -0x201(%rbp)
jmp 0x11285
movb -0x201(%rbp), %al
movb %al, -0x203(%rbp)
testb $0x1, -0x141(%rbp)
jne 0x1129c
jmp 0x112a8
leaq -0x140(%rbp), %rdi
callq 0x3190
leaq -0x120(%rbp), %rdi
callq 0x3190
movb -0x203(%rbp), %al
testb $0x1, %al
jne 0x112c3
jmp 0x11401
movq -0x190(%rbp), %rsi
movq -0x18(%rbp), %rax
movq %rax, -0x218(%rbp)
leaq -0x168(%rbp), %rdi
movq %rdi, -0x210(%rbp)
callq 0x3110
movq -0x210(%rbp), %rdi
callq 0x3970
movl %eax, -0x208(%rbp)
jmp 0x112fc
movq -0x198(%rbp), %rsi
movq -0x218(%rbp), %rax
movl -0x208(%rbp), %ecx
movslq %ecx, %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq %rax, -0x228(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x220(%rbp)
leaq -0x188(%rbp), %rdi
callq 0x3110
jmp 0x1133a
leaq -0x188(%rbp), %rdi
callq 0x3970
movl %eax, -0x22c(%rbp)
jmp 0x1134e
movq -0x228(%rbp), %rsi
movq -0x220(%rbp), %rdi
movl -0x22c(%rbp), %eax
cltq
shlq $0x5, %rax
addq %rax, %rdi
callq 0x3050
jmp 0x11372
leaq -0x188(%rbp), %rdi
callq 0x3190
leaq -0x168(%rbp), %rdi
callq 0x3190
jmp 0x11401
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x113bf
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
testb $0x1, -0x141(%rbp)
jne 0x113b1
jmp 0x113bd
leaq -0x140(%rbp), %rdi
callq 0x3190
jmp 0x113bf
leaq -0x120(%rbp), %rdi
callq 0x3190
jmp 0x11412
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x113f3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x188(%rbp), %rdi
callq 0x3190
leaq -0x168(%rbp), %rdi
callq 0x3190
jmp 0x11412
jmp 0x11403
jmp 0x11405
jmp 0x11407
jmp 0x11409
addq $0x230, %rsp            # imm = 0x230
popq %rbp
retq
movq -0x58(%rbp), %rdi
callq 0x3430
nopl (%rax,%rax)