This is EPILOG.NSM, one of the bookend code modules for assembling the results of compiling C86NC5C.C into NASM assembler source, and thence into an executable. There is code in SECTION .cseg for external functions the small-c compiler will call. In effect this shows how to supply undefined external functions to the caller expecting these. This is the trailing bookend code matched to PROLOG.NSM, the leading bookend code. Both of those are to be tailored to the main C module, to support it. These, as shown, determine the memory model in force. There is one Segment for CS=DS=CS but with two SECTIONS of; Code, and Data. Each SECTION is padded to a paragraph boundry, so easier calculations are made for 'vstart=' for the beginning of the Data Section. The memory map as portrayed is: [[Code],[Data,Stack]] == CS=DS=SS.


;;========================================================60
;; File: EPILOG  .NSM  By: s_dubrovich@yahoo.com
;; Last: 02-Feb-10 10:33:18 PM
;; Prev: 01-Feb-10 11:03:33 PM
;; Init: 10-Jan-10 10:11:21 PM, 16-Jan-10 03:05:46 PM
;; Vers: 0.0.3
;; Note: Epilog to small-c ver 10-Jan-10
;;
;;========================================================60
;;========================================================60
;; -= Naming Fixups & RTSystem Calls =-
;;========================================================60
;; *** NOTE! *** for C86NC5C.C,
;; Primary Register := BX, Secondary Register := DX

;;/* Following are the conditional operators */
;;/* They compare the secondary register against the primary */
;;/* and put a value of 1 in the primary if the condition is */
;;/* true, otherwise they clear the primary register */

  [SECTION .cseg]

cceq:          ; /* Test for equal */
  CMP  DX, BX  ;  /** sets flags **/
  MOV  BX, 1   ;   /** assume true **/
  JZ   $+5
  MOV  BX, 0   ;   /** is false **/
  RET

ccne:          ; /* Test for not equal */
  CMP  DX, BX  ;  /** sets flags **/
  MOV  BX, 1   ;   /** assume true **/
  JNZ  $+5
  MOV  BX, 0   ;   /** is false **/
  RET

cclt:          ; /* Test for less than (signed) */
  CMP  DX, BX  ;  /** sets flags **/
  MOV  BX, 1   ;   /** assume true **/
  JL   $+5 
  MOV  BX, 0   ;   /** is false **/
  RET

ccle:          ; /* Test for less than or equal to (signed) */
  CMP  DX, BX  ;  /** sets flags **/
  MOV  BX, 1   ;  /** assume true **/
  JLE  $+5
  MOV  BX, 0   ;  /** is false **/

  RET

ccgt:          ; /* Test for greater than (signed) */
  CMP  DX, BX  ;  /** sets flags **/
  MOV  BX, 1   ;   /** assume true **/
  JG   $+5
  MOV  BX, 0   ;   /** is false **/
  RET

ccge:          ; /* Test for greater than or equal to (signed) */
  CMP  DX, BX  ;  /** sets flags **/
  MOV  BX, 1   ;   /** assume true **/
  JGE  $+5
  MOV  BX, 0   ;   /** is false **/
  RET

ccult:         ; /* Test for less than (unsigned) */
  CMP  DX, BX  ;  /** sets flags **/  
  MOV  BX, 1   ;   /** assume true **/
  JB   $+5
  MOV  BX, 0   ;   /** is false **/
  RET

ccule:         ; /* Test for less than or equal to (unsigned) */
  CMP  DX, BX  ;  /** sets flags **/
  MOV  BX, 1   ;   /** assume true **/
  JBE  $+5
  MOV  BX, 0   ;   /** is false **/
  RET

ccugt:         ; /* Test for greater than (unsigned) */
  CMP  DX, BX  ;  /** sets flags **/
  MOV  BX, 1   ;   /** assume true **/
  JA   $+5
  MOV  BX, 0   ;   /** is false **/
  RET

ccuge:         ; /* Test for greater than or equal to (unsigned) */
  CMP  DX, BX  ;  /** sets flags **/
  MOV  BX, 1   ;   /** assume true **/
  JAE  $+5
  MOV  BX, 0   ;   /** is false **/
  RET

;;========================================================60
;; -= L A S T   C O D E =-
;;========================================================60
  [SECTION .cseg]
;; -= mark end of last .cseg with.. =-
 align 16, db 0
 EOcseg EQU ($-$$)

;;========================================================60
;; -= L A S T   D A T A =-
;;========================================================60
;; -= mark the end of the last .dseg with.. =-
  [SECTION .dseg]
 align 16, db 0
  ;; was FFFEh(nak) -> FF00h(ok) -> FFF0h(ok), use FFEEh.
Stk_Base: TIMES ((0FFEEh - ($-$$))-(EOcseg+100h)) db 0CCh
Stk_Top:
Sz_Mod:  dw STUB_COM_Size
 EOdseg EQU ($-$$)
;;--------------------------------------------------------60
 STUB_COM_Size EQU (0100h + EOcseg + EOdseg)
;;========================================================60
;; - =   E O   E P I L O G   = -
;;========================================================60

6:40 PM 2/6/2010