QNX4 assembler query

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:

  1. Why is a “push 00000008H” required as the
    very first instruction in the function
    main?
  2. Who is responsible for popping off the value from
    the stack?
  3. Why is there a call to __CHK?

All help will be appreciated.
-energon0

push    00000008H 
call    near ptr __CHK

This code is a stack check preamble. In current example you can see checking for 8 bytes available in stack. Function __CHK also poping this value from stack.

You can disable checking by using -Os or -Wc,-s