strange ASM
strange ASM
c0.s="456"
c1.s="789"
  
!mov [v_c1],[v_c0]
Debug c1
			
			
									
									
						c1.s="789"
!mov [v_c1],[v_c0]
Debug c1
- 
				Little John
 - Addict

 - Posts: 4807
 - Joined: Thu Jun 07, 2007 3:25 pm
 - Location: Berlin, Germany
 
Re: strange ASM
In the «Tricks 'n' Tips» subforum, callroot wrote:c0.s="456"
c1.s="789"
!mov [v_c1],[v_c0]
Debug c1
I agree.[u]infratec[/u] wrote:callroot should be renamed to spamroot
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!
			
			
									
									
						- 
				DontTalkToMe
 - Enthusiast

 - Posts: 334
 - Joined: Mon Feb 04, 2013 5:28 pm
 
Re: strange ASM
You are not wrong.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!
Amazing tip btw
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: Select all
c0.s = " 456 "
c1.s = " 789 "
! mov eax,[v_c0]
! mov [v_c1],eax
debug c1
Re: strange ASM
Code works fine. What's so strange?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: Select all
c0.s = " 456 " c1.s = " 789 " ! mov eax,[v_c0] ! mov [v_c1],eax debug c1
Re: strange ASM
! mov [v_c1],[v_c0]Demivec wrote:Code works fine. What's so strange?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: Select all
c0.s = " 456 " c1.s = " 789 " ! mov eax,[v_c0] ! mov [v_c1],eax debug c1
Can't write this way.
Re: strange ASM
That's right and you will never be able to write it this way because asm doesn't support this.callroot wrote:! mov [v_c1],[v_c0]
Can't write this way.
Windows (x64)
Raspberry Pi OS (Arm64)
						Raspberry Pi OS (Arm64)
- 
				DontTalkToMe
 - Enthusiast

 - Posts: 334
 - Joined: Mon Feb 04, 2013 5:28 pm
 
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.
			
			
									
									
						http://x86.renejeschke.de/html/file_mod ... d_176.html
Look there and you'll see you can't move from memory to memory.
- Psychophanta
 - Always Here

 - Posts: 5153
 - Joined: Wed Jun 11, 2003 9:33 pm
 - Location: Anare
 - Contact:
 

