RadAsm inclusion in the GoASM SDK

Started by ecube, April 14, 2009, 07:19:41 AM

Previous topic - Next topic

ecube

Hello KetilO,
I've used Radasm over a near now for MASM and it's a fantastic IDE, it's definitley one of, if not the best IDE's out there for any language. The reason i'm making this post is because like GoASM, RadASM is abit confusing to setup, you provide the different individual parts as seperate downloads like Jeremy does for his project. And so to help users jump start with no effort their rapid assembly developing I want to include your IDE in the GoASM SDK I created here http://www.masm32.com/board/index.php?topic=11180.0  with a minor installer that associates .asm, .inc etc.. files to it, and has RadASM ready with modified donkeys GoASM .ini color settings etc... The point of this is to provide users who not only a IMO great SDK that's similar to MASM32 but supports 64bit and uses a superior assembler. But also a Great IDE to view and build the sources in.  To many people are confused in thinking that a 1 gig+ Visual Studio non-sense is the best way to rapidly develop high end applications. When this can easily be done with a lot smaller/more complete project in assembly, using what you've created, Jeremy, Donkey, myself,  and countless others, and it can be done in more pleasing, faster way. I'll include your disclaimers etc with the IDE, I look forward to your answer.

KetilO

Hi E^cube

Great project. Feel free to include RadASM.

KetilO

ecube

Fantastic!

Thanks KetilO, I have 1 minor issue though, a typical build.bat used in the GoASM SDk looks like

set INCLUDE=C:\GoAsm\include
\GoAsm\bin\GoAsm.exe /x86 Conditonal.asm
\GoAsm\bin\GoLink Conditonal.obj
pause


the set INCLUDE line is needed for Donkey's headers, I tried adding to RadASM via the environmental option but it just crashes, you have any advice how to add that line in?

donkey

Hi E^cube,

During the installof the SDK why not have the option to set the environment variable, the reg keys are :

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment
Value =  include
HKEY_CURRENT_USER\Environment
value = include

This is a quick way of doing it...

SetEnvVariables FRAME pszFolder
LOCAL hkResult :D
LOCAL cbRead :D
LOCAL szInclude[1024]:B
LOCAL szNewInclude[1024]:B

// HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment
// include
// HKEY_CURRENT_USER\Environment
// include

.GLOBAL
cmp D[fGlobal],NULL
je >>.LOCAL

invoke RegOpenKeyEx, HKEY_LOCAL_MACHINE, "System\CurrentControlSet\Control\Session Manager\Environment", 0, KEY_WRITE + KEY_READ, ADDR hkResult
test eax,eax
jnz >>.LOCAL
mov D[cbRead],1024
invoke RegQueryValueEx,[hkResult],"include",NULL,NULL,OFFSET szInclude,ADDR cbRead
// If the include environment variable doesn't exist then create it
test eax,eax
jz >>.ADD2GLOBAL
invoke lstrlen,[pszFolder]
invoke RegSetValueEx,[hkResult],"include",NULL,REG_SZ,[pszFolder],eax
jmp >>.DONEGLOBAL

.ADD2GLOBAL
// Parse the include environment variable
invoke ScanIncludes,offset szInclude,[pszFolder],offset szNewInclude
invoke lstrlen,offset szNewInclude
invoke RegSetValueEx,[hkResult],"include",NULL,REG_SZ,offset szNewInclude,eax
.DONEGLOBAL
invoke RegCloseKey,[hkResult]

.LOCAL
cmp D[fLocal],NULL
je >>.BROADCAST

invoke RegOpenKeyEx, HKEY_CURRENT_USER, "Environment", 0, KEY_WRITE + KEY_READ, ADDR hkResult
test eax,eax
jnz >>.EXIT
mov D[cbRead],1024
invoke RegQueryValueEx,[hkResult],"include",NULL,NULL,OFFSET szInclude,ADDR cbRead
// If the include environment variable doesn't exist then create it
test eax,eax
jz >>.ADD2LOCAL
invoke lstrlen,[pszFolder]
invoke RegSetValueEx,[hkResult],"include",NULL,REG_SZ,[pszFolder],eax
jmp >>.DONELOCAL

.ADD2LOCAL
// Parse the include environment variable
; invoke ScanIncludes,offset szInclude,[pszFolder],offset szNewInclude
invoke lstrlen,offset szNewInclude
invoke RegSetValueEx,[hkResult],"include",NULL,REG_SZ,offset szNewInclude,eax
.DONELOCAL
invoke RegCloseKey,[hkResult]

.BROADCAST
invoke BroadcastSystemMessage,BSF_POSTMESSAGE,NULL,WM_SETTINGCHANGE,0,0

.EXIT
RET
ENDF

ScanIncludes FRAME pszInclude,pszFolder,pNewString
uses edi,esi,ebx
LOCAL szTestString[MAX_PATH]:B

mov eax,[pNewString]
mov D[eax],0

invoke PathRemoveBackslash,[pszFolder]
cld
mov edi,[pszInclude]
mov esi,[pszInclude]
invoke lstrlen,[pszInclude]
mov ecx,eax
.SCAN
mov al,";"
repne scasb
test ecx,ecx
js >>.EXIT
mov eax,edi
sub eax,esi
test ecx,ecx
jnz >
mov eax,MAX_PATH
:
push ecx
invoke lstrcpyn,offset szTestString,esi,eax
invoke PathRemoveBackslash,offset szTestString
invoke lstrcmpi,[pszFolder],offset szTestString
test eax,eax
jz >
invoke lstrcat,[pNewString],offset szTestString
invoke lstrcat,[pNewString],";"
:
pop ecx
mov esi,edi
test ecx,ecx
jnz <<.SCAN

.EXIT
invoke lstrcat,[pNewString],[pszFolder]
RET
ENDF


By setting the INCLUDE environment variable in the registry there is no need to set it at compile time at all.

Edgar
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable

ecube

Thanks Donkey,
I kind of wanted to reframe from modifying the system in any way so that the user could use the SDK off a pen drive on restricked systems, but i'll give them the option with your registry method along with the option to associate .asm, .inc's etc to the included RadASM. Someone recommended passing a batch file to RadASM instead of GoASM directly in another thread, i'm thinking that may work aswell without modifications.