Peek/Poke commands in assembly?
Peek/Poke commands in assembly?
Does anyone know where I can find the ASM equivalents of the Peek/Poke commands for long, float, and string?
Code: Select all
; PokeL(@A, 7)
!mov [v_a], 7
; PokeL(A, 7)
!mov eax, [v_a]
!mov [eax], 7
; PokeF(@F, 7)
!mov [v_f], 1088421888I don't know assembly well at all but isn't this the correct way to mov a variable?
Code: Select all
!mov eax,[v_a]
!mov [eax],dword 7- Psychophanta
- Always Here

- Posts: 5153
- Joined: Wed Jun 11, 2003 9:33 pm
- Location: Anare
- Contact:
there is another way often used in z80 times:

Code: Select all
A.l
;PokeL(@A,-789):
!push dword -789
!pop dword[v_A]
Debug A.l
b.q
;PokeQ(@b,-123789):
!push dword -1 dword -123789
!pop dword[v_b] dword[v_b+4]
Debug b.q
Here's the full PokeL function by the way:
Code: Select all
!mypokel2: ; (Address+4, Value+8)
!mov edx, [esp+4]
!mov eax, [esp+8]
!mov [edx], eax
!ret 8
; PokeL(@A, 7)
!pushd 7
!push v_a
!call mypokel2
; PokeL(A, 7)
!pushd 7
!pushd [v_a]
!call mypokel2
- Psychophanta
- Always Here

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

- Posts: 480
- Joined: Thu Jul 27, 2006 4:06 am
Why the need to repost?
http://www.purebasic.fr/english/viewtopic.php?t=29895
I thought people gave good answers in there, enough to implement my own peek/poke set in asm x86 without trouble.
But anyway, for string you will have to ask yourself "do I want to support unicode?", then try about coding it.
http://www.purebasic.fr/english/viewtopic.php?t=29895
I thought people gave good answers in there, enough to implement my own peek/poke set in asm x86 without trouble.
But anyway, for string you will have to ask yourself "do I want to support unicode?", then try about coding it.
That post did not cover floats or strings.superadnim wrote:Why the need to repost?
http://www.purebasic.fr/english/viewtopic.php?t=29895
I thought people gave good answers in there, enough to implement my own peek/poke set in asm x86 without trouble.
But anyway, for string you will have to ask yourself "do I want to support unicode?", then try about coding it.
