Environment:
QNX 1 G 424 PCI 32
WATCOM C32 Optimizing Compiler Version 9.5
WATCOM Disassembler Version 2.0
Hi Guys,
I’m trying to understand the Watcom disassember
output generated in Unix format.
While reading the disassembler help page a sample
output is listed as follows:
.386
NAME hello
EXTRN _cstart_ :BYTE
EXTRN printf_ :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_
main_ push 00000008H
call near ptr __CHK
push offset DGROUP:L1
call near ptr printf_
add ESP,00000004H
ret
_TEXT ENDS
I’d like to know:
- Why is a “push 00000008H” required as the
very first instruction in the function
main? - Who is responsible for popping off the value from
the stack? - Why is there a call to __CHK?
All help will be appreciated.
-energon0