flat assembler
Message board for the users of flat assembler.

Index > Main > How do a normal rb API to a register

Author
Thread Post new topic Reply to topic
gumletis



Joined: 18 Dec 2004
Posts: 128
gumletis
Hi, i wanna do my code smaller... this what i got
Code:
include '%fasminc%\win32ax.inc'
.data
sysdir rb 100
.code
start:
invoke GetWindowsDirectory,sysdir,100
...
...
...
.end start
    

so i tryed to do it with register, but doesn't work, a little fix here would be great Surprised

Code:
include '%fasminc%\win32ax.inc'
.code
start:
invoke GetWindowsDirectory,esi,100  ;; just donno how do this
...
...
...
.end start
    

as i say, i don't know how to do it... please help

_________________
LOOOL
Post 01 Jan 2005, 16:50
View user's profile Send private message Reply with quote
gumletis



Joined: 18 Dec 2004
Posts: 128
gumletis
anyone?
Post 01 Jan 2005, 18:41
View user's profile Send private message Reply with quote
polygon7



Joined: 14 Aug 2003
Posts: 62
Location: Poznan, Poland
polygon7
Hi,
you could try this:
Code:
include '%fasminc%\win32ax.inc'
.data
sysdir dd ?
.code
start:

invoke  LocalAlloc,LMEM_FIXED,100
mov     [sysdir],eax
invoke  GetWindowsDirectory,eax,100

[...]

invoke  LocalFree,sysdir

.end start     

_________________
best regards
p7
Post 01 Jan 2005, 21:45
View user's profile Send private message Visit poster's website Reply with quote
gumletis



Joined: 18 Dec 2004
Posts: 128
gumletis
when i do this, it will compile fine but crash when i start it
Code:
include '%fasminc%\win32ax.inc' 
.data 
sysdir dd ? 
.code 
start: 

invoke  LocalAlloc,LMEM_FIXED,100 
mov     [sysdir],eax 
invoke  GetWindowsDirectory,eax,100 
invoke  MessageBox,0,eax,eax,0
invoke  LocalFree,sysdir 

.end start 
    

_________________
LOOOL
Post 02 Jan 2005, 10:16
View user's profile Send private message Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3500
Location: Bulgaria
JohnFound
Code:
include '%fasminc%\win32ax.inc' 
.code 
start: 
invoke  LocalAlloc,LMEM_FIXED,100 
mov     esi, eax
invoke  GetWindowsDirectory,esi,100 
invoke  MessageBox,0,esi,esi,0
invoke  LocalFree,esi
invoke  ExitProcess, 0
.end start 
    
Post 02 Jan 2005, 11:01
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
gumletis



Joined: 18 Dec 2004
Posts: 128
gumletis
thanks to you all, it work!
Post 02 Jan 2005, 11:17
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on YouTube, Twitter.

Website powered by rwasa.