; **************************************************************************
; COMBONER.ASM- Assembler/TASM COM skeleton file... (EXEBONER.ASM)
; ------------- Copyright 2004-2009 Christopher Evans http://nxdos.sourceforge.net/
; E-mail: teknopup@lycos.com    
;
; May have to use :
;       lea dx, msg1
; Instead of mov dx, offset msg1, dunno  got a assembler error from the later.
;
; -[version]-+-[dates           ]-+-[notes                                 ]-
;                3/07/96   17:25     Was tired of typeing in all the junk 
;                                    required for a assembler to assemble a 
;                                    binary so I made this... all ready to go!
;                3/29/96
;                4/26/96   16:01     reconstructed after overwriting it argh
;               11/19/96   14:16     updated for new compileid
;               11/19/96   14:18     new compileid
;               06-19-98    8:23p
;               09-06-99   15:37p
;               07-09-2009 17:11     Intergrate the src for com and exe 
;                                    skeletons, and use a define to select 
;                                    type of progra to make.  
; **************************************************************************
;                                                                           ;
;       This program is copyrighted, but may be freely distributed          ;
;       under the terms of the Free Software Foundation's GNU General       ;
;       Public License v2 (or later.)  See the file COPYING for the         ;
;       legalities.  If you did not receive a copy of COPYING, you          ;
;       may request one from the Free Software Foundation, Inc.,            ;
;       59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.           ;
;       ABSOLUTELY NO WARRANTY -- use it at your own risk!                  ;
;                                                                           ;
; **************************************************************************

EXE     EQU 0       ; 1 = program.EXE

IF (EXE)
_stack  segment word stack 'STACK'
        db      0100h DUP (05h)
_stack  ends

data    segment    ; data things here 
include \nxdos\src\tbx_data.inc
        msg1    DB '',0dh,0ah,'$' 
        msg2    DB '',0dh,0ah,'$' 
data    ends
ENDIF

code    segment byte public                               ; codesegment_A
        assume  cs:code, ds:code
IF (EXE)
        assume cs:code, ds:data
        assume es:data, ss:_stack
ENDIF

	 org	100h

program  proc    far 

start:   jmp     initialize ; main
progname db 'namegoeshere',0

        ; include c:\mysrc\asm\asmtbx.mac ; Macro routines.. asmc0de
        ; compileid
IF (EXE)
        include \nxdos\src\tbx_code.inc 
ELSE
        include toolbox.asm 
ENDIF

initialize:  
IF (EXE)
         mov  ax, data    ; Establish data and extra segment addressability 
         mov  ds, ax      ; aka  setup the stack n' data segments   
         assume 	ds:data
         mov  es, ax
         assume  es:data
ELSE 
         ;jmp short kmain 
         push cs
         pop  es
         mov  bx, ProgramEnd
         call resize
         jc   kexitptr
         ;MOV AH,4Ah        ; Resize our memory to the "T"
         ;MOV BX,ProgramEnd + 0Fh + 0200h
         ;MOV SP,BX         ; Set's stack pointer.
         ;SHR BX,04         ; Divides .BX by 16.
         ;INT 21h
ENDIF
kmain:   ; main code go here!
         call cs:main
kexitptr: 
         call dosexit
         int 20h      ; remove this

; --- Your data goes here :) ------------------------------------------------
kdata:

program    endp

; ===========================================================================
main       proc far
; Thy rest of your proggy goes here!
; ===========================================================================
           nop
           call debugregisters

           ret
main       endp

code       ends

ProgramEnd EQU $-01h

	   end start
