Masm32 tutorials assume root directory installation? (like C:\masm32)

Started by l_d_allan, February 20, 2006, 03:27:30 PM

Previous topic - Next topic

l_d_allan

<alert comment="masm32 newbie">

I'm very much a masm32 newbie and a very rusty asm86 developer.

Thanks for providing masm32 .... it looks like it could be a valuable resource.

I"ve looked at tutorial\console\DEMO1
and
touch.zip

My impression is that all of the tutorial code assumes that masm32 is installed in the root directory (such as C:\masm32 or X:\masm32).

Is that the case? It seems like many of the .inc files also have hard-coded
; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««
    include \masm32\include\masm32rt.inc
; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««

Is there a way to use relative paths so I could install masm32 somewhere else?

</comment>

P1

l_d_allan,

Welcome a Board !!!    :U

Forum 'Search' is your friend, along with Google.  And it will speed you along in up to speed again.   :cheekygreen:

QuoteIs there a way to use relative paths so I could install masm32 somewhere else?
Yes, go for it.  MASM32 was design for a basic install that would fill the needs of most of it's developers across Windows OSes.  With that said, your basic install is for C Drive in a MASM32 directory.  Can other combination of use be done?  Yes, but it's up to you to re-configure your setup to meet your needs. 

Seeing that your getting started again.  Use MASM32, as intended, then as you come up to speed working through demos and examples, re-configure for your environment as you see fit.  What I have learned is, do what works best for you and realize that not everyone works like you do.

Regards,  P1   :8)

Mark Jones

Quote from: l_d_allan on February 20, 2006, 03:27:30 PM
...all of the tutorial code assumes that masm32 is installed in the root directory (such as C:\masm32 or X:\masm32). Is that the case? It seems like many of the .inc files also have hard-coded

; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««
    include \masm32\include\masm32rt.inc
; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««

Is there a way to use relative paths so I could install masm32 somewhere else?


Hi Allan, instead of hardcoding your paths, just remove the drive designator; i.e.


; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««
    include \MyMasm32\include\masm32rt.inc
; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««


This should compile fine if ran from say F: and MASM32 is installed at F:\masm32. Experiment! :U

I will say that you MIGHT encounter a problem if the path to MASM32\bin includes a long-filename path, such as C:\My Documents\Assembly Programming\MASM32 v8.2SP2\bin. MASM itself probably wouldn't have any trouble installing or running from there, but when you start using 3rd-party tools such as IDEs and debuggers, something will inevitably choke on the LFN's. Plus it's hard to compile when passing long lines to ML.EXE and LINK.EXE, etc. Why not just install to C:\MASM32 and be done with it?  :8)
"To deny our impulses... foolish; to revel in them, chaos." MCJ 2003.08

hutch--

ld,

I did the installation of MASM32 in thjis way from early on because of the massive number of installation mistakes that many were making. I simply got tired of enlessly being mail bombed from people who never read the instructions, incorrectly installed the project then wondered why it did not work.

In the example code is a demo called ALTBUILD that shows how to use the environment and it in fact works well but many do not undetrstand this technique. The hard coded paths make it possible to have multiple development environments on the same drive with messups of which linker, library and include files get used.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

l_d_allan

QuoteI simply got tired of enlessly being mail bombed from people who never read the instructions, incorrectly installed the project then wondered why it did not work.

I have to think there are a lot of headaches involved in keeping this site useful. Your efforts (and the other major participants) are greatly appreciated!

Also thanks for the hint .... I looked at AltBuild and I think I can see how to proceed (actually several ways). I should have realized that ml.exe uses the environment variables INCLUDE and LIB (similarily to cl.exe)

; Same as tutorial\console\DEMO1 except relative paths for the includes
    .486                                    ; create 32 bit code
    .model flat, stdcall                    ; 32 bit memory model
    option casemap :none                    ; case sensitive

    include windows.inc     ; always first
    include macros.asm      ; MASM support macros

    include masm32.inc
    include kernel32.inc

    includelib masm32.lib
    includelib kernel32.lib

    .code                       ; Tell MASM where the code starts
start:                          ; The CODE entry point to the program
    print chr$("Hey, this actually works.",13,10)
    exit
end start                       ; Tell MASM where the program ends


* I tried out an alt_makeit.bat for AltDemo1
@echo off

: ------------------------------
: set and clear the environment variables
: ------------------------------
set MASM32_HOME=X:\DevTools\masm32
set INCLUDE=
set LIB=

if exist "hello.obj" del "hello.obj"
if exist "hello.exe" del "hello.exe"

: -------------------------
: assemble and link the source file with complete spec of includes and libs
: -------------------------
ml /I%MASM32_HOME%\include\ /I%MASM32_HOME%\macros hello.asm /link /LIBPATH:%MASM32_HOME%\lib /SUBSYSTEM:CONSOLE

if errorlevel 1 goto errasm
dir "hello.*"
hello
goto TheEnd

:errasm
echo echo Assembly Error
goto TheEnd
:TheEnd
pause


* and another_makeit.bat for AltDemo1
@echo off
: ------------------------------
: set the environment variables
: ------------------------------
set MASM32_HOME=X:\DevTools\masm32
set INCLUDE=%MASM32_HOME%\include\;%MASM32_HOME%\macros\
set LIB=%MASM32_HOME%\lib\

: -------------------------
: assemble and link the source file ... ml uses environment variables INCLUDE and LIB
: -------------------------
ml hello.asm /link /SUBSYSTEM:CONSOLE
if errorlevel 1 goto errasm
dir "hello.*"
hello
goto TheEnd

:errasm
echo echo Assembly Error
goto TheEnd
:TheEnd
pause


Does the above seem reasonable? At this point, my primary interest is in console apps, so I am using a basic, stripped down makeit.bat.