PureBasic Forum
https://www.purebasic.fr/english/

strange ASM
https://www.purebasic.fr/english/viewtopic.php?f=35&t=65835
Page 1 of 1

Author:  callroot [ Mon May 30, 2016 4:25 pm ]
Post subject:  strange ASM

c0.s="456"

c1.s="789"

!mov [v_c1],[v_c0]


Debug c1

Author:  Little John [ Mon May 30, 2016 5:35 pm ]
Post subject:  Re: strange ASM

In the Ā«Tricks 'n' TipsĀ» subforum, callroot wrote:
c0.s="456"

c1.s="789"

!mov [v_c1],[v_c0]


Debug c1

infratec wrote:
callroot should be renamed to spamroot ;-)

I agree.

Author:  Keya [ Mon May 30, 2016 5:43 pm ]
Post subject:  Re: strange ASM

i didnt think you could "mov [mem], [mem]" in the one go (and this is a CPU thing not a PB thing) - you have to "mov reg, [mem]" then "mov [mem], reg". Please correct me if im wrong!

Author:  DontTalkToMe [ Mon May 30, 2016 5:59 pm ]
Post subject:  Re: strange ASM

Keya wrote:
i didnt think you could "mov [mem], [mem]" in the one go (and this is a CPU thing not a PB thing) - you have to "mov reg, [mem]" then "mov [mem], reg". Please correct me if im wrong!


You are not wrong.

Amazing tip btw :D

Author:  callroot [ Tue May 31, 2016 4:56 am ]
Post subject:  Re: strange ASM

Keya wrote:
i didnt think you could "mov [mem], [mem]" in the one go (and this is a CPU thing not a PB thing) - you have to "mov reg, [mem]" then "mov [mem], reg". Please correct me if im wrong!



Code:

c0.s = " 456 "

c1.s = " 789 "

! mov eax,[v_c0]

! mov [v_c1],eax


debug c1


Author:  Demivec [ Tue May 31, 2016 5:35 am ]
Post subject:  Re: strange ASM

callroot wrote:
Keya wrote:
i didnt think you could "mov [mem], [mem]" in the one go (and this is a CPU thing not a PB thing) - you have to "mov reg, [mem]" then "mov [mem], reg". Please correct me if im wrong!



Code:
c0.s = " 456 "

c1.s = " 789 "

! mov eax,[v_c0]

! mov [v_c1],eax


debug c1

Code works fine. What's so strange?

Author:  callroot [ Tue May 31, 2016 5:49 am ]
Post subject:  Re: strange ASM

Demivec wrote:
callroot wrote:
Keya wrote:
i didnt think you could "mov [mem], [mem]" in the one go (and this is a CPU thing not a PB thing) - you have to "mov reg, [mem]" then "mov [mem], reg". Please correct me if im wrong!



Code:
c0.s = " 456 "

c1.s = " 789 "

! mov eax,[v_c0]

! mov [v_c1],eax


debug c1

Code works fine. What's so strange?


! mov [v_c1],[v_c0]


Can't write this way.

Author:  wilbert [ Tue May 31, 2016 6:10 am ]
Post subject:  Re: strange ASM

callroot wrote:
! mov [v_c1],[v_c0]


Can't write this way.

That's right and you will never be able to write it this way because asm doesn't support this.

Author:  DontTalkToMe [ Tue May 31, 2016 12:50 pm ]
Post subject:  Re: strange ASM

There are tables with the possible operands sizes and types you can use with each instruction.

http://x86.renejeschke.de/html/file_mod ... d_176.html

Look there and you'll see you can't move from memory to memory.

Author:  Rings [ Tue May 31, 2016 1:01 pm ]
Post subject:  Re: strange ASM

topic moved...

Author:  Keya [ Tue May 31, 2016 4:05 pm ]
Post subject:  Re: strange ASM

here is some more info http://stackoverflow.com/questions/11953352/why-ia32-does-not-allow-memory-to-memory-mov

Author:  Psychophanta [ Sun Jan 21, 2018 10:50 pm ]
Post subject:  Re: strange ASM

Dear callroot:
R.t.f.m.
https://flatassembler.net/docs.php?article=manual

Page 1 of 1 All times are UTC + 1 hour
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/