#pragma option w32c
#pragma option lst
#pragma option js-
#pragma option wbss-
#jumptomain NONE
#include "windows.h--"
#include "msvcrt.h--"

#include "try.h--"

main()
{
  printf("ESP=%08X\n",ESP);
  printf("EBP=%08X\n\n",EBP);

  __try(
    printf("before ACCESS_VIOLATION\n");
    DSDWORD[-1]=0;
    printf("after ACCESS_VIOLATION\n");
  )
  printf("after try1\n\n");
  printf("ESP=%08X\n",ESP);
  printf("EBP=%08X\n\n",EBP);

  __try(
    printf("before nop\n");
    $nop
    printf("after nop\n");
  )
  printf("after try2\n\n");

  __try(
    printf("before DIVIDE_BY_ZERO\n");
    ECX=0; EAX=1/ECX;
    printf("after DIVIDE_BY_ZERO\n");
  )
  printf("after try3\n\n");

  __try(
    if(EAX==0){$nop}
  )

  printf("ESP=%08X\n",ESP);
}