.section .text.forth.runtime

.global forth.runtime.bl_comma_out_of_range
forth.runtime.bl_comma_out_of_range:
	ldr x0, =bl_comma_out_of_range
	mov x1, bl_comma_out_of_range.len
	bl panic

.global forth.runtime.out_of_dictionary
forth.runtime.out_of_dictionary:
	ldr x0, =out_of_dictionary
	mov x1, out_of_dictionary.len
	bl panic

.global forth.runtime.return_stack_overflow
forth.runtime.return_stack_overflow:
	ldr x0, =return_stack_overflow
	mov x1, return_stack_overflow.len
	bl panic

.global forth.runtime.return_stack_underflow
forth.runtime.return_stack_underflow:
	ldr x0, =return_stack_underflow
	mov x1, return_stack_underflow.len
	bl panic

.global forth.runtime.stack_overflow
forth.runtime.stack_overflow:
	ldr x0, =stack_overflow
	mov x1, stack_overflow.len
	bl panic

.global forth.runtime.stack_underflow
forth.runtime.stack_underflow:
	ldr x0, =stack_underflow
	mov x1, stack_underflow.len
	bl panic

.global forth.runtime.unexpected_eof
forth.runtime.unexpected_eof:
	ldr x0, =unexpected_eof
	mov x1, unexpected_eof.len
	bl panic

.global forth.runtime.word_not_found
forth.runtime.word_not_found:
	mov x8, x0
	mov x9, x1
	ldr x0, =word_not_found
	mov x1, word_not_found.len
	bl platform.debug_print
	mov x0, x8
	mov x1, x9
	bl platform.debug_print
	mov x1, #0
	bl panic

.section .rodata.forth.runtime

bl_comma_out_of_range: .ascii "Value out of range in BL,"
.set bl_comma_out_of_range.len, . - bl_comma_out_of_range

out_of_dictionary: .ascii "Out of dictionary"
.set out_of_dictionary.len, . - out_of_dictionary

return_stack_overflow: .ascii "Return stack overflow"
.set return_stack_overflow.len, . - return_stack_overflow

return_stack_underflow: .ascii "Return stack underflow"
.set return_stack_underflow.len, . - return_stack_underflow

stack_overflow: .ascii "Stack overflow"
.set stack_overflow.len, . - stack_overflow

stack_underflow: .ascii "Stack underflow"
.set stack_underflow.len, . - stack_underflow

unexpected_eof: .ascii "Unexpected EOF"
.set unexpected_eof.len, . - unexpected_eof

word_not_found: .ascii "Word not found: "
.set word_not_found.len, . - word_not_found

// vi: set ft=arm64asm :