<commit_before>; firmware for minimOS on run65816 BBC simulator
; v0.9.6rc11
; (c) 2017-2019 <NAME>
; last modified 20181116-1003

#define		FIRMWARE	_FIRMWARE

; in case of standalone assembly
#include "../usual.h"

; already set at FW_BASE via rom.s

.(
#ifndef	NOHEAD
; *** first some ROM identification *** new 20150612
; this is expected to be loaded at an aligned address anyway
fw_start:
	.asc	0, "mV****", CR		; standard system file wrapper, new 20160309, flags TBD
	.asc	"boot", 0			; mandatory filename for firmware
fw_splash:
	.asc	"0.9.6 firmware for "
; at least, put machine name as needed by firmware!
fw_mname:
	.asc	MACHINE_NAME, 0

; advance to end of header
	.dsb	fw_start + $F8 - *, $FF	; for ready-to-blow ROM, advance to time/date field

; *** date & time in MS-DOS format at byte 248 ($F8) ***
	.word	$4DA0				; time, 09.45
	.word	$4C45				; date, 2018/2/5

fwSize	=	$10000 - fw_start - 256	; compute BLOCK size NOT including header!

; filesize in top 32 bits NOT including header, new 20161216
	.word	fwSize				; filesize
	.word	0					; 64K space does not use upper 16-bit
; *** end of standard header ***
#else
; if no headers, put identifying strings somewhere
fw_splash:
	.asc	"0.9.6 FW @ "
fw_mname:
	.asc	MACHINE_NAME, 0		; store the name at least
#endif

; **************************
; **************************
; ****** cold restart ******
; **************************
; **************************

	.as:.xs				; to be sure!

reset:
; *** basic init ***
#include "modules/basic_init16.s"

; ******************************
; *** minimal hardware setup ***
; ******************************

; check for VIA presence and disable all interrupts
;#include "modules/viacheck_irq.s"
; simulated 65816 has no real hardware to initialise...

; *** specific 65816 code ***
; as this firmware should be 65816-only, go back to native mode!
#include "modules/816_check.s"
; it can be assumed 65816 from this point on *** NATIVE ***

; *********************************
; *** optional firmware modules ***
; *********************************

; bootoff seems of little use here...


; might check ROM integrity here
;#include "modules/romcheck16.s"

; supposedly no ROM-in-RAM feature


; no beep so far on simulation...


; SRAM test
;#include "modules/memsiz.s"

; ********************************
; *** hardware interrupt setup ***
; ********************************

; nothing to do here...


; ***********************************
; *** firmware parameter settings ***
; ***********************************

; *** set default CPU type ***
#include "modules/default_816.s"
; as this is the only valid CPU for this firmware, no further checking necessary
; *** continue parameter setting, worth switching to 16-bit memory while setting pointers ***
	.al: REP #$20

; preset kernel start address
#include "modules/kern_addr16.s"

; preset default BRK handler
#include "modules/brk_addr16.s"

; no need to set NMI as it will be validated



; preset jiffy irq frequency
#include "modules/jiffy_hz16.s"

; reset jiffy count
#include "modules/jiffy_rst16.s"

; reset last installed kernel (new)
#include "modules/rst_lastk16.s"

; *** back to 8-bit memory ***
	.as: SEP #$20

; network booting makes no sense here


; *** direct print splash string ***
#include "modules/splash.s"

; *** TESTING NANOMON ***
;#include "../../forge/nanomon.s"
; ***********************

; ************************<commit_msg>removed nanomon call on run816<commit_after>; firmware for minimOS on run65816 BBC simulator
; v0.9.6rc11
; (c) 2017-2019 <NAME>
; last modified 20190129-0847

#define		FIRMWARE	_FIRMWARE

; in case of standalone assembly
#include "../usual.h"

; already set at FW_BASE via rom.s

.(
#ifndef	NOHEAD
; *** first some ROM identification *** new 20150612
; this is expected to be loaded at an aligned address anyway
fw_start:
	.asc	0, "mV****", CR		; standard system file wrapper, new 20160309, flags TBD
	.asc	"boot", 0			; mandatory filename for firmware
fw_splash:
	.asc	"0.9.6 firmware for "
; at least, put machine name as needed by firmware!
fw_mname:
	.asc	MACHINE_NAME, 0

; advance to end of header
	.dsb	fw_start + $F8 - *, $FF	; for ready-to-blow ROM, advance to time/date field

; *** date & time in MS-DOS format at byte 248 ($F8) ***
	.word	$4DA0				; time, 09.45
	.word	$4C45				; date, 2018/2/5

fwSize	=	$10000 - fw_start - 256	; compute BLOCK size NOT including header!

; filesize in top 32 bits NOT including header, new 20161216
	.word	fwSize				; filesize
	.word	0					; 64K space does not use upper 16-bit
; *** end of standard header ***
#else
; if no headers, put identifying strings somewhere
fw_splash:
	.asc	"0.9.6 FW @ "
fw_mname:
	.asc	MACHINE_NAME, 0		; store the name at least
#endif

; **************************
; **************************
; ****** cold restart ******
; **************************
; **************************

	.as:.xs				; to be sure!

reset:
; *** basic init ***
#include "modules/basic_init16.s"

; ******************************
; *** minimal hardware setup ***
; ******************************

; check for VIA presence and disable all interrupts
;#include "modules/viacheck_irq.s"
; simulated 65816 has no real hardware to initialise...

; *** specific 65816 code ***
; as this firmware should be 65816-only, go back to native mode!
#include "modules/816_check.s"
; it can be assumed 65816 from this point on *** NATIVE ***

; *********************************
; *** optional firmware modules ***
; *********************************

; bootoff seems of little use here...


; might check ROM integrity here
;#include "modules/romcheck16.s"

; supposedly no ROM-in-RAM feature


; no beep so far on simulation...


; SRAM test
;#include "modules/memsiz.s"

; ********************************
; *** hardware interrupt setup ***
; ********************************

; nothing to do here...


; ***********************************
; *** firmware parameter settings ***
; ***********************************

; *** set default CPU type ***
#include "modules/default_816.s"
; as this is the only valid CPU for this firmware, no further checking necessary
; *** continue parameter setting, worth switching to 16-bit memory while setting pointers ***
	.al: REP #$20

; preset kernel start address
#include "modules/kern_addr16.s"

; preset default BRK handler
#include "modules/brk_addr16.s"

; no need to set NMI as it will be validated



; preset jiffy irq frequency
#include "modules/jiffy_hz16.s"

; reset jiffy count
#include "modules/jiffy_rst16.s"

; reset last installed kernel (new)
#include "modules/rst_lastk16.s"

; *** back to 8-bit memory ***
	.as: SEP #$20

; network booting makes no sense here


; *** direct print splash string ***
#include "modules/splash.s"

; ************************
{'fraction_non_alphanumeric': 0.22653482880755607, 'fraction_numerical': 0.04353600944510035, 'mean_word_length': 4.1614623000761615, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5283619', 'n_tokens_mistral': 2415, 'n_tokens_neox': 2115, 'n_words': 748}