The smallest program for Pocket PC
October 17th, 2006 by Yaroslav Goncharov
Alexander Dovgaluk has created the smallest program for Pocket PC I have ever seen. How big is the program? Only 352 bytes. Despite of its small size it has rich functionality. Well, not really. Still the program is almost as good as a classic “Hello World”. It salutes you with a message box saying “Msg”.
The program features a few tricks such as moving code to the MZ header and using SysCall directly for calling system APIs. Interested in details? Download the program or see the complete ARM assembly language listing below:
[code:1:a76dbe5ecc]
CODE32
EXPORT |Main|
AREA |.text|, CODE, ARM
|Main| PROC
stmfd sp!, {r0-r8,lr}
add r0, sp, #4
str r0, [sp]
mov r0, #0
add r1, pc, #0x18
mov r2, r1
mov r3, #0x40
mov lr, pc
ldr pc, |MessageBoxW|
add sp, sp, #0x20
ldmfd sp!, {pc}
ENDP
|MessageBoxW| dcd (0xF0010000 - (0x11 << 8 + 0x32) * 4)
|msg| dcb "m", 0, "s", 0, "g", 0, 0, 0
END
[/code:1:a76dbe5ecc]
