Forums before death by AOL, social media and spammers... "We can't have nice things"
|    comp.lang.asm.x86    |    Ahh, the lost art of x86 assembly    |    4,675 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 4,004 of 4,675    |
|    2018peb5224@nospicedham.mnit.ac.in to Frank Kotler    |
|    Re: register pointer to memory    |
|    15 Jan 20 21:43:32    |
   
   On Thursday, January 16, 2020 at 3:10:13 AM UTC+5:30, Frank Kotler wrote:   
   > On 01/14/2020 03:47 AM, 2018peb5224@nospicedham.mnit.ac.in wrote:   
   > > Hi,i am new in assembly coding. i want to do some memory address   
   manipulation for my project   
   > > what i want is to save a memory address in a Register then done some   
   manipulation on that address like changing the address and so on, then get the   
   data from the newly updated address.   
   > > So far i am not able to do it.   
   > > i am using nasm.   
   > >   
   > >   
   > >   
   > > mov ebx,000000h   
   > > add ebx,000230h   
   > > mov eax,[ebx]   
   > > push eax   
   > > push .fmt   
   > > call _printf   
   > > ret   
   > >   
   > > .fmt db '%d',0x0d,0x0a,0   
   > >   
   > > Thanks   
   > >   
   >   
   > What platform? (Nasm will do a lot of things) Looks like Windows? What   
   > happens? Exception? I don't think you have access to (virtual) memory at   
   > that address. Try something in "section .data"...   
   >   
   > {Sorry for the delay in your first post. This is a moderated NG and the   
   > internet was down at my place. Should go faster from here on...)   
   >   
   > Best,   
   > Frank   
      
   hi, thanks for the reply,   
   i don't think memory access is the issue   
   if i try to access memory data like this   
   ________________________________   
   lea si , [000000H]   
   lea di ,[test1]   
   movsb   
   movsb   
   push test1   
   call _printf   
   ____________________________   
   section .data   
   test1: dd 00h   
      
   then i am getting output of 2 bytes.   
   but if i try to move the address to the register and then try to print it, its   
   not printing anything, no error nothing just blank.section .data   
   ____________________________________   
   mov ecx,000000h   
   mov eax, [ecx]   
   push eax   
   push .fmt   
   call _printf   
   ret    
       
   ____________________________________   
   i just wanna know what is there that i am doing wrong.   
      
   In the end i just want to get the data from a particular memory location using   
   registers not using section data. is there any way?   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca