		if2
		%out	Pass 2.
		endif
		.286c
		page	60,132
		name	BOMB
		title	Slicer BIOS Version 2.0A (Bomb Routine)

;--------------------------------------------------------------------------------
;	      BIOS for the Slicer. (C) Slicer Computers Inc.,  1985
;
;             Version 2.0                 April 4, 1985 
;	      By David Daney 1985
;
;
;--------------------------------------------------------------------------------
		subttl	Equates
		page
;----------------------------------------------------------------
;      E Q U A T E S
;----------------------------------------------------------------
b		equ	byte ptr  
w		equ	word ptr 
		subttl	Data Areas
		page	+
		include	biosdata.asm

		subttl	Externals and Publics
		page	+
;----------------------------------------------------------------
; Externals and Publics
;----------------------------------------------------------------
		public	bomb_init
		extrn	print:near
		extrn	print_al:near,number_table:byte
		extrn	conout2:near
		public	bomb_0,bomb_c
		extrn	monitor:near
		extrn	bomb:near

		subttl	Initialization Code
		page	+

cgroup		group	code

code		segment byte public 'code'
		assume	cs:cgroup,ds:data,es:nothing
debug		proc	near

		mov	ax,[bp+22]
		call	print_ax1
		mov	al,':'
		mov	ah,6		;console device
		call	conout2
		mov	ax,[bp+20]
		call	print_ax1
		pop	es
		pop	ds
		popa
		jmp	bomb
debug		endp
print_ax1	proc	near
		xchg	ah,al
		call	print_al
		xchg	ah,al
		call	print_al
		ret
print_ax1	endp

		assume	es:vectors
bomb_init	proc	near
		mov	cx,100h
		xor	di,di
set_loop:	mov	ax,offset bomb1
		stos	w [di]
		mov	ax,seg bomb1
		stos	w [di]
		loop	set_loop
;
set		macro	num,val
		mov	w num,offset val
		mov	w num+2,seg val
		endm
;
		set	vector_0,bomb_0
		set	vector_1,bomb_1
		set	vector_2,bomb_2
		set	vector_3,bomb_3
		set	vector_4,bomb_4
		set	vector_5,bomb_5
		set	vector_6,bomb_6
		set	vector_7,bomb_7
		set	vector_8,bomb_8
		set	vector_9,bomb_9
		set	vector_a,bomb_a
		set	vector_b,bomb_b
		set	vector_c,bomb_c
		set	vector_d,bomb_d
		set	vector_e,bomb_e
		set	vector_f,bomb_f
		ret
		assume	es:nothing
bomb_init	endp

bomb1		proc	far
		pusha
		push	ds
		push	es
		mov	si,offset gen_bomb_mess
		call	print
		mov	bp,sp
		les	si,[bp+20]		;cs:ip
		mov	dx,es:[si-2]		;should be cd xx
		mov	ax,data
		mov	ds,ax
		mov	es,ax
		cmp	dl,0cdh
		jne	bomb13
		mov	al,dh
		shr	al,4
		mov	bx,offset number_table
		xlat	cgroup:number_table
		push	dx
		mov	ah,6
		call	conout2
		pop	dx
		mov	al,dh
		and	al,0fh
		mov	bx,offset number_table
		xlat	cgroup:number_table
		mov	ah,6
		call	conout2
		mov	si,offset crlf
		call	print
		jmp	debug
bomb13:		mov	si,offset wild_int_mess
		call	print
		jmp	debug
bomb1		endp
bomb_0		proc	far
		pusha
		push	ds
		push	es

		mov	di,offset bomb_0_mess
		jmp	short bomb_cont
bomb_1:
		pusha
		push	ds
		push	es

		mov	di,offset bomb_1_mess
		jmp	short bomb_cont
bomb_2:
		pusha
		push	ds
		push	es
		mov	di,offset bomb_2_mess
		jmp	short bomb_cont
bomb_3:
		pusha
		push	ds
		push	es
		mov	di,offset bomb_3_mess
		jmp	short bomb_cont
bomb_4:
		pusha
		push	ds
		push	es
		mov	di,offset bomb_4_mess
		jmp	short bomb_cont
bomb_5:
		pusha
		push	ds
		push	es
		mov	di,offset bomb_5_mess
		jmp	short bomb_cont
bomb_6:
		pusha
		push	ds
		push	es
		mov	di,offset bomb_6_mess
		jmp	short bomb_cont
bomb_7:
		pusha
		push	ds
		push	es
		mov	di,offset bomb_7_mess
		jmp	short bomb_cont
bomb_8:
		pusha
		push	ds
		push	es
		mov	di,offset bomb_8_mess
		jmp	short bomb_cont
bomb_9:
		pusha
		push	ds
		push	es
		mov	di,offset bomb_9_mess
		jmp	short bomb_cont
bomb_a:
		pusha
		push	ds
		push	es
		mov	di,offset bomb_a_mess
		jmp	short bomb_cont
bomb_b:
		pusha
		push	ds
		push	es
		mov	di,offset bomb_b_mess
		jmp	short bomb_cont
bomb_c:
		pusha
		push	ds
		push	es
		mov	di,offset bomb_c_mess
		jmp	short bomb_cont
bomb_d:
		pusha
		push	ds
		push	es
		mov	di,offset bomb_d_mess
		jmp	short bomb_cont
bomb_e:
		pusha
		push	ds
		push	es
		mov	di,offset bomb_e_mess
		jmp	short bomb_cont
bomb_f:
		pusha
		push	ds
		push	es
		mov	di,offset bomb_f_mess
bomb_cont:
		mov	ax,data
		mov	ds,ax
		mov	es,ax
		mov	bp,sp
		mov	si,offset gen_bomb_mess
		push	di
		call	print
		pop	di
		mov	si,di
		call	print
		mov	si,offset crlf
		call	print
		jmp	debug
bomb_0		endp
gen_bomb_mess	db	0dh,0ah,"Wild interupt through vector ",0
wild_int_mess	db	0dh,0ah,"Wild interupt can't determine vector",0dh,0ah,0
bomb_0_mess	db	"0",0
bomb_1_mess	db	"1",0
bomb_2_mess	db	"2",0
bomb_3_mess	db	"3",0
bomb_4_mess	db	"4",0
bomb_5_mess	db	"5",0
bomb_6_mess	db	"6",0
bomb_7_mess	db	"7",0
bomb_8_mess	db	"8",0
bomb_9_mess	db	"9",0
bomb_a_mess	db	"a",0
bomb_b_mess	db	"b",0
bomb_c_mess	db	"c",0
bomb_d_mess	db	"d",0
bomb_e_mess	db	"e",0
bomb_f_mess	db	"f",0
crlf		db	0dh,0ah,0
code		ends
		end


