x
This website is using cookies. We use cookies to ensure that we give you the best experience on our website. More info. That's Fine
HPC:Factor Logo 
 
Latest Forum Activity

Asm development for the Jornada 720/728

can't remember Page Icon Posted 2020-09-08 4:17 AM
#
Avatar image of can't remember
Factorite (Junior)

Posts:
39
Status:
Hi, I'm new here. I haven't seen this mentioned in the forum so I figured the information may be useful for some of you. Here you can download FASMARM, an assembler that can generate PE executables that can run on the Jornada 720/728 without any hex editing. It's easy to use, to compile one of the samples just open FASMWARM.EXE, then drag and drop (or use the File>Open menu) one of the files in EXAMPLES/ARMPE, open the Run menu and then Compile.
There's a missing file (MACRO\RESOURCE.INC) so the sample files 2, 3 and 4 won't compile by default. You can find the missing file in this archived version of FASM, copy it from that zip to your INCLUDE\MACRO folder.
The first 3 samples are just different ways to demonstrate how to open a message box, but you can of course do more if you know ARMv4 assembly and have access to the Windows CE SDK documentation. Read the .INC files in INCLUDE, they have useful documentation, especially PROCAPS.INC which describes the calling convention used by Windows CE on ARM.
I couldn't get the sample 4 to work, without access to a debugger or any error messages that won't be easy for me (I'm new to both ARM and WinCE).
 Top of the page
smb_gaiden Page Icon Posted 2020-09-08 5:09 PM
#
Avatar image of smb_gaiden
Factorite (Elite)

Posts:
212
Status:
Good find, thank you. Added to my list of future projects after tcc and windres. Future idea is to cross compile the compiler itself to Windows CE ARM, so it can self host so one could write the software in ASM on the ARM machine that runs on the ARM machine.
 Top of the page
can't remember Page Icon Posted 2020-09-10 4:15 PM
#
Avatar image of can't remember
Factorite (Junior)

Posts:
39
Status:
Quote
smb_gaiden - 2020-09-09 1:09 PM

Future idea is to cross compile the compiler itself to Windows CE ARM


I've been trying that but no success so far, it won't be easy but it may not be very hard. I didn't have much time to experiment (only a few hours today). You definitely want a modern GCC 9 for Windows CE development, it compiles just fine on Debian Sid, just make sure you have all GCC dependencies (like bison and flex) installed before compiling. If the build script gives you an error due to a missing dependency, install what's missing, delete all files and folders in your temp compilation directory and try again. After I got that working (and could get a messagebox test exe to compile and run with no hex editing or modifications) I tried to compile something a little more complex, the latest stable tcc but I ran into a problem (this to be more exact, ctrl+f errno.h). So we need write (and emulate) our own errno.h and direct.h using Windows CE functions if we want to compile tcc for Windows CE. I hope that isn't a very complex task but I don't have much time today to continue experimenting.

Edit: just thinking out loud, the functions GetLastError , SetLastError and FormatMessage in winbase.h may be of use.

Edited by can't remember 2020-09-10 4:39 PM
 Top of the page
smb_gaiden Page Icon Posted 2020-09-10 5:13 PM
#
Avatar image of smb_gaiden
Factorite (Elite)

Posts:
212
Status:
Quote
can't remember - 2020-09-10 8:15 AM

After I got that working (and could get a messagebox test exe to compile and run with no hex editing or modifications) I tried to compile something a little more complex, the latest stable tcc but I ran into a problem (this to be more exact, ctrl+f errno.h). So we need write (and emulate) our own errno.h and direct.h using Windows CE functions if we want to compile tcc for Windows CE. I hope that isn't a very complex task but I don't have much time today to continue experimenting.


Nice work!

By the way, I've have gotten tcc to run on windows ce and produce a valid exe for the machine it was run on. Jornada 820. Also tested on a windows phone and a windowsce 6.0 netbook successfully. Used EVC3.0 to compile the tcc package. Also succeeded on getting windres working on WinCE. The TCC stuff starts here:
https://www.hpcfactor.com/forums/forums/thread-view.asp?tid=18434&st...

The windres info is on the next page of the same thread.
 Top of the page
can't remember Page Icon Posted 2020-09-10 5:48 PM
#
Avatar image of can't remember
Factorite (Junior)

Posts:
39
Status:
Quote
smb_gaiden - 2020-09-11 1:13 PM
Nice work!

By the way, I've have gotten tcc to run on windows ce and produce a valid exe for the machine it was run on. Jornada 820. Also tested on a windows phone and a windowsce 6.0 netbook successfully. Used EVC3.0 to compile the tcc package. Also succeeded on getting windres working on WinCE. The TCC stuff starts here:
https://www.hpcfactor.com/forums/forums/thread-view.asp?tid=18434&st...

The windres info is on the next page of the same thread.


I'm using a Jornada 728, before finding cegcc (the new one, not the old one in SF) I tried following your steps in that thread but got stuck at step 10 (I don't have the HPC2000 SDK and tcc can't produce working executables*). Thank you for all the info you posted there, that's going to be useful for my own adventures with tcc. Btw if you need .def files for your tcc you can copy them from here (I haven't tested that yet so no warranties). Adapting the .h files from here may also be a good idea to have a decent working tcc SDK for WinCE.

*Now that I think about that I may be able to do the same but comparing cegcc's output to tcc's.
 Top of the page
smb_gaiden Page Icon Posted 2020-09-10 6:06 PM
#
Avatar image of smb_gaiden
Factorite (Elite)

Posts:
212
Status:
Quote
can't remember - 2020-09-10 9:48 AM

Btw if you need .def files for your tcc you can copy them from here (I haven't tested that yet so no warranties). Adapting the .h files from here may also be a good idea to have a decent working tcc SDK for WinCE.

*Now that I think about that I may be able to do the same but comparing cegcc's output to tcc's.


thank you. Used a different approach for the def files. Wrote a program to use dumpbin to list out the exports of all the libraries in the SDK lib folder and then parse the output to write out the def files.
 Top of the page
Jump to forum:
Seconds to generate: 0.187 - Cached queries : 62 - Executed queries : 10