Possible ARM Compiler Issue
- From: "Dennis" <dennis.krabbe@xxxxxxxxx>
- Date: 24 Feb 2007 08:14:33 -0800
First let me start of and say that I am not stating that this is
definitely a compiler issue; however, it is suspect. I have written a
driver in Platform Builder 5.0 that uses the SMDK2410 BSP. When the
driver is built in debug, certain sections of code are compiled
correctly and there are no issues (at least with those sections of
code); however, when the driver is a release build, there is an issue
that appears. The issue is that a certain variable is not divided
after a mod operation. This is the line of code: int nX =
((dwPointLocation % Stride()) / 2); In debug, which of course is not
optimized code, the assembly of the algorithm is correctly formed. In
release, which is optimized code, the assembly performs the mod
operation; however, does not follow up with the divide by 2. Now this
statement by itself does work; however, I have developed an
application (Hello World style) that started out with a larger section
of code from my driver and then little by little I removed variables,
using constant values in their place, and removed lines of code in an
effort to have as few lines of code as possible, yet still demonstrate
the issue. The application is a project inside the platform workspace
and is built using Platform Builder 5.0. The OS and application are
then executed on an SMDK2410 reference board.
The first assembler section listing is the section of code that
exhibits the issue. Following that listing is the assembler section
listing the same section of code; however, the keyword 'volatile' is
used on the definition of nX, which causes the value of nX to be
calculated correctly. The final listing is the complete assembler
listing of the simple application.
I should also add that I have built my driver code (exact same source
code) for an x86 system (CEPC) and the calculation of nX is correct in
both the debug and release builds.
I would appreciate any and all help to determine if the issue is
buried somewhere in my logic or if indeed this is a compiler issue.
Also, so that I can move forward with my driver development, should I
just use the keyword 'volatile' on the declaration of nX and force the
compiler to generate the code that correctly computes nX; or am I just
masking the issue that may yield it's ugly head in the future?
Thank you for your assistance,
Dennis
Let me describe the logic. pwLineLocation is a WORD pointer that
points to an area of memory that is allocated in the driver. In this
simple test application, the memory is not allocated; however, that is
not necessary since the memory is never accessed. The value of the
pointer is used in a calculation to determine the X,Y coordinate of
that location in memory. Think of the memory as a grid and each WORD
is a cell in the grid. Therefore, the code is calculating the X and Y
values to point to a cell in the grid. In the code below the
calculation of the Y value was removed during the simplification
process. You will notice that the keyword 'volatile' is commented out;
if the 'volatile' keyword is used, the code is correctly compiled and
the divide operation is included in the assembler code. The function
'Stride()' returns a value of 0x1000. Therefore, the calculation
should yield that nX = 0x15 (21 decimal); however, in the code below
nX = 0x2A (42 decimal). The 'SetInfo()' function outputs the value of
nX and 0 (nY prior to simplification) using a RETAILMSG; hence the
branch to NKDbgPrintfW. The instruction bx r3 at address 00080 is the
jump to the __rt_udiv function in COREDLL that performs the mod
operation.
; 162 : // 0x44900000 + 0x8a * 0x800 + 0x15
; 163 : WORD* pwLineLocation = (WORD*) 0x4498a02a;
; 164 :
; 165 : DWORD dwPointLocation = ((DWORD) pwLineLocation - (DWORD)
0x44900000);
; 166 :
; 167 : /*volatile*/ int nX = ((dwPointLocation % Stride()) / 2);
00060 e59f308c ldr r3, [pc, #0x8C]
00064 e59f2084 ldr r2, [pc, #0x84]
00068 e1a04000 mov r4, r0
0006c e5930000 ldr r0, [r3]
00070 e5923000 ldr r3, [r2]
00074 e3a01a8a mov r1, #0x8A, 20
00078 e381102a orr r1, r1, #0x2A
; 168 :
; 169 : SetInfo(nX, 0, 2, pwLineLocation);
0007c e1a0e00f mov lr, pc
00080 e12fff13 bx r3
00084 e1a03000 mov r3, r0
00088 e59f005c ldr r0, [pc, #0x5C]
0008c e3a02000 mov r2, #0
00090 eb000000 bl NKDbgPrintfW
Assembler listing with the keyword 'volatile' uncommented. This code
correctly computes nX to be 0x15 (21 decimal).
; 162 : // 0x44900000 + 0x8a * 0x800 + 0x15
; 163 : WORD* pwLineLocation = (WORD*) 0x4498a02a;
; 164 :
; 165 : DWORD dwPointLocation = ((DWORD) pwLineLocation - (DWORD)
0x44900000);
; 166 :
; 167 : volatile int nX = ((dwPointLocation % Stride()) / 2);
00060 e59f3098 ldr r3, [pc, #0x98]
00064 e59f2090 ldr r2, [pc, #0x90]
00068 e1a04000 mov r4, r0
0006c e5930000 ldr r0, [r3]
00070 e5923000 ldr r3, [r2]
00074 e3a01a8a mov r1, #0x8A, 20
00078 e381102a orr r1, r1, #0x2A
0007c e1a0e00f mov lr, pc
00080 e12fff13 bx r3
00084 e1a030a1 mov r3, r1, lsr #1
00088 e58d3004 str r3, [sp, #4]
0008c e1a03000 mov r3, r0
; 168 :
; 169 : SetInfo(nX, 0, 2, pwLineLocation);
00090 e59d1004 ldr r1, [sp, #4]
00094 e59f005c ldr r0, [pc, #0x5C]
00098 e3a02000 mov r2, #0
0009c eb000000 bl NKDbgPrintfW
Complete application assembler listing.
; Listing generated by Microsoft (R) Optimizing Compiler Version
13.10.4237
TTL C:\WINCE500\PBWorkspaces\XXXXX\ArmIssue\.\ArmIssue.cpp
CODE32
00000 AREA |.drectve|, DRECTVE
DCB "-INCLUDE:__@@_PchSym_@00@UdrmxvFAAUkydliphkzxvhUklxlDUzi"
DCB "nrhhfvUlyqUzineErUivgzroUhgwzucOlyq@ArmIssue "
DCB "-defaultlib:coredll.lib "
DCB "-defaultlib:corelibc.lib "
EXPORT |?hInst@@3PAUHINSTANCE__@@A| [ DATA ] ; hInst
EXPORT |?szTitle@@3PAGA| [ DATA ] ; szTitle
EXPORT |?szWindowClass@@3PAGA| [ DATA ] ; szWindowClass
EXPORT |?g_nStrideBytes@@3HA| [ DATA ] ; g_nStrideBytes
EXPORT |?g_pVirtualAddress@@3KA| [ DATA ] ; g_pVirtualAddress
EXPORT |?g_nOffset@@3KA| [ DATA ] ; g_nOffset
00000 AREA |.bss|, NOINIT
|?hInst@@3PAUHINSTANCE__@@A| % 0x4 ; hInst
|?szTitle@@3PAGA| % 0xc8 ; szTitle
|?szWindowClass@@3PAGA| % 0xc8 ; szWindowClass
|?g_nOffset@@3KA| % 0x4 ; g_nOffset
00000 AREA |.data|, DATA
|?g_pVirtualAddress@@3KA| DCD 0x44900000 ; g_pVirtualAddress
|?g_nStrideBytes@@3HA| DCD 0x1000 ; g_nStrideBytes
EXPORT |?InitInstance@@YAHPAUHINSTANCE__@@H@Z| ; InitInstance
IMPORT |CreateWindowExW|
IMPORT |ShowWindow|
IMPORT |UpdateWindow|
; File c:\wince500\pbworkspaces\xxxxx\armissue\armissue.cpp
00000 AREA |.text| { |?InitInstance@@YAHPAUHINSTANCE__@@H@Z| },
CODE, ARM, SELECTION=1 ; comdat noduplicate
00000 AREA |.pdata$$?InitInstance@@YAHPAUHINSTANCE__@@H@Z|,
PDATA, SELECTION=5, ASSOC=|.text| { |?
InitInstance@@YAHPAUHINSTANCE__@@H@Z| } ; comdat associative
|$T26798| DCD |$L26797|
DCD 0x40002202
; Function compile flags: /Ogsy
00000 AREA |.text| { |?InitInstance@@YAHPAUHINSTANCE__@@H@Z| },
CODE, ARM, SELECTION=1 ; comdat noduplicate
00000 |?InitInstance@@YAHPAUHINSTANCE__@@H@Z| PROC ; InitInstance
; 104 : {
00000 |$L26797|
00000 e92d40f0 stmdb sp!, {r4 - r7, lr}
00004 e24dd020 sub sp, sp, #0x20
00008 |$M26795|
00008 e1a05001 mov r5, r1
0000c e1a04000 mov r4, r0
; 105 : HWND hWnd;
; 106 :
; 107 : hInst = hInstance; // Store instance handle in our global
variable
00010 e59fe06c ldr lr, [pc, #0x6C]
; 108 :
; 109 : hWnd = CreateWindow(szWindowClass, szTitle, WS_VISIBLE,
; 110 : 0, 0, CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL,
hInstance, NULL);
00014 e3a07000 mov r7, #0
00018 e3a06102 mov r6, #2, 2
0001c e28e2008 add r2, lr, #8
00020 e28e10d0 add r1, lr, #0xD0
00024 e3a03201 mov r3, #1, 4
00028 e3a00000 mov r0, #0
0002c e58e4000 str r4, [lr]
00030 e58d701c str r7, [sp, #0x1C]
00034 e58d4018 str r4, [sp, #0x18]
00038 e58d7014 str r7, [sp, #0x14]
0003c e58d7010 str r7, [sp, #0x10]
00040 e58d600c str r6, [sp, #0xC]
00044 e58d6008 str r6, [sp, #8]
00048 e58d7004 str r7, [sp, #4]
0004c e58d7000 str r7, [sp]
00050 eb000000 bl CreateWindowExW
00054 e1b04000 movs r4, r0
; 111 :
; 112 : if (!hWnd)
; 113 : {
; 114 : return FALSE;
00058 03a00000 moveq r0, #0
0005c 0a000005 beq |$L26729|
; 115 : }
; 116 :
; 117 : ShowWindow(hWnd, nCmdShow);
00060 e1a01005 mov r1, r5
00064 e1a00004 mov r0, r4
00068 eb000000 bl ShowWindow
; 118 : UpdateWindow(hWnd);
0006c e1a00004 mov r0, r4
00070 eb000000 bl UpdateWindow
; 119 :
; 120 : return TRUE;
00074 e3a00001 mov r0, #1
00078 |$L26729|
; 121 : }
00078 e28dd020 add sp, sp, #0x20
0007c e8bd40f0 ldmia sp!, {r4 - r7, lr}
00080 e12fff1e bx lr
00084 |$L26800|
00084 00000000 DCD |?hInst@@3PAUHINSTANCE__@@A|
00088 |$M26796|
ENDP ; |?InitInstance@@YAHPAUHINSTANCE__@@H@Z|, InitInstance
EXPORT |?Stride@@YAHXZ| ; Stride
00000 AREA |.text| { |?Stride@@YAHXZ| }, CODE, ARM,
SELECTION=1 ; comdat noduplicate
00000 AREA |.pdata$$?Stride@@YAHXZ|, PDATA, SELECTION=5,
ASSOC=|.text| { |?Stride@@YAHXZ| } ; comdat associative
|$T26808| DCD |$L26807|
DCD 0x40000400
; Function compile flags: /Ogsy
00000 AREA |.text| { |?Stride@@YAHXZ| }, CODE, ARM,
SELECTION=1 ; comdat noduplicate
00000 |?Stride@@YAHXZ| PROC ; Stride
; 124 : {
00000 |$L26807|
00000 |$M26805|
; 125 : return g_nStrideBytes;
00000 e59f3004 ldr r3, [pc, #4]
00004 e5930000 ldr r0, [r3]
; 126 : }
00008 e12fff1e bx lr
0000c |$L26810|
0000c 00000000 DCD |?g_nStrideBytes@@3HA|
00010 |$M26806|
ENDP ; |?Stride@@YAHXZ|, Stride
EXPORT |?SetInfo@@YAXHHHPAG@Z| ; SetInfo
EXPORT |??_C@_1BK@PABADJOA@?$AAn?$AAX?$AA?$DN?$AA?$CF?$AAd?$AA?0?$AA?
5?$AAn?$AAY?$AA?$DN?$AA?$CF?$AAd?$AA?$AA@| [ DATA ] ; `string'
IMPORT |NKDbgPrintfW|
00000 AREA |.text| { |?SetInfo@@YAXHHHPAG@Z| }, CODE, ARM,
SELECTION=1 ; comdat noduplicate
00000 AREA |.pdata$$?SetInfo@@YAXHHHPAG@Z|, PDATA, SELECTION=5,
ASSOC=|.text| { |?SetInfo@@YAXHHHPAG@Z| } ; comdat associative
|$T26820| DCD |$L26819|
DCD 0x40000801
00000 AREA |.rdata| { |??_C@_1BK@PABADJOA@?$AAn?$AAX?$AA?$DN?$AA?
$CF?$AAd?$AA?0?$AA?5?$AAn?$AAY?$AA?$DN?$AA?$CF?$AAd?$AA?$AA@| }, DATA,
READONLY, SELECTION=2 ; comdat any
|??_C@_1BK@PABADJOA@?$AAn?$AAX?$AA?$DN?$AA?$CF?$AAd?$AA?0?$AA?5?$AAn?
$AAY?$AA?$DN?$AA?$CF?$AAd?$AA?$AA@| DCB "n"
DCB 0x0, "X", 0x0, "=", 0x0, "%", 0x0, "d", 0x0, ",", 0x0, " "
DCB 0x0, "n", 0x0, "Y", 0x0, "=", 0x0, "%", 0x0, "d", 0x0, 0x0
DCB 0x0 ; `string'
; Function compile flags: /Ogsy
00000 AREA |.text| { |?SetInfo@@YAXHHHPAG@Z| }, CODE, ARM,
SELECTION=1 ; comdat noduplicate
00000 |?SetInfo@@YAXHHHPAG@Z| PROC ; SetInfo
; 130 : {
00000 |$L26819|
00000 e52de004 str lr, [sp, #-4]!
00004 |$M26817|
00004 e1a02001 mov r2, r1
00008 e1a01000 mov r1, r0
; 131 : RETAILMSG(1, (TEXT("nX=%d, nY=%d"), nX, nY));
0000c e59f0008 ldr r0, [pc, #8]
00010 eb000000 bl NKDbgPrintfW
; 132 :
; 133 : //TCHAR szMsg[100];
; 134 : //_stprintf(szMsg, TEXT("nX=%d, nY=%d"), nX, nY);
; 135 : //MessageBox(NULL, szMsg, TEXT("Debug"), MB_OK);
; 136 : }
00014 e49de004 ldr lr, [sp], #4
00018 e12fff1e bx lr
0001c |$L26822|
0001c 00000000 DCD |??_C@_1BK@PABADJOA@?$AAn?$AAX?$AA?$DN?
$AA?$CF?$AAd?$AA?0?$AA?5?$AAn?$AAY?$AA?$DN?$AA?$CF?$AAd?$AA?$AA@|
00020 |$M26818|
ENDP ; |?SetInfo@@YAXHHHPAG@Z|, SetInfo
EXPORT |?WndProc@@YAJPAUHWND__@@IIJ@Z| ; WndProc
IMPORT |__imp___rt_udiv|
IMPORT |wcslen|
IMPORT |PostQuitMessage|
IMPORT |GetClientRect|
IMPORT |DrawTextW|
IMPORT |BeginPaint|
IMPORT |EndPaint|
IMPORT |LoadStringW|
IMPORT |DefWindowProcW|
00000 AREA |.text| { |?WndProc@@YAJPAUHWND__@@IIJ@Z| }, CODE,
ARM, SELECTION=1 ; comdat noduplicate
00000 AREA |.pdata$$?WndProc@@YAJPAUHWND__@@IIJ@Z|, PDATA,
SELECTION=5, ASSOC=|.text| { |?WndProc@@YAJPAUHWND__@@IIJ@Z| } ;
comdat associative
|$T26850| DCD |$L26849|
DCD 0x40004202
; Function compile flags: /Ogsy
00000 AREA |.text| { |?WndProc@@YAJPAUHWND__@@IIJ@Z| }, CODE,
ARM, SELECTION=1 ; comdat noduplicate
00000 |?WndProc@@YAJPAUHWND__@@IIJ@Z| PROC ; WndProc
; 150 : {
00000 |$L26849|
00000 e92d40f0 stmdb sp!, {r4 - r7, lr}
00004 e24ddf49 sub sp, sp, #0x49, 30
00008 |$M26847|
00008 e1a06003 mov r6, r3
0000c e1a07002 mov r7, r2
00010 e1a04001 mov r4, r1
00014 e1a05000 mov r5, r0
; 151 : PAINTSTRUCT ps;
; 152 : HDC hdc;
; 153 : TCHAR szHello[MAX_LOADSTRING];
; 154 : LoadString(hInst, IDS_HELLO, szHello, MAX_LOADSTRING);
00018 e59fe0e4 ldr lr, [pc, #0xE4]
0001c e3a03064 mov r3, #0x64
00020 e28d205c add r2, sp, #0x5C
00024 e59e0000 ldr r0, [lr]
00028 e3a0106a mov r1, #0x6A
0002c eb000000 bl LoadStringW
; 155 :
; 156 : switch (message)
00030 e3540002 cmp r4, #2
00034 0a000029 beq |$L26764|
00038 e354000f cmp r4, #0xF
; 179 : break;
; 180 : default:
; 181 : return DefWindowProc(hWnd, message, wParam, lParam);
0003c e1a00005 mov r0, r5
00040 0a000004 beq |$L26756|
00044 e1a03006 mov r3, r6
00048 e1a02007 mov r2, r7
0004c e1a01004 mov r1, r4
00050 eb000000 bl DefWindowProcW
00054 ea000024 b |$L26748|
00058 |$L26756|
; 157 : {
; 158 : case WM_PAINT:
; 159 : hdc = BeginPaint(hWnd, &ps);
00058 e28d101c add r1, sp, #0x1C
0005c eb000000 bl BeginPaint
; 160 : // TODO: Add any drawing code here...
; 161 : {
; 162 : // 0x44900000 + 0x8a * 0x800 + 0x15
; 163 : WORD* pwLineLocation = (WORD*) 0x4498a02a;
; 164 :
; 165 : DWORD dwPointLocation = ((DWORD) pwLineLocation - (DWORD)
0x44900000);
; 166 :
; 167 : volatile int nX = ((dwPointLocation % Stride()) / 2);
00060 e59f3098 ldr r3, [pc, #0x98]
00064 e59f2090 ldr r2, [pc, #0x90]
00068 e1a04000 mov r4, r0
0006c e5930000 ldr r0, [r3]
00070 e5923000 ldr r3, [r2]
00074 e3a01a8a mov r1, #0x8A, 20
00078 e381102a orr r1, r1, #0x2A
0007c e1a0e00f mov lr, pc
00080 e12fff13 bx r3
00084 e1a030a1 mov r3, r1, lsr #1
00088 e58d3004 str r3, [sp, #4]
0008c e1a03000 mov r3, r0
; 168 :
; 169 : SetInfo(nX, 0, 2, pwLineLocation);
00090 e59d1004 ldr r1, [sp, #4]
00094 e59f005c ldr r0, [pc, #0x5C]
00098 e3a02000 mov r2, #0
0009c eb000000 bl NKDbgPrintfW
; 170 : }
; 171 :
; 172 : RECT rt;
; 173 : GetClientRect(hWnd, &rt);
000a0 e28d100c add r1, sp, #0xC
000a4 e1a00005 mov r0, r5
000a8 eb000000 bl GetClientRect
; 174 : DrawText(hdc, szHello, _tcslen(szHello), &rt, DT_CENTER);
000ac e28d005c add r0, sp, #0x5C
000b0 eb000000 bl wcslen
000b4 e1a02000 mov r2, r0
000b8 e3a0e001 mov lr, #1
000bc e1a00004 mov r0, r4
000c0 e28d300c add r3, sp, #0xC
000c4 e28d105c add r1, sp, #0x5C
000c8 e58de000 str lr, [sp]
000cc eb000000 bl DrawTextW
; 175 : EndPaint(hWnd, &ps);
000d0 e28d101c add r1, sp, #0x1C
000d4 e1a00005 mov r0, r5
000d8 eb000000 bl EndPaint
; 176 : break;
000dc ea000001 b |$L26753|
000e0 |$L26764|
; 177 : case WM_DESTROY:
; 178 : PostQuitMessage(0);
000e0 e3a00000 mov r0, #0
000e4 eb000000 bl PostQuitMessage
000e8 |$L26753|
; 182 : }
; 183 : return 0;
000e8 e3a00000 mov r0, #0
000ec |$L26748|
; 184 : }
000ec e28ddf49 add sp, sp, #0x49, 30
000f0 e8bd40f0 ldmia sp!, {r4 - r7, lr}
000f4 e12fff1e bx lr
000f8 |$L26852|
000f8 00000000 DCD |??_C@_1BK@PABADJOA@?$AAn?$AAX?$AA?$DN?
$AA?$CF?$AAd?$AA?0?$AA?5?$AAn?$AAY?$AA?$DN?$AA?$CF?$AAd?$AA?$AA@|
000fc 00000000 DCD |__imp___rt_udiv|
00100 00000000 DCD |?g_nStrideBytes@@3HA|
00104 00000000 DCD |?hInst@@3PAUHINSTANCE__@@A|
00108 |$M26848|
ENDP ; |?WndProc@@YAJPAUHWND__@@IIJ@Z|, WndProc
EXPORT |?MyRegisterClass@@YAGPAUHINSTANCE__@@@Z| ; MyRegisterClass
IMPORT |GetStockObject|
IMPORT |RegisterClassW|
00000 AREA |.text| { |?
MyRegisterClass@@YAGPAUHINSTANCE__@@@Z| }, CODE, ARM, SELECTION=1 ;
comdat noduplicate
00000 AREA |.pdata$$?MyRegisterClass@@YAGPAUHINSTANCE__@@@Z|,
PDATA, SELECTION=5, ASSOC=|.text| { |?
MyRegisterClass@@YAGPAUHINSTANCE__@@@Z| } ; comdat associative
|$T26861| DCD |$L26860|
DCD 0x40002102
; Function compile flags: /Ogsy
00000 AREA |.text| { |?
MyRegisterClass@@YAGPAUHINSTANCE__@@@Z| }, CODE, ARM, SELECTION=1 ;
comdat noduplicate
00000 |?MyRegisterClass@@YAGPAUHINSTANCE__@@@Z| PROC ;
MyRegisterClass
; 76 : {
00000 |$L26860|
00000 e92d4070 stmdb sp!, {r4 - r6, lr}
00004 e24dd028 sub sp, sp, #0x28
00008 |$M26858|
00008 e1a02000 mov r2, r0
; 77 : WNDCLASS wc;
; 78 :
; 79 : wc.style = CS_HREDRAW | CS_VREDRAW;
; 80 : wc.lpfnWndProc = (WNDPROC) WndProc;
0000c e59f306c ldr r3, [pc, #0x6C]
00010 e3a01003 mov r1, #3
; 81 : wc.cbClsExtra = 0;
00014 e3a0e000 mov lr, #0
; 82 : wc.cbWndExtra = 0;
00018 e3a04000 mov r4, #0
; 83 : wc.hInstance = hInstance;
; 84 : wc.hIcon = 0;
0001c e3a05000 mov r5, #0
; 85 : wc.hCursor = 0;
00020 e3a06000 mov r6, #0
; 86 : wc.hbrBackground = (HBRUSH) GetStockObject(WHITE_BRUSH);
00024 e3a00000 mov r0, #0
00028 e58d3004 str r3, [sp, #4]
0002c e58d1000 str r1, [sp]
00030 e58de008 str lr, [sp, #8]
00034 e58d400c str r4, [sp, #0xC]
00038 e58d2010 str r2, [sp, #0x10]
0003c e58d5014 str r5, [sp, #0x14]
00040 e58d6018 str r6, [sp, #0x18]
00044 eb000000 bl GetStockObject
; 87 : wc.lpszMenuName = 0;
; 88 : wc.lpszClassName = szWindowClass;
00048 e59f302c ldr r3, [pc, #0x2C]
0004c e1a02000 mov r2, r0
00050 e3a01000 mov r1, #0
; 89 :
; 90 : return RegisterClass(&wc);
00054 e28d0000 add r0, sp, #0
00058 e58d3024 str r3, [sp, #0x24]
0005c e58d201c str r2, [sp, #0x1C]
00060 e58d1020 str r1, [sp, #0x20]
00064 eb000000 bl RegisterClassW
00068 e1a00800 mov r0, r0, lsl #16
0006c e1a00820 mov r0, r0, lsr #16
; 91 : }
00070 e28dd028 add sp, sp, #0x28
00074 e8bd4070 ldmia sp!, {r4 - r6, lr}
00078 e12fff1e bx lr
0007c |$L26863|
0007c 00000000 DCD |?szWindowClass@@3PAGA|
00080 00000000 DCD |?WndProc@@YAJPAUHWND__@@IIJ@Z|
00084 |$M26859|
ENDP ; |?MyRegisterClass@@YAGPAUHINSTANCE__@@@Z|, MyRegisterClass
EXPORT |WinMain|
IMPORT |GetMessageW|
IMPORT |TranslateMessage|
IMPORT |DispatchMessageW|
IMPORT |LoadAcceleratorsW|
IMPORT |TranslateAcceleratorW|
00000 AREA |.text| { |WinMain| }, CODE, ARM, SELECTION=1 ;
comdat noduplicate
00000 AREA |.pdata$$WinMain|, PDATA, SELECTION=5, ASSOC=|.text|
{ |WinMain| } ; comdat associative
|$T26876| DCD |$L26875|
DCD 0x40003102
; Function compile flags: /Ogsy
00000 AREA |.text| { |WinMain| }, CODE, ARM, SELECTION=1 ;
comdat noduplicate
00000 |WinMain| PROC
; 29 : {
00000 |$L26875|
00000 e92d4070 stmdb sp!, {r4 - r6, lr}
00004 e24dd01c sub sp, sp, #0x1C
00008 |$M26873|
00008 e1a05003 mov r5, r3
0000c e1a06000 mov r6, r0
; 30 : // TODO: Place code here.
; 31 : MSG msg;
; 32 : HACCEL hAccelTable;
; 33 :
; 34 : // Initialize global strings
; 35 : LoadString(hInstance, IDS_APP_TITLE, szTitle,
MAX_LOADSTRING);
00010 e59f40a8 ldr r4, [pc, #0xA8]
00014 e3a03064 mov r3, #0x64
00018 e3a01067 mov r1, #0x67
0001c e1a02004 mov r2, r4
00020 eb000000 bl LoadStringW
; 36 : LoadString(hInstance, IDC_ArmIssue, szWindowClass,
MAX_LOADSTRING);
00024 e3a03064 mov r3, #0x64
00028 e28420c8 add r2, r4, #0xC8
0002c e3a0106d mov r1, #0x6D
00030 e1a00006 mov r0, r6
00034 eb000000 bl LoadStringW
; 37 : MyRegisterClass(hInstance);
00038 e1a00006 mov r0, r6
0003c eb000000 bl |?
MyRegisterClass@@YAGPAUHINSTANCE__@@@Z|
; 38 :
; 39 : // Perform application initialization:
; 40 : if (!InitInstance (hInstance, nCmdShow))
00040 e1a01005 mov r1, r5
00044 e1a00006 mov r0, r6
00048 eb000000 bl |?InitInstance@@YAHPAUHINSTANCE__@@H@Z|
0004c e3500000 cmp r0, #0
; 41 : {
; 42 : return FALSE;
00050 03a00000 moveq r0, #0
00054 0a000016 beq |$L26711|
; 43 : }
; 44 :
; 45 : hAccelTable = LoadAccelerators(hInstance,
(LPCTSTR)IDC_ArmIssue);
00058 e3a0106d mov r1, #0x6D
0005c e1a00006 mov r0, r6
00060 eb000000 bl LoadAcceleratorsW
00064 e1a04000 mov r4, r0
; 46 :
; 47 : // Main message loop:
; 48 : while (GetMessage(&msg, NULL, 0, 0))
00068 ea000009 b |$L26719|
0006c |$L26717|
; 49 : {
; 50 : if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg))
0006c e59d0000 ldr r0, [sp]
00070 e28d2000 add r2, sp, #0
00074 e1a01004 mov r1, r4
00078 eb000000 bl TranslateAcceleratorW
0007c e3500000 cmp r0, #0
00080 1a000003 bne |$L26719|
; 51 : {
; 52 : TranslateMessage(&msg);
00084 e28d0000 add r0, sp, #0
00088 eb000000 bl TranslateMessage
; 53 : DispatchMessage(&msg);
0008c e28d0000 add r0, sp, #0
00090 eb000000 bl DispatchMessageW
00094 |$L26719|
00094 e3a03000 mov r3, #0
00098 e3a02000 mov r2, #0
0009c e3a01000 mov r1, #0
000a0 e28d0000 add r0, sp, #0
000a4 eb000000 bl GetMessageW
000a8 e3500000 cmp r0, #0
000ac 1affffee bne |$L26717|
; 54 : }
; 55 : }
; 56 :
; 57 : return msg.wParam;
000b0 e59d0008 ldr r0, [sp, #8]
000b4 |$L26711|
; 58 : }
000b4 e28dd01c add sp, sp, #0x1C
000b8 e8bd4070 ldmia sp!, {r4 - r6, lr}
000bc e12fff1e bx lr
000c0 |$L26878|
000c0 00000000 DCD |?szTitle@@3PAGA|
000c4 |$M26874|
ENDP ; |WinMain|
END
.
- Follow-Ups:
- RE: Possible ARM Compiler Issue
- From: Benedetto Proietti
- RE: Possible ARM Compiler Issue
- Prev by Date: lan 91c111 allocation and device.exe and interrupt problem
- Next by Date: WMMX registers mangled after a context switch
- Previous by thread: lan 91c111 allocation and device.exe and interrupt problem
- Next by thread: RE: Possible ARM Compiler Issue
- Index(es):
Relevant Pages
|