The MASM Forum Archive 2004 to 2012

General Forums => The Workshop => Topic started by: rob_c on May 09, 2006, 09:16:19 AM

Title: MASM on embedded devices?
Post by: rob_c on May 09, 2006, 09:16:19 AM
Hi everyone,

I'm curious... is it possible, or has anyone already written progs in MASm for windows CE based OS's? In particular I'm thinking of Windows Mobile 2003 for the smartphone. It strikes me that, from the little that it is the obvious way to get the best performance from these kind of devices?

All thoughts on this are welcome!

Cheers,
Rob (newbie to the forum)
Title: Re: MASM on embedded devices?
Post by: Eugen on May 09, 2006, 09:40:03 AM

Hi rob_c

One problem would appear for embedded devices: most of them dont have a x86 CPU  :green, the ARM CPU is much more common, with a different assembly language altogether, you know...

On the other hand, i agree that in an enviroment with so little resources as an embedded device assembly should be more used that JAVA, C++ and other OOP ..it, but because of comercial reasons (speed of development etc.) the assembly is seldom used.

Eugen
Title: Re: MASM on embedded devices?
Post by: rob_c on May 09, 2006, 10:59:53 AM
That's a very good point Eugen! My target device is an spvc500 which runs the ARM based Ti omap730. (I am looking into this purely from a personal application development perspective so I am not concerned with the speed of development etc.)

I'm not sure if this is the right thing to ask in this forum (& apologies if not) but do you know of any equivalent to masm32 for ARM processors? eg. that support the windows API for app development?

Thanks,
Rob

btw, this will not put me off using MASM32 as I firmly believe this is the way we should be coding still!
Title: Re: MASM on embedded devices?
Post by: rob_c on May 09, 2006, 12:03:29 PM
ps. if anyone else is interested in this subject, posting an acknowlegment would be cool, even if u have no info to offer. I'd like to know if it's just  me that thinks like this!

Cheers,
Rob
Title: Re: MASM on embedded devices?
Post by: Ar-ras on May 09, 2006, 12:14:27 PM
I know somebody who writes modified firmware for mobile phones... they have arm processors
But this is only for hardcorefreaks who want to write a complete new firmware...
You cannot write wince applications whit this method...
Did you tried to write embedded assembler codes into embedded visual c++ 4?
Maybe it supports embedded assembler, I didn't tried it
Maybe this works....
If not you can try to reverse engineer your own wince written in embedded visual c++ 4
So that you can write your own assembler
maybe there is a ml.exe for arm in the binfiles :)
Afaik WinCe file have modified PE-Header too

Thats my ideas for this
Title: Re: MASM on embedded devices?
Post by: rob_c on May 09, 2006, 12:24:38 PM
QuoteDid you tried to write embedded assembler codes into embedded visual c++ 4?

