main.asm
来自「开放源码的编译器open watcom 1.6.0版的源代码」· 汇编 代码 · 共 1,574 行 · 第 1/5 页
ASM
1,574 行
.386p
NAME main
EXTRN __argc :BYTE
EXTRN _cstart_ :BYTE
EXTRN MsgPrintf1_ :BYTE
EXTRN InputQueueLine_ :BYTE
EXTRN AsmError_ :BYTE
EXTRN strcat_ :BYTE
EXTRN strchr_ :BYTE
EXTRN strncpy_ :BYTE
EXTRN stackavail_ :BYTE
EXTRN strcspn_ :BYTE
EXTRN AddStringToIncludePath_ :BYTE
EXTRN PushLineQueue_ :BYTE
EXTRN StoreConstant_ :BYTE
EXTRN AsmScan_ :BYTE
EXTRN _AsmBuffer :BYTE
EXTRN getenv_ :BYTE
EXTRN strcpy_ :BYTE
EXTRN AsmAlloc_ :BYTE
EXTRN strlen_ :BYTE
EXTRN _makepath_ :BYTE
EXTRN _splitpath2_ :BYTE
EXTRN MsgGet_ :BYTE
EXTRN DelErrFile_ :BYTE
EXTRN ObjWriteOpen_ :BYTE
EXTRN Fatal_ :BYTE
EXTRN fopen_ :BYTE
EXTRN MemFini_ :BYTE
EXTRN AsmShutDown_ :BYTE
EXTRN GenMSOmfFini_ :BYTE
EXTRN GenMSOmfInit_ :BYTE
EXTRN ObjRecInit_ :BYTE
EXTRN MemInit_ :BYTE
EXTRN AsmFree_ :BYTE
EXTRN printf_ :BYTE
EXTRN PrintfUsage_ :BYTE
EXTRN MsgFini_ :BYTE
EXTRN WriteObjModule_ :BYTE
EXTRN AsmInit_ :BYTE
EXTRN exit_ :BYTE
EXTRN MsgInit_ :BYTE
EXTRN tolower_ :BYTE
EXTRN __IsTable :BYTE
EXTRN __CHK :BYTE
DGROUP GROUP CONST,CONST2,_DATA,_BSS
_TEXT SEGMENT BYTE PUBLIC USE32 'CODE'
ASSUME CS:_TEXT ,DS:DGROUP,SS:DGROUP
PUBLIC main_
PUBLIC trademark_
PUBLIC ProcessCmdlineOptions_
PUBLIC AsmQueryExternal_
PUBLIC AsmQueryType_
isvalidident_: push ebp
mov ebp,esp
push 0000002cH
call near ptr __CHK
push ebx
push ecx
push edx
push esi
push edi
sub esp,00000010H
mov dword ptr [ebp]-24H,eax
mov eax,dword ptr [ebp]-24H
mov al,byte ptr [eax]
inc al
and eax,000000ffH
test byte ptr __IsTable[eax],20H
je short L1
mov dword ptr [ebp]-20H,0ffffffffH
jmp near ptr L19
L1: mov eax,dword ptr [ebp]-24H
mov dword ptr [ebp]-1cH,eax
L2: mov eax,dword ptr [ebp]-1cH
cmp byte ptr [eax],00H
jne short L4
jmp near ptr L18
L3: mov eax,dword ptr [ebp]-1cH
inc dword ptr [ebp]-1cH
jmp short L2
L4: mov eax,dword ptr [ebp]-1cH
mov al,byte ptr [eax]
and eax,000000ffH
call near ptr tolower_
mov byte ptr [ebp]-18H,al
cmp byte ptr [ebp]-18H,5fH
je short L5
cmp byte ptr [ebp]-18H,2eH
jne short L6
L5: jmp short L7
L6: cmp byte ptr [ebp]-18H,24H
jne short L8
L7: jmp short L9
L8: cmp byte ptr [ebp]-18H,40H
jne short L10
L9: jmp short L11
L10: cmp byte ptr [ebp]-18H,3fH
jne short L12
L11: jmp short L13
L12: mov al,byte ptr [ebp]-18H
inc al
and eax,000000ffH
test byte ptr __IsTable[eax],20H
je short L14
L13: jmp short L15
L14: mov al,byte ptr [ebp]-18H
inc al
and eax,000000ffH
test byte ptr __IsTable[eax],80H
je short L16
L15: jmp short L17
L16: mov dword ptr [ebp]-20H,0ffffffffH
jmp short L19
L17: jmp short L3
L18: mov dword ptr [ebp]-20H,00000001H
L19: mov eax,dword ptr [ebp]-20H
lea esp,[ebp]-14H
pop edi
pop esi
pop edx
pop ecx
pop ebx
pop ebp
ret
main_: push ebp
mov ebp,esp
push 00000024H
call near ptr __CHK
push ebx
push ecx
push esi
push edi
sub esp,0000000cH
mov dword ptr [ebp]-1cH,eax
mov dword ptr [ebp]-18H,edx
call near ptr main_init_
mov eax,dword ptr [ebp]-18H
mov eax,dword ptr [eax]
call near ptr MsgInit_
test eax,eax
je short L20
mov eax,00000001H
jmp near ptr exit_
L20: mov eax,offset DGROUP:L153
call near ptr put_cmdline_const_in_list_
mov edx,dword ptr [ebp]-18H
mov eax,dword ptr [ebp]-1cH
call near ptr parse_cmdline_
cmp byte ptr _Quiet,00H
jne short L21
cmp byte ptr _BannerPrinted,00H
je short L22
L21: jmp short L23
L22: mov byte ptr _BannerPrinted,01H
call near ptr trademark_
L23: mov ebx,0ffffffffH
mov edx,0ffffffffH
mov eax,0ffffffffH
call near ptr AsmInit_
call near ptr open_files_
call near ptr WriteObjModule_
call near ptr MsgFini_
call near ptr main_fini_
xor eax,eax
mov al,byte ptr _ErrorFlag
mov dword ptr [ebp]-14H,eax
mov eax,dword ptr [ebp]-14H
lea esp,[ebp]-10H
pop edi
pop esi
pop ecx
pop ebx
pop ebp
ret
usage_msg_: push ebp
mov ebp,esp
push 0000001cH
call near ptr __CHK
push ebx
push ecx
push edx
push esi
push edi
sub esp,00000000H
mov edx,000007f0H
mov eax,000007d0H
call near ptr PrintfUsage_
mov eax,00000001H
jmp near ptr exit_
trademark_: push ebp
mov ebp,esp
push 00000028H
call near ptr __CHK
push ebx
push ecx
push edx
push esi
push edi
sub esp,00000004H
mov dword ptr [ebp]-18H,00000000H
cmp byte ptr _Quiet,00H
jne short L25
L24: mov eax,dword ptr [ebp]-18H
shl eax,02H
cmp dword ptr L187[eax],00000000H
je short L25
mov eax,dword ptr [ebp]-18H
inc dword ptr [ebp]-18H
shl eax,02H
push dword ptr L187[eax]
mov eax,offset DGROUP:L158
push eax
call near ptr printf_
add esp,00000008H
jmp short L24
L25: lea esp,[ebp]-14H
pop edi
pop esi
pop edx
pop ecx
pop ebx
pop ebp
ret
free_file_: push ebp
mov ebp,esp
push 0000001cH
call near ptr __CHK
push ebx
push ecx
push edx
push esi
push edi
sub esp,00000000H
mov eax,dword ptr _AsmFiles+0cH
call near ptr AsmFree_
mov eax,dword ptr _AsmFiles+10H
call near ptr AsmFree_
mov eax,dword ptr _AsmFiles+14H
call near ptr AsmFree_
lea esp,[ebp]-14H
pop edi
pop esi
pop edx
pop ecx
pop ebx
pop ebp
ret
main_init_: push ebp
mov ebp,esp
push 00000020H
call near ptr __CHK
push ebx
push ecx
push edx
push esi
push edi
sub esp,00000004H
call near ptr MemInit_
mov dword ptr [ebp]-18H,00000000H
L26: cmp dword ptr [ebp]-18H,00000002H
jle short L28
jmp short L29
L27: mov eax,dword ptr [ebp]-18H
inc dword ptr [ebp]-18H
jmp short L26
L28: mov eax,dword ptr [ebp]-18H
shl eax,02H
mov dword ptr _AsmFiles[eax],00000000H
mov eax,dword ptr [ebp]-18H
shl eax,02H
mov dword ptr _AsmFiles[eax]+0cH,00000000H
jmp short L27
L29: call near ptr ObjRecInit_
call near ptr GenMSOmfInit_
lea esp,[ebp]-14H
pop edi
pop esi
pop edx
pop ecx
pop ebx
pop ebp
ret
main_fini_: push ebp
mov ebp,esp
push 0000001cH
call near ptr __CHK
push ebx
push ecx
push edx
push esi
push edi
sub esp,00000000H
call near ptr free_file_
call near ptr GenMSOmfFini_
call near ptr AsmShutDown_
call near ptr MemFini_
lea esp,[ebp]-14H
pop edi
pop esi
pop edx
pop ecx
pop ebx
pop ebp
ret
open_files_: push ebp
mov ebp,esp
push 00000024H
call near ptr __CHK
push ebx
push ecx
push edx
push esi
push edi
sub esp,00000000H
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?