; -----------------------------------------------------------------------------
; __          ___       ____ ___
; \ \        / (_)     |___ \__ \   RetroForth for Windows
;  \ \  /\  / / _ _ __   __) | ) |  http://www.retroforth.tk
;   \ \/  \/ / | | '_ \ |__ < / /
;    \  /\  /  | | | | |___) / /_   Release 6.20 (Final) for FASM
;     \/  \/   |_|_| |_|____/____|  Text Console
; -----------------------------------------------------------------------------
; This is primarily a wrapper for the other files. It loads the
; macros, sets up memory + stacks, and initializes the Forth
; system. It includes the following files automatically:
;  * macros
;  * forth.asm + forth-ic.asm + forth.f
;  * drivers.asm + drivers.f
;  * user.asm + user.f
; If you're porting RF, you should only need to edit the startup
; code and drivers. The rest should work "out of the box".
; -----------------------------------------------------------------------------
format PE console at 0x400000
stack 16000
entry start	; entry point of the executable

CR_LF = 13

include "macros"

section ".code" code readable writeable executable
start:
	mov esi, sp0
	call driver_init

main:	upsh startup		;Load startup code (startup.f)
	upsh startup.1 - startup
	call eval
	call user_init
	call interpret
;---------------------------------------------------------------------
include "../forth-ic.asm"
include "user.asm"
include "drivers.asm"
include "../forth.asm"
;---------------------------------------------------------------------
startup:
file "../forth.f"
file "drivers.f"
file "user.f"
db '" RetroForth 6.20" type cr'
startup.1:

tib  rb   200h	; was 'resb'
sp0  rb   300h
d0   rb 10000h
h0   rb 80000h