I've not tried this, but it sounds like a good place to start.
Title: Re: MASM on embedded devices?
Post by: Ar-ras on May 09, 2006, 01:13:25 PM
(http://img457.imageshack.us/img457/146/armasm6ro.gif)

:dance:

Only problem will be to find a armasm for your processor..

http://www.rainer-keuchel.de/wince/armasm.html
Title: Re: MASM on embedded devices?
Post by: Roger on May 09, 2006, 03:39:41 PM
Hi Rob,

I tried a Google search for Arm Assembler and found several sites talking about programming different ARM risc prrocessors and even a tutorial! try

http://www.riscworld.co.uk/ONLINE/ARMCODE/INDEX.HTM

Regards Roger
Title: Re: MASM on embedded devices?
Post by: Ar-ras on May 09, 2006, 03:53:30 PM
Quote from: rob_c on May 09, 2006, 10:59:53 AM
... My target device is an spvc500 which runs the ARM based Ti omap730. ...
I don't know if armasm has a omap730 support
Title: Re: MASM on embedded devices?
Post by: Ossa on May 09, 2006, 04:06:30 PM
I know this isn't MASM, but have you tried the official armasm (from the ARM website)? You won't have the supporting files I'm guessing, but i think it will support every ARM or combined core that they have (I used it with the ARM/XScale combo for writing an MPEG-4 decoder as one of my summer jobs... using Nucleus, not Windows though).

Ossa
Title: Re: MASM on embedded devices?
Post by: Eugen on May 09, 2006, 04:10:10 PM
Quote from: rob_c on May 09, 2006, 10:59:53 AM

I'm not sure if this is the right thing to ask in this forum (& apologies if not) but do you know of any equivalent to masm32 for ARM processors? eg. that support the windows API for app development?


I dont know any FREE alternative  :wink. You can check armasm as others suggest, but i dont know if its free. I remember coding for some Nokia phone with ARM core, and i was using gcc  :red and a free assembler as backend   but i cant remember what it was (didnt code in assembly then, but i'm doing it now  :green2  - still, not with free tools). I dont know if there are free ARM assemblers that have includes for WinCE, that would realy be too good for you...  :P

Eugen
Title: Re: MASM on embedded devices?
Post by: BogdanOntanu on May 09, 2006, 04:22:09 PM
Besides in an ironical way it makes more sense to write ASM only applications for desktop PC's since there is a huge number of then with almost the same CPU and ASM language. On embeded devices the number of devices that share the same CPU and hhardware architecture is much smaller so you will have to port your code/application many times... because of this portability issue a simple C compiler makes more sense in embeded devices
Title: Re: MASM on embedded devices?
Post by: Ossa on May 09, 2006, 04:29:26 PM
Quote from: BogdanOntanu on May 09, 2006, 04:22:09 PM
Besides in an ironical way it makes more sense to write ASM only applications for desktop PC's since there is a huge number of then with almost the same CPU and ASM language. On embeded devices the number of devices that share the same CPU and hhardware architecture is much smaller so you will have to port your code/application many times... because of this portability issue a simple C compiler makes more sense in embeded devices

From my admittedly limited experience, the companies that write software for embedded systems use it far more frequently. I think that's because they need to use the processor much more efficiently than on a PC where oodles of clock cycles are being wasted without much visible effect. I know most DSP code is written in pure ASM (company I talked about before had approx 8MB of source for their DSP stuff in pure ASM... one port for each processor they worked with - and there were hundreds).

However, for the individual software developer, I think you have a point, Bogdan. It's fine for a large company to port software over and over again, but it takes too much time for the single person.

Ossa
Title: Re: MASM on embedded devices?
Post by: Ar-ras on May 09, 2006, 05:01:05 PM
The Screenshot is from the armasm of the embedded Visual C++ 4 package
the link i added is maybe an alternative

Why I have to make different compilations for a pocketpc if it has different cpus?
Title: Re: MASM on embedded devices?
Post by: rob_c on May 09, 2006, 05:51:36 PM
thanks for all the response guys!  :cheekygreen:

I'm gonna have a concentrated read and assess what direction to take

Rob
Title: Re: MASM on embedded devices?
Post by: rob_c on May 09, 2006, 08:36:18 PM
Quote from: Eugen on May 09, 2006, 04:10:10 PM
I dont know any FREE alternative  :wink. You can check armasm as others suggest, but i dont know if its free.

As eMbedded Visual C++ appears to be free, i guess armasm must be too.

Rob
Title: Re: MASM on embedded devices?
Post by: rob_c on May 09, 2006, 09:38:22 PM
btw, i found this: http://www.fileproperties.com/a/armasm-exe.htm

It gives a description of the files in evc\win4x0\bin\

As I've already used the toolkit to build an app for my target in c++ so it may well be possible that the armasm.exe in there could be the correct assembler for it too!....hopefully.

Rob
Title: Re: MASM on embedded devices?
Post by: Eugen on May 10, 2006, 09:40:36 AM
Quote from: BogdanOntanu on May 09, 2006, 04:22:09 PM
Besides in an ironical way it makes more sense to write ASM only applications for desktop PC's since there is a huge number of then with almost the same CPU and ASM language. On embeded devices the number of devices that share the same CPU and hhardware architecture is much smaller so you will have to port your code/application many times... because of this portability issue a simple C compiler makes more sense in embeded devices

Dont let the voice of reason distract you  :lol, forget about "portability", its more fun to program in asm and see what this ARM CPU is all about  :bg, than to think about a possible but improbable future from the start.(Apparently Bogdan spends too much time in the office lately  :bdg )

Eugen
Title: Re: MASM on embedded devices?
Post by: rob_c on May 10, 2006, 12:19:28 PM
No worries Eugen! I tend to lose interest if there's an easy way to do something anyhow! :wink
Title: Re: MASM on embedded devices?
Post by: BogdanOntanu on May 10, 2006, 04:51:48 PM
Hmmm i do not think you get the hummor :D

For me and I also guess Eugen:
========================
-doing something very easy is doing it in full ASM
-doing something the hard way is doing it in plain ANSI C
-doing it the incredible harder way is doing it in OOP C++ with multiple inheritance and templates
-doing it in the hardest possible way would be doing it in Java or in  C#/.NET

I guess for me only there are 2 extra options:
=================================
-doing it the "still easy" but somehow "twisted strange" way would be: FORTH
-doing it the medium way would be Pascal with some ASM included



Title: Re: MASM on embedded devices?
Post by: Mark Jones on May 10, 2006, 06:34:16 PM
Quote from: Ar-ras on May 09, 2006, 01:13:25 PM
(http://img457.imageshack.us/img457/146/armasm6ro.gif)

"C:\Documents and Settings\WOPR>"   ????? LOL :lol

(For those of you who don't know what WOPR was, (War Operations Planned Response), see: http://features.engadget.com/2004/10/23/movie-gadget-friday-the-w-o-p-r-from-wargames/
Title: Re: MASM on embedded devices?
Post by: rob_c on May 10, 2006, 07:12:10 PM
Quote from: BogdanOntanu on May 10, 2006, 04:51:48 PM
Hmmm i do not think you get the hummor :D

For me and I also guess Eugen:
========================
-doing something very easy is doing it in full ASM
-doing something the hard way is doing it in plain ANSI C
-doing it the incredible harder way is doing it in OOP C++ with multiple inheritance and templates
-doing it in the hardest possible way would be doing it in Java or in  C#/.NET

I guess for me only there are 2 extra options:
=================================
-doing it the "still easy" but somehow "twisted strange" way would be: FORTH
-doing it the medium way would be Pascal with some ASM included


My background is ANSI C for embedded devices. I enjoy programming using ASM but find it more challenging (and it's been years since I had the opportunity to use for my work). I love it for the few windows apps I've had a go at.

Rob
Title: Re: MASM on embedded devices?
Post by: Roger on May 10, 2006, 07:57:57 PM
Quote from: BogdanOntanu on May 10, 2006, 04:51:48 PM
I guess for me only there are 2 extra options:
=================================
-doing it the "still easy" but somehow "twisted strange" way would be: FORTH
FORTH isn't that twisted (and in my humble opinion might suit many on this forum who seem to have this strange idea that programming is actualy meant to be hands on and code should be accessable).

Now for really twisted I have a version of FORTH that I originally wrote in FORTH such that the FORTH code could be assembled by MASM or A86.

BTW If anyone is interested I am translating it into 32bit form for use in my current project .

Regards Roger

PS (You(could(always(try)))(LISP))
Title: Re: MASM on embedded devices?
Post by: vozzie on September 06, 2010, 10:46:21 PM
Building with armasm

download and install eVC4

armasm.exe and link.exe eVC4 locations are...
C:\Program Files\Microsoft eMbedded C++ 4.0\EVC\wce500\bin
C:\Program Files\Microsoft eMbedded C++ 4.0\EVC\wce420\bin
C:\Program Files\Microsoft eMbedded C++ 4.0\EVC\wce410\bin
C:\Program Files\Microsoft eMbedded C++ 4.0\EVC\wce400\bin

Download and install various windows mobile and pocket pc sdk's too

pocket pc 2003 sdk
windows mobile 5.0 sdk
windows mobile 6.0 sdk

When eVC is not installed but Visual Studio is, you can look for armasm in the visual studio directories.

C:\Program Files\Microsoft Visual Studio 8\VC\ce\bin\x86_arm
C:\Program Files\Microsoft Visual Studio 9.0\VC\ce\bin\x86_arm

But when you will get a warning about "mspdb80.dll" missing, you can look for
"mspdb80.dll" and place it in the same directory of "armasm.exe". BUT remove it
after because visual studio was unhappy about it on my computer. After removing
it everything was back normal...


The commandlines are,...

armasm.exe code.asm
armasm.exe -g code.asm

link commandline for a dll is,....

link.exe /DLL /DEF:code.def /MACHINE:ARM /ARMPADCODE /SUBSYSTEM:WINDOWSCE code.obj

i did not build a executable yet but you can find one example of a commandline probably on the internet,...

Also, if you have visual studio you can mix arm assembly with c/c++ in a a project, a easy way to create a arm procedure because you can step thru the asm code...I've download a small project somewhere from the internet, but i don't find it back so  I attached it to this message,...

greetz