




































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































setbaud 1,9600,8,n,1
setp	0x7f02,0x01
mode_reco



setl	11,2
setc	2,1
setc	3,0
setc	8,1
setc	9,0
movc	2,s12,205
movc	8,s12,210
movd	"000 ",s12,75
movd	"000 ",s12,80
setc	6,255
call	update_bled
call	init_b6



compd   "GDC09Euro/n",s10,41
jz      skip_auto_in

call    init_first
call    init_buffer

skip_auto_in:
setrts  off
sett	10
wait	tf_sign



movd    " G-D-C  V0.9c (Modul 3) *GDC09c.DW3* by J. Hoerhager AOPE/n",s6,0

out     s6,0,c4
movd	"Installed expanded memory =     blocks a 32 KByte/n",s6,100
getp	0xd4d0,dec
movs	s15,240,s6,128,3
out	s6,100,c4
compd	"064",s6,128
jz	error_main
movd    "ERROR ERROR ERROR on expanded memory !!!!!!/n",s6,100
out     s6,100,c4






sett    100
setl	7,2
wait	tf_sign



acall	0000




error_main:
setp	0x7f02,0x01
mode_reco
movd	" G-D-C  V0.9c Modul 3 Ready/n",s6,100
out	s6,100,c4



main:
sett	100

main_1:
setl	11,1
setrts	on
wait	ans_sign,tf_sign,im_sign
case	ans_sign,test_im_sign




setl	11,2
readb	s3,0,2
jz	main_1			


out	s3,0,c4


compd	"/n",s3,0          
jz     main_send_sig

jr	s12,75
jmp	state_0 	
jmp	state_1 	
jmp	state_2
jmp	state_3
jmp	state_4
jmp	state_5
jmp	state_6
jmp	state_7
jmp	state_8
jmp	state_9
jmp	state_10	
jmp	state_11	
jmp	state_12	
jmp     state_13        
jmp	state_14	
jmp	state_15	
jmp	state_16	
jmp	state_17	
jmp	state_18
jmp	state_19
jmp	state_20	


state_0:

movd	" State_0_modul_3/n",s6,200
out	s6,200,c4

movd	"000 ",s12,75
compd	"-----",s3,0
jz	head_line1

compd	"^L/n",s3,0
jz	main_send_sig



comps	0x8f00,0,s3,0,11
jz	smdr_out
comps	0x8f00,32,s3,0,11
jz	smdr_out
comps	0x8f00,64,s3,0,11
jz	smdr_out
comps	0x8f00,96,s3,0,11
jz	smdr_out

comps	0x8f00,16,s3,0,11
jz	smdr_2dg_out
comps	0x8f00,48,s3,0,11
jz	smdr_2dg_out
comps	0x8f00,80,s3,0,11
jz	smdr_2dg_out
comps	0x8f00,112,s3,0,11
jz	smdr_2dg_out

comps	0x8f00,128,s3,0,14
jz	room_state
comps	0x8f00,144,s3,0,14
jz	room_2dg_state

comps	0x8f00,224,s3,0,16
jz	r311_roomstate
comps	0x8f00,240,s3,0,10
jz	r312_roomstate


comps	0x8f00,160,s3,0,14
jz	termin
comps	0x8f00,176,s3,0,14
jz	termin_2dg

comps	0x8d00,96,s3,0,20
jz	r311_wakeup
comps	0x8d00,112,s3,0,14
jz	r312_wakeup



comps	0x8e00,160,s3,0,16
jz	r311_smout
comps	0x8e00,176,s3,0,16
jz	r311_smout
comps	0x8e00,192,s3,0,16
jz	r311_smout

comps	0x8e00,208,s3,0,11
jz	r312_smout
comps	0x8e00,224,s3,0,11
jz	r312_smout
comps	0x8e00,240,s3,0,11
jz	r312_smout


















comps	0x8e00,0,s3,0,11
jz	smdr_in
comps	0x8e00,32,s3,0,11
jz	smdr_in
comps	0x8e00,64,s3,0,11
jz	smdr_in

comps	0x8e00,16,s3,0,11
jz      smdr_2dg_in
comps	0x8e00,48,s3,0,11
jz      smdr_2dg_in
comps	0x8e00,80,s3,0,11
jz      smdr_2dg_in

comps	0x8e00,96,s3,0,16
jz	r311_smin
comps	0x8e00,112,s3,0,16
jz	r311_smin

comps	0x8e00,128,s3,0,11
jz	r312_smin
comps	0x8e00,144,s3,0,11
jz	r312_smin



comps	s12,230,s3,0,10
jz	main_send_sig

movs	s10,20,s12,49,1
call	print_messim
jz	main_send_sig



state_1:
state_2:
state_3:
state_4:
state_5:
state_6:
state_7:
state_8:
state_9:
state_18:
state_19:
jmp	main_send_sig



r311_wakeup:
call    form_r311
jmp     do_termin


r312_wakeup:
call    form_r312
jmp     do_termin


termin_2dg:

movs	s3,3,s3,2,4

termin:
call    form_r26_3dg

do_termin:



movd	"/n",s3,79                

movs	s10,19,s12,49,1

call	print_smdrim
jmp	main_send_sig



r311_roomstate:
call    form_r311

call    t_zusatzkosten
jz      do_smdr_out

jmp     do_room


r312_roomstate:
call    form_r312
call    t_zusatzkosten
jz      do_smdr_out

jmp     do_room


room_2dg_state:
movs	s3,3,s3,2,4

room_state:



call    form_r26_3dg

call    t_zusatzkosten
jz      do_smdr_out

do_room:
compd   "Zusatzkosten",s3,43
jz      main_send_sig
do_1_room:



movd	"/n",s3,79         




out	s3,0,c4

compd	"999",s3,1
jz	st_config



movs	s10,18,s12,49,1	

movd	"002 0 ",s15,100
acall	pfirst_dbs
movs	s3,1,s15,0,4
acall	find_dbs
jnz	room_err
acall	read11_dbs
compd	"R",s11,4
jz	room_st_save

room_st_save:
movs	s3,65,s11,83,4
movd	"R",s11,4
acall	write11_dbs
call	print_smdrim
jmp	main_send_sig

room_err:
movs	s10,25,s12,49,1
call	print_smdrim
movs	0x9400,192,s3,0,48	
call	print_smdrim
jmp	main_send_sig




st_config:





movs	s10,22,s12,49,1      

movs	s3,0,s8,0,100
replace "- ",s3,66,4
compd	"0",s3,66
jnz	zi_extension








compd	"010",s3,66
jz	st_010



compd	"011",s3,66
jz	st_011



compd	"012",s3,66
jz	st_012



compd	"013",s3,66
jz	st_013



compd	"019",s3,66
jz	st_019





compd	"020",s3,66
jz	st_020



compd	"021",s3,66
jz	st_021



compd	"022",s3,66
jz	st_022



compd	"029",s3,66
jz	st_029





compd	"030",s3,66
jz	st_030



compd	"031",s3,66
jz	st_031



compd	"032",s3,66
jz	st_032



compd	"039",s3,66
jz	st_039





compd	"040",s3,66
jz	st_040



compd	"041",s3,66
jz	st_041



compd	"042",s3,66
jz	st_042



compd   "048",s3,66
jz      st_048



compd	"049",s3,66
jz	st_049




compd	"08?",s3,66
jz	st_08x



compd	"091",s3,66
jz	st_091

compd	"092",s3,66
jz	st_092

compd	"099",s3,66
jz	st_099

jmp	main_send_sig

st_099:
call	do_ff1_ff
jmp	main_send_sig

st_091:
movd	"copy buffer1/n",s3,0
call	print1_m3
jmp	main_send_sig

st_092:
movd	"copy buffer2/n",s3,0
call	print2_m3
jmp	main_send_sig





st_08x:

movs	s10,24,s12,49,1	   

movs	s3,68,s15,0,1
movd	"2 4 ",s15,100
acall	pfirst_dbs
acall	find_dbs
jnz	code_not_def
acall	read11_dbs
compd	"255",s11,53
jz	tln_no_calls
movs	s11,53,s15,100,9
acall	preco_dbs
acall	read_dbs


movs	s14,79,s12,50,5
movs	s14,85,s12,55,3



call	test_form_ff
call	load_h60
call	print_load
movs	s12,230,s3,2,20
call	print_load
movs	s14,21,s3,2,14
call	print_load
call	print_load
movs	0x9000,0,s3,2,32	
call	print_load
movs	0x9000,32,s3,2,32	
movs    s11,0,s3,34,4
call	print_load
call	print_load
movs	0x9000,64,s3,2,32	
movs	s14,52,s3,34,20
replace ". ",s3,34,20
call	print_load
movs	0x9000,96,s3,2,32	
movs	s14,36,s3,34,8
call	print_load
call	print_load
movs	0x9000,128,s3,2,32	
movs	s14,79,s3,34,9

movs    0x9300,243,s3,44,3  
compd   "3",s10,39
jz      x80_print_euro
compd   "2",s10,39
jz      x80_print_euro
movs    0x9300,240,s3,44,3  
x80_print_euro:
call    print_load
movs	0x9000,192,s3,2,32	


































call	print_load
call	print_load
movs	0x9000,224,s3,2,32	
call	pr_ticket
call	load_h60



call	pr_ticket
call	pr_formfeed
jmp	main_send_sig




code_not_def:
call	test_form_ff
call	load_h60
call	print_load
movs	0x9300,48,s3,2,48	
movs	s8,66,s3,50,3
call	pr_ticket
call	load_h60
call	pr_ticket
call	pr_formfeed
jmp	main_send_sig




tln_no_calls:
call	test_form_ff
call	load_h60
call	print_load
movs	0x9300,96,s3,2,48	
movs    s11,0,s3,50,4
call	pr_ticket
call	load_h60
call	pr_ticket
call	pr_formfeed
jmp	main_send_sig

print_load:
call	pr_ticket
call	load_def60
ret





st_011:
call	do_st_011
jmp	main_send_sig

do_st_011:
call	print_lfmess
call	print_trlmess
movs	0x9700,0,s3,0,64	
movs	s8,12,s3,39,15
call	print_messim
call	print_lfmess
movs	0x9100,0,s3,0,32	
call	print_clmess

movd    "0???",s12,70
movd	"00000000 ",s12,140
movd	"002 1 ",s15,100
movd	"R ",s15,0

acall	pfirst_dbs
st_l1_011:
pr_2sp_open:
acall	find_dbs
jnz	st_end2_011
acall	read11_dbs
comps   s11,0,s12,70,4
jz	st_01_011
call	print_clmess

st_01_011:
movs	s11,0,s12,70,4
movd    "???",s12,71
movs    s11,0,s3,10,4
movd    "...",s3,15
movs	s11,13,s15,230,8
call	form_erg_m3_45
movs    s3,45,s3,19,9
movd	"         ",s3,45
call	calc_total_open

acall	pnext_dbs
acall	find_dbs
jnz	st_end1_011
acall	read11_dbs
comps   s11,0,s12,70,4
jz	st_02_011
call	print_clmess
call	print_lfmess
jmp	st_01_011

st_02_011:
movs    s11,0,s3,36,4
movd	"...",s3,41
movs	s11,13,s15,230,8
call	form_erg_m3_45
call	calc_total_open
acall	pnext_dbs
call	print_clmess
jmp	st_l1_011

st_end1_011:
call    print_clmess
st_end2_011:
print_sum_m3_45:
call    print_trlmess

movs	0x9700,64,s3,0,64	
movs	s12,140,s15,230,8
call	form_erg_m3_45



compd   "0",s10,39
jz      skip_st011_1
compd   "1",s10,39
jz      skip_st011_1
movd    "EUR",s3,41
skip_st011_1:
call    print_messim



compd   "1",s10,39
jnz     skip_st011_2
movs    s3,45,s9,200,9    
call    ats_to_euro
movs    s9,191,s3,45,9
movs    0x9300,243,s3,41,3  
movd    "                                  ",s3,0
call    print_messim
jmp     skip_st011_3
skip_st011_2:
compd   "2",s10,39
jnz     skip_st011_3
movs    s3,45,s9,200,9    
call    euro_to_ats
movs    s9,191,s3,45,9
movs    0x9300,240,s3,41,3  
movd    "                                  ",s3,0
call    print_messim
jmp     skip_st011_3
skip_st011_3:


call    print_listemess

ret





st_021:
call	do_st_021
jmp	main_send_sig

do_st_021:
call	print_lfmess
call	print_trlmess
movs	0x9700,0,s3,0,64	
movs	s8,12,s3,39,15
call	print_messim
call	print_lfmess
movs	0x9100,64,s3,0,32	
call	print_clmess
call	print_lfmess

movd	"00000000 ",s12,140
movd	"002 1 ",s15,100
movd	"B ",s15,0

acall	pfirst_dbs
st_l1_021:
pr_1sp_open:
acall	find_dbs
jnz	st_end2_021
acall	read11_dbs
movd	"                                                                    /n",s3,0
movs    s11,0,s3,19,4
movd	".................",s3,24
movs	s11,13,s15,230,8
call	form_erg_m3_45
call	calc_total_open
call	print_messim

acall	pnext_dbs
jmp	st_l1_021
st_end1_021:
st_end2_021:

call    print_sum_m3_45

ret



print_listemess:
call	print_trlmess
movs	0x9100,32,s3,0,32	
call	print_messim
call	pr_formfeed

ret





st_031:
call	do_st_031
jmp	main_send_sig

do_st_031:
call	print_lfmess
call	print_trlmess
movs	0x9700,0,s3,0,64	
movs	s8,12,s3,39,15
call	print_messim
call	print_lfmess
movs	0x9100,96,s3,0,32	
call	print_clmess
call	print_lfmess

movd	"00000000 ",s12,140
movd	"002 1 ",s15,100
movd	"P ",s15,0

acall	pfirst_dbs
jmp	pr_1sp_open







st_041:
call	do_st_041
jmp	main_send_sig

do_st_041:
call	print_lfmess
call	print_trlmess
movs	0x9700,0,s3,0,64	
movs	s8,12,s3,39,15
call	print_messim
call	print_lfmess
movs	0x9100,128,s3,0,32	
call	print_clmess
call	print_lfmess

movd    "0???",s12,70
movd	"00000000 ",s12,140
movd	"002 1 ",s15,100
movd	"A ",s15,0

acall	pfirst_dbs
jmp	pr_2sp_open








st_012:
call	do_st_012
jmp	main_send_sig

do_st_012:
call	print_lfmess
call	print_trlmess
movs	0x9300,144,s3,0,48	
call	print_messim
call	print_lfmess
movs	0x9700,128,s3,0,64	
movs	s12,160,s3,6,15
movs	s8,12,s3,35,15
call	print_messim
call	print_lfmess
movs	0x9100,0,s3,0,32	
call	print_clmess

movd    "0???",s12,70
movd	"00000000 ",s12,140
movd	"00000000 ",s12,50
movd	"002 1 ",s15,100
movd	"R ",s15,0

acall	pfirst_dbs
st_l1_012:
pr_2sp_closed:
acall	find_dbs
jnz	st_end2_012
acall	read11_dbs
comps   s11,0,s12,70,4
jz	st_01_012
call	print_clmess

st_01_012:
movs	s11,0,s12,70,4
movd    "???",s12,71
movs    s11,0,s3,10,4
movd    "...",s3,15
movs	s11,23,s15,230,8
call	form_erg_m3_45
movs    s3,45,s3,19,9
movd	"         ",s3,45
call	calc_total_closed

acall	pnext_dbs
acall	find_dbs
jnz	st_end1_012
acall	read11_dbs
comps   s11,0,s12,70,4
jz	st_02_012
call	print_clmess
call	print_lfmess
jmp	st_01_012

st_02_012:
movs    s11,0,s3,36,4
movd	"...",s3,41
movs	s11,23,s15,230,8
call	form_erg_m3_45
call	calc_total_closed
acall	pnext_dbs
call	print_clmess
jmp	st_l1_012

st_end1_012:
call	print_clmess
st_end2_012:



print_sum_st12_45:
call    print_trlmess

movs    0x9700,192,s3,0,64  
movs	s12,140,s15,230,8
call	form_erg_m3_45



compd   "0",s10,39
jz      skip_st012_1
compd   "1",s10,39
jz      skip_st012_1
movd    "EUR",s3,41
skip_st012_1:
call    print_messim



compd   "1",s10,39
jnz     skip_st012_2
movs    s3,45,s9,200,9    
call    ats_to_euro
movs    s9,191,s3,45,9
movs    0x9300,243,s3,41,3  
movd    "                                  ",s3,0
call    print_messim
jmp     skip_st012_3
skip_st012_2:
compd   "2",s10,39
jnz     skip_st012_3
movs    s3,45,s9,200,9    
call    euro_to_ats
movs    s9,191,s3,45,9
movs    0x9300,240,s3,41,3  
movd    "                                  ",s3,0
call    print_messim
jmp     skip_st012_3
skip_st012_3:


call    print_listemess

ret






st_022:
call	do_st_022
jmp	main_send_sig

do_st_022:
call	print_lfmess
call	print_trlmess
movs	0x9300,144,s3,0,48	
call	print_messim
call	print_lfmess
movs	0x9700,128,s3,0,64	
movs	s12,190,s3,6,15
movs	s8,12,s3,35,15
call	print_messim
call	print_lfmess
movs	0x9100,64,s3,0,32	
call	print_clmess
call	print_lfmess

movd	"00000000 ",s12,140
movd	"002 1 ",s15,100
movd	"B ",s15,0

acall	pfirst_dbs
st_l1_022:
pr_1sp_closed:
acall	find_dbs
jnz	st_end2_022
acall	read11_dbs
movd	"                                                                    /n",s3,0
movs    s11,0,s3,19,4
movd	".................",s3,24
movs	s11,23,s15,230,8
call	form_erg_m3_45
call	calc_total_closed
call	print_messim


acall	pnext_dbs
jmp	st_l1_022
st_end1_022:
st_end2_022:

call    print_sum_st12_45

























ret





st_032:
call	do_st_032
jmp	main_send_sig

do_st_032:
call	print_lfmess
call	print_trlmess
movs	0x9300,144,s3,0,48	
call	print_messim
call	print_lfmess
movs	0x9700,128,s3,0,64	
movs	s12,175,s3,6,15
movs	s8,12,s3,35,15
call	print_messim
call	print_lfmess
movs	0x9100,96,s3,0,32	
call	print_clmess
call	print_lfmess

movd	"00000000 ",s12,140
movd	"002 1 ",s15,100
movd	"P ",s15,0

acall	pfirst_dbs
jmp	pr_1sp_closed









st_042:
call	do_st_042
jmp	main_send_sig

do_st_042:
call	print_lfmess
call	print_trlmess
movs	0x9300,144,s3,0,48	
call	print_messim
call	print_lfmess
movs	0x9700,128,s3,0,64	
movs	s10,0,s3,6,15
movs	s8,12,s3,35,15
call	print_messim
call	print_lfmess
movs	0x9100,128,s3,0,32	
call	print_clmess

movd    "0???",s12,70
movd	"00000000 ",s12,140
movd	"00000000 ",s12,50
movd	"002 1 ",s15,100
movd	"A ",s15,0

acall	pfirst_dbs
jmp	pr_2sp_closed









st_019:
call	do_st_019
jmp	main_send_sig

do_st_019:
call	print_lfmess
call	print_trlmess
movs	0x9100,160,s3,0,32	
call	print_messim
call	print_lfmess
movs	0x9700,128,s3,0,64	
movs	s12,160,s3,6,15
movs	s8,12,s3,35,15
call	print_messim
call	print_lfmess
movs    0x9300,192,s3,0,48  
call	print_messim

movs	s8,12,s12,160,15


movd	"002 1 ",s15,100
movd	"R ",s15,0

acall	pfirst_dbs
st_l1_019:
acall	find_dbs
jnz	st_end1_019
acall	read11_dbs
movd	"00000000",s11,23

acall	write11_dbs
acall	pnext_dbs
jmp	st_l1_019
st_end1_019:
call	print_listemess

ret






st_029:
call	do_st_029
jmp	main_send_sig

do_st_029:
call	print_lfmess
call	print_trlmess
movs	0x9100,160,s3,0,32	
call	print_messim
call	print_lfmess
movs	0x9700,128,s3,0,64	
movs	s12,190,s3,6,15
movs	s8,12,s3,35,15
call	print_messim
call	print_lfmess
movs	0x9400,48,s3,0,48	
call	print_messim

movs	s8,12,s12,190,15


movd	"002 1 ",s15,100
movd	"B ",s15,0

acall	pfirst_dbs
st_l1_029:
acall	find_dbs
jnz	st_end1_029
acall	read11_dbs
movd	"00000000",s11,23

acall	write11_dbs
acall	pnext_dbs
jmp	st_l1_029
st_end1_029:
call	print_listemess

ret






st_039:
call	do_st_039
jmp	main_send_sig

do_st_039:
call	print_lfmess
call	print_trlmess
movs	0x9100,160,s3,0,32	
call	print_messim
call	print_lfmess
movs	0x9700,128,s3,0,64	
movs	s12,175,s3,6,15
movs	s8,12,s3,35,15
call	print_messim
call	print_lfmess
movs	0x9400,96,s3,0,48	
call	print_messim

movs	s8,12,s12,175,15


movd	"002 1 ",s15,100
movd	"P ",s15,0

acall	pfirst_dbs
st_l1_039:
acall	find_dbs
jnz	st_end1_039
acall	read11_dbs
movd	"00000000",s11,23

acall	write11_dbs
acall	pnext_dbs
jmp	st_l1_039
st_end1_039:
call	print_listemess

ret






st_049:
call	do_st_049
jmp	main_send_sig

do_st_049:
call	print_lfmess
call	print_trlmess
movs	0x9100,160,s3,0,32	
call	print_messim
call	print_lfmess
movs	0x9700,128,s3,0,64	
movs	s10,0,s3,6,15
movs	s8,12,s3,35,15
call	print_messim
call	print_lfmess
movs	0x9400,144,s3,0,48	
call	print_messim

movs	s8,12,s10,0,15


movd	"002 1 ",s15,100
movd	"A ",s15,0

acall	pfirst_dbs
st_l1_049:
acall	find_dbs
jnz	st_end1_049
acall	read11_dbs
movd	"00000000",s11,23

acall	write11_dbs
acall	pnext_dbs
jmp	st_l1_049
st_end1_049:
call	print_listemess

ret





st_013:
call	print_lfmess

movd	"002 1 ",s15,100
movd	"R ",s15,0

call	pr_status_head
acall	pfirst_dbs
st_l1_013:
compc	8,68
jnz	st_02_13
call	pr_status_head
st_02_13:
acall	find_dbs
jnz	st_end1_013
acall	read11_dbs
movs	s11,0,s3,2,4
compd	"I",s11,80
jz	st_03_13
movs	0x9400,0,s3,20,20 
jmp	st_04_13
st_03_13:
movs	0x9400,20,s3,20,20 
st_04_13:
movs	s11,83,s3,43,4
call	print_messim
acall	pnext_dbs
jmp	st_l1_013
st_end1_013:
call	print_listemess

jmp	main_send_sig




st_048:
call	print_trennl
movs    0x9b00,160,s3,0,80  
call	print_smdrim
call	print_trennl
movd    "M",s10,37
call    pr_adminm_clear
movd    " ",s10,37
call	print_trennl
movs	0x9100,32,s3,0,32	
call	print_smdrim
call	pr_formfeed
jmp     main_send_sig





st_010:
call	print_lfsmdr
movs	0x9800,0,s3,0,64	
call	print_smdrim
movd	"00000000 ",s12,140

movd	"002 1 ",s15,100
movd	"R ",s15,0

acall	pfirst_dbs
st_l1_010:
acall	find_dbs
jnz	st_end1_010
acall	read11_dbs
movs	s11,0,s12,70,4

movd	"0",s10,36          

movd    "M",s10,37
call	pr_tln_s11_nocl
movd    " ",s10,37

movd	"002 1 ",s15,100
movd	"R ",s15,0

call	calc_total_open
acall	pnext_dbs
jmp	st_l1_010
st_end1_010:
call	print_ges
movs	0x9100,32,s3,0,32	
call	print_smdrim
call	pr_formfeed
jmp	main_send_sig





st_020:
call	print_lfsmdr
movs	0x9800,64,s3,0,64	
call	print_smdrim
movd	"00000000 ",s12,140

movd	"002 1 ",s15,100
movd	"B ",s15,0

acall	pfirst_dbs
st_l1_020:
acall	find_dbs
jnz	st_end1_020
acall	read11_dbs
movs	s11,0,s12,70,4

movd	"0",s10,36          

movd    "M",s10,37
call	pr_tln_s11_nocl
movd    " ",s10,37

movd	"002 1 ",s15,100
movd	"B ",s15,0

call	calc_total_open
acall	pnext_dbs
jmp	st_l1_020
st_end1_020:
call	print_ges
movs	0x9100,32,s3,0,32	
call	print_smdrim
call	pr_formfeed
jmp	main_send_sig





st_030:
call	print_lfsmdr
movs	0x9800,128,s3,0,64	
call	print_smdrim
movd	"00000000 ",s12,140

movd	"002 1 ",s15,100
movd	"P ",s15,0

acall	pfirst_dbs
st_l1_030:
acall	find_dbs
jnz	st_end1_030
acall	read11_dbs
movs	s11,0,s12,70,4

movd	"0",s10,36          

movd    "M",s10,37
call	pr_tln_s11_nocl
movd    " ",s10,37

movd	"002 1 ",s15,100
movd	"P ",s15,0

call	calc_total_open
acall	pnext_dbs
jmp	st_l1_030
st_end1_030:
call	print_ges
movs	0x9100,32,s3,0,32	
call	print_smdrim
call	pr_formfeed
jmp	main_send_sig





st_040:
call	print_lfsmdr
movs	0x9800,192,s3,0,64	
call	print_smdrim
movd	"00000000 ",s12,140

movd	"002 1 ",s15,100
movd	"A ",s15,0

acall	pfirst_dbs
st_l1_040:
acall	find_dbs
jnz	st_end1_040
acall	read11_dbs
movs	s11,0,s12,70,4

movd	"0",s10,36          

movd    "M",s10,37
call	pr_tln_s11_nocl
movd    " ",s10,37

movd	"002 1 ",s15,100
movd	"A ",s15,0

call	calc_total_open
acall	pnext_dbs
jmp	st_l1_040
st_end1_040:
call	print_ges
movs	0x9100,32,s3,0,32	
call	print_smdrim
call	pr_formfeed
jmp	main_send_sig




zi_extension:
compd   "9",s3,66
jnz     zi_exten_3dg
movd    "    ",s12,70
movs    s3,67,s12,70,3
movs    s12,70,s3,66,4
zi_exten_3dg:
movs    s3,66,s12,70,4




compd	"0",s3,65
jz	zi_pr_clearing

call	print_trennl
movs	0x9900,0,s3,0,64	
movs	s12,70,s3,33,4
call	print_smdrim

movd	"1",s10,36          

call	pr_tln_nocl
call	print_trennl
movs	0x9100,32,s3,0,32	
call	print_smdrim
call	pr_formfeed
jmp	main_send_sig

zi_pr_clearing:
call	print_trennl
movs	0x9900,64,s3,0,64	
movs	s12,70,s3,33,4
call	print_smdrim

movd	"1",s10,36          

call	pr_tln_cl
call	print_trennl
movs	0x9100,32,s3,0,32	
call	print_smdrim
call	pr_formfeed
jmp	main_send_sig




form_erg_m3_45:
compd	"00000000",s15,230
jnz	form_erg001
movd    "    ",s15,230
jmp	form_erg002
form_erg001:
acall	cut_lz
compd   "     ",s15,230
jnz	form_erg002
movd    "    0",s15,230
form_erg002:
movs    s15,230,s3,46,5


movd    ",",s3,51



movs    s15,235,s3,52,2
ret

print_clmess:
call	print_messim
movd	"                                                                              /n",s3,0
ret

print_lfmess:
movd	"/n",s3,0
call	print_messim
movd	"  ",s3,0
ret

print_lfsmdr:
movd	"/n",s3,0
call	print_smdrim
movd	"  ",s3,0
ret



line_fill_m3:
movd	"-------------------------------------------------------------------------------/n",s3,0
ret

print_trlmess:
call	line_fill_m3
call	print_messim
ret


test_form_ff:
compd   "2",s12,49
jz      test_pr2_ff
movd    "        ",s15,210
movc	2,s15,210
movd	"48 ",s15,220
acall	comp
compd	"GT",s15,204
jnz     head1_skip
call	do_ff1_ff
head1_skip:
ret

test_pr2_ff:
movd    "        ",s15,210
movc    8,s15,210
movd	"48 ",s15,220
acall	comp
compd	"GT",s15,204
jnz     head2_skip
call    do_ff2_ff
head2_skip:
ret




head_line1:
compd	"---/n",s3,58
jnz	head1_line1





call	init_b6
writeb	s3,0,6	


movd	" State_010_modul_3/n",s6,200
out	s6,200,c4

movd	"010 ",s12,75      
main_send_sig:
sendsig ans_sign,c3
jmp	main



head1_line1:
movs	s10,20,s12,49,1
compd	"---/n",s3,77
jnz	main_send_sig



call	print_messim
jmp	main_send_sig


state1_0:
movs	s10,20,s12,49,1
call	pr_ticket_b
jmp	state_0



t_ticket_eol:
compd	"  |/n",s3,58
jz     sk_10_state
compd	"  !/n",s3,58
sk_10_state:
ret




state_10:
call	t_ticket_eol
jnz	state1_0
writeb	s3,0,6
movd	"011 ",s12,75


movs	s3,2,s12,230,20
jmp	main_send_sig



state_11:
call	t_ticket_eol
jnz	state1_0
writeb	s3,0,6
movd	"012 ",s12,75
jmp	main_send_sig



state_12:
call	t_ticket_eol
jnz	state1_0
writeb	s3,0,6
movd	"013 ",s12,75
jmp	main_send_sig



state_13:
call	t_ticket_eol
jnz	state1_0
call	t_ti_name
jnz	 test_st_17		 

writeb	s3,0,6
movd	"014 ",s12,75
jmp	main_send_sig




test_st_17:
call	t_ti_cabin_set
jnz	state1_0
movd	"017 ",s12,75
writeb	s3,0,6
jmp	main_send_sig





state_17:
call	t_ticket_eol
jnz	state_l17
writeb	s3,0,6
jmp	main_send_sig



state_l17:
compd	"---/n",s3,58
jnz	state_p17



movs	s10,17,s12,49,1

state_p17:
writeb	s3,0,6
call	pr_ticket_b
movd	"000 ",s12,75
jmp	main_send_sig





state_14:
call	t_ticket_eol
jnz	state1_0
call	t_ti_room
jnz	state1_0
movs	s3,34,s12,70,4
writeb	s3,0,6
movd	"015 ",s12,75
jmp	main_send_sig





state_15:
call	t_ticket_eol
jnz	state1_0
call	t_ti_language
jnz	test_checkout
writeb	s3,0,6

movd	"016 ",s12,75
jmp	main_send_sig

test_checkout:
call	t_ti_deposit	
jnz	test_anzahl





call    ticket_euro
test_depos_skip:

writeb  s3,0,6
movd	"020 ",s12,75
jmp	main_send_sig

test_anzahl:
call	t_ti_number
jnz     test_empty_line

compd   "1  ",s10,30
jnz     test_anz_skip
movd    "Anzahl der Gespraeche :",s3,2
test_anz_skip:

writeb  s3,0,6
movd	"020 ",s12,75
jmp	main_send_sig

test_empty_line:
compd   "|     ",s3,0
jz     sk_e10_state
compd   "!     ",s3,0
jnz     state1_0
sk_e10_state:
writeb	s3,0,6

jmp     main_send_sig





state_16:
call	t_ticket_eol
jnz	state_l16

compd   "1  ",s10,30
jnz     state_16_skip

compd   "Amts",s3,2
jnz     tge_l11
movd    "Amtsgespraeche :",s3,2
jmp     state_16_skip
tge_l11:

compd   "Vorkasse",s3,2
jnz     tge_l11a

call    ticket_euro
tge_l11a:

compd   "Gespr",s3,2
jnz     tge_l12
movd    "Gespraechskosten :",s3,2

call    ticket_euro
jmp     state_16_skip
tge_l12:

compd   "   inclusive",s3,2
jnz     tge_l13

call    ticket_euro
jmp     state_16_skip
tge_l13:

compd   "Anzahl",s3,2
jnz     tge_l14
movd    "Anzahl der Gespraeche :",s3,2
jmp     state_16_skip
tge_l14:

compd   "Danke f",s3,2
jnz     tge_l15
movd    "Danke fuer Ihren Besuch!",s3,2
jmp     state_16_skip
tge_l15:

state_16_skip:
writeb  s3,0,6
jmp	main_send_sig

state_l16:
compd	"---/n",s3,58
jz	state_16skip
writeb	s3,0,6
call	pr_ticket_b
movd	"000 ",s12,75
jmp	main_send_sig

state_16skip:



writeb	s3,0,6
movs	s10,15,s12,49,1








checkin_again:
call	read_tln_dbs	
jnz	checkin_err	

compd   "A",s11,4
jnz     checkin1_skip
movd    "R",s11,4   
checkin1_skip:
compd   "255",s11,44      
jz	checkin_no




checkin_print:
movd	"1",s12,49     
call	pr_ticket_b

call	smdrhead1_print
movs    s11,44,s15,100,9
checkin_loop:
acall	preco_dbs
acall	read_dbs
movs	s14,9,s3,0,82
call	print_smdrim
movs	s14,0,s15,100,9
compd	"255",s14,0,8
jnz	checkin_loop

call	print_trennl
movs	0x9100,32,s3,0,32	
call	print_smdrim

checkin_save:
movd	"I",s11,80
call	write_tln_dbs
movd	"000 ",s12,75

call	pr_formfeed

jmp	main_send_sig


checkin_no:
compd	"0",s12,49
jnz	checkin_1skip
compd	"I",s11,80
jnz	checkin_save
checkin_1skip:
movd	"1",s12,49     
call	pr_ticket_b
movs	0x9100,192,s3,0,32	
call	pr_ticket
jmp	checkin_save

checkin_err:
movs	0x9400,192,s3,0,48	
writeb	s3,0,6
call	test_tln_free		
jz	ci_tln_insert
err_ci_insert:
movs	0x9500,0,s3,0,48	
writeb	s3,0,6
movd	"1",s12,49
call	pr_ticket_b
call	pr_formfeed
movd	"000 ",s12,75
jmp	main_send_sig


ci_tln_insert:
call	ins_tln_room
jnz	err_ci_insert
movs	0x9500,48,s3,0,48	
writeb	s3,0,6
movd	"1",s12,49     
jmp	checkin_again













state_20:


compd	"---/n",s3,58
jz	state_20skip

compd   "1  ",s10,30
jnz     st_20_skip

compd   "Anz",s3,2
jnz     tge_l201
movd    "Anzahl der Gespraeche :",s3,2
jmp     st_20_skip
tge_l201:

compd   "Gesamt",s3,2
jnz     tge_l202

call    ticket_euro
jmp     st_20_skip
tge_l202:

compd   "   incl",s3,2
jnz     tge_l203

call    ticket_euro
jmp     st_20_skip
tge_l203:

compd   "Soll",s3,2
jnz     tge_l204

call    ticket_euro
jmp     st_20_skip
tge_l204:

compd   "Gutha",s3,2
jnz     tge_l205

call    ticket_euro
jmp     st_20_skip
tge_l205:

st_20_skip:
writeb  s3,0,6
jmp	main_send_sig
state_20skip:



writeb	s3,0,6
movs	s10,16,s12,49,1




call	read_tln_dbs	
jnz	checkout_err
compd	"255",s11,44      
jz	checkout_no
movd	"1",s12,49
call	pr_formfeed

call	pr_ticket_b

movd	"/n",s3,0
call	pr_ticket
call	smdrhead1_print

checkout_loop:
movs	s11,44,s15,100,9
acall	preco_dbs
acall	read_dbs
movs	s14,9,s3,0,82
call	print_smdrim
call	unlink_tln
call	link_free
compd	"255",s11,44
jnz	checkout_loop
movs	s11,23,s15,210,8
movs	s11,13,s15,220,8
acall	add
movs	s15,230,s11,23,8
movd	"00000000",s11,13

call	print_trennl
movs	0x9100,32,s3,0,32	
call	print_smdrim

call	pr_formfeed

checkout_save:
movd	"O",s11,80
call	write_tln_dbs
movd	"000 ",s12,75

jmp	main_send_sig


checkout_no:
call	pr_ticket_b
movs	0x9100,192,s3,0,32	
call	pr_ticket
jmp	checkout_save

checkout_err:
movd	"1",s12,49
movs	0x9400,192,s3,0,48	
writeb	s3,0,6
call	pr_ticket_b
call	pr_formfeed
movd	"000 ",s12,75
jmp	main_send_sig




pr_ticket_b:
movs	s3,0,s8,0,150
call    test_form_ff
pr_ticket_l:
readb	s3,0,6
jz	pr_ticket_e
call	pr_ticket
jmp	pr_ticket_l
pr_ticket_e:
movs	s8,0,s3,0,150
ret






r311_smin:
call    form_r311
jmp     do_smdr_in


r312_smin:
call    form_r312
jmp     do_smdr_in



smdr_2dg_in:
movs	s3,3,s3,2,4

smdr_in:
call    form_r26_3dg
do_smdr_in:
movd    "00000000",s15,230
movd    "00000000",s12,50
movd	"         ",s3,70
movd	"/n",s3,79         

movs	s10,21,s12,49,1

call	print_smdrim
jmp	main_send_sig



r311_smout:
call    form_r311
jmp     do_smdr_out


r312_smout:
call    form_r312
jmp     do_smdr_out


smdr_2dg_out:
movs	s3,3,s3,2,4

smdr_out:
call    form_r26_3dg
do_smdr_out:
call    save_smdr               
jmp	main_send_sig



test_im_sign:
case	im_sign,test_tf_sign
setl	11,2



in	s6,100
movd	"Okay wait/n",s6,0
out	s6,0,c4



compd	"init free_pool",s6,100
jz	go_init_cell
compd	"init ext_dbs",s6,100
jz	go_init_tln
compd	"init buffers",s6,100
jz	go_buff_init
compd	"set printers=",s6,100
jz	go_set_printers
compd   "set printer?=",s6,100
jz      go_set_single_printer
compd   "set hotel_name=",s6,100
jz	go_set_hotel
compd	"set linefeeds=",s6,100
jz	go_set_linefeeds
compd	"set ext ",s6,100
jz	go_set_tln
compd   "set euro=",s6,100
jz      go_set_euro



compd	"disp ext_dbs",s6,100
jz	go_tln_display
compd	"disp config",s6,100
jz	go_cfg_display
compd	"disp ext ",s6,100
jz	go_tln_n_display
compd	"disp reco ",s6,100
jz	go_reco_n_display
compd	"cha ext ",s6,100
jz	go_cha_tln
compd	"del ext ",s6,100
jz	go_del_tln

compd   "emul ????/n",s6,100
jz      go_emul

movd    " command not found/n",s6,100
out	s6,100,c4

main_message:
movd	" G-D-C  V0.9c Modul 3 Ready/n",s6,100
anss	s6,100
jmp	main


test_tf_sign:
setl	11,2
sendsig ans_sign,c3
jmp     main






go_set_euro:
compd   "set euro=",s6,100
compd   "0",s6,109
jz      set_euro
compd   "1",s6,109
jz      set_euro
compd   "2",s6,109
jz      set_euro
compd   "3",s6,109
jz      set_euro
movd    " Error parameter/n",s6,100
out	s6,100,c4
jmp     main_message
set_euro:
movs    s6,109,s10,39,1
jmp     main_message


go_emul:
movs    s6,105,s3,65,4
acall   read_dt
movd    "  //  //   xx:xx  ",s3,12
movs    s15,180,s3,12,2
movs    s15,182,s3,15,2
movs    s15,184,s3,18,2
movs    s15,188,s3,21,2
movs    s15,190,s3,24,2
movd    " G-D-C  V0.9c Modul 3 Ready/n",s6,100
anss	s6,100
jmp     st_config










go_init_cell:

call    init_first
call    init_buffer
jmp     main_message

init_first:

clear	s12,0 	
clear	s10,0	
call	dbs_pool_init
call	dbs_tln_init
movd	"1",s12,49            
movd    "001110911111001",s10,15
movd	"00 ",s10,30
movd	"00 ",s10,33
movd    "00 ",s12,220
movd    "   3 ",s10,36





movd    "GDC09Euro/n",s10,41
ret

go_buff_init:
call    init_buffer
jmp     main_message

init_buffer:
call    init_b0
call	init_b1
call	init_b2
call	init_b3
call	init_b4
call	init_b5
ret

go_init_tln:
call	dbs_tln_init
jmp	main_message

go_tln_display:
call	tln_display
jmp	main_message

go_tln_n_display:
movd	"2 0 ",s15,100
acall	pfirst_dbs
movd	" EXTENSION CONFIGURATION /n",s6,0
out	s6,0,c4
movd	"     ",s15,0
movs    s6,109,s15,0,4
acall	find_dbs
jz	disp_tln_n
movd	" Extension not found in EXT-DBS!/n",s6,0
out	s6,0,c4
jmp	main_message

go_reco_n_display:
compd	"??? ???/n",s6,111
jnz	tln_err_para
movd	"          ",s15,100
movs	s6,111,s15,100,7
acall	preco_dbs
jnz	reco_err_reco
acall	read_dbs
movd	"/n",s14,90
out	s14,0,c4
jmp	main_message

reco_err_reco:
movd	" ERROR record not found!/n",s6,0
out	s6,0,c4
jmp	main_message

disp_tln_n:
acall	read_dbs
out	s14,0,c4
jmp	main_message

go_cfg_display:
call	cfg_display
jmp	main_message

go_set_printers:
compd	"???????????????/n",s6,113
jz	printer_set
go_pr_error:
movd    " ERROR on printer configuration!/n",s6,100
out	s6,100,c4
jmp	main_message

go_set_single_printer:


compd   "a",s6,111
jnz     skip_pr_a
movs    s6,113,s10,15,1  
jmp     main_message
skip_pr_a:
compd   "b",s6,111
jnz     skip_pr_b
movs    s6,113,s10,16,1  
jmp     main_message
skip_pr_b:
compd   "c",s6,111
jnz     skip_pr_c
movs    s6,113,s10,17,1       
jmp     main_message
skip_pr_c:
compd   "d",s6,111
jnz     skip_pr_d
movs    s6,113,s10,18,1 
jmp     main_message
skip_pr_d:
compd   "e",s6,111
jnz     skip_pr_e
movs    s6,113,s10,19,1     
jmp     main_message
skip_pr_e:
compd   "f",s6,111
jnz     skip_pr_f
movs    s6,113,s10,20,1      
jmp     main_message
skip_pr_f:
compd   "g",s6,111
jnz     skip_pr_g
movs    s6,113,s10,21,1  
jmp     main_message
skip_pr_g:
compd   "h",s6,111
jnz     skip_pr_h
movs    s6,113,s10,22,1    
jmp     main_message
skip_pr_h:
compd   "i",s6,111
jnz     skip_pr_i
movs    s6,113,s10,23,1       
jmp     main_message
skip_pr_i:
compd   "j",s6,111
jnz     skip_pr_j
movs    s6,113,s10,24,1      
jmp     main_message
skip_pr_j:
compd   "k",s6,111
jnz     skip_pr_k
movs    s6,113,s10,25,1        
jmp     main_message
skip_pr_k:
compd   "l",s6,111
jnz     skip_pr_l
movs    s6,113,s10,26,1  
jmp     main_message
skip_pr_l:
compd   "m",s6,111
jnz     skip_pr_m
movs    s6,113,s10,27,1          
jmp     main_message
skip_pr_m:
compd   "n",s6,111
jnz     skip_pr_n
movs    s6,113,s10,28,1       
jmp     main_message
skip_pr_n:
compd   "o",s6,111
jnz     skip_pr_o
movs    s6,113,s10,29,1       
jmp     main_message
skip_pr_o:
jmp     go_pr_error

printer_set:
movs	s6,113,s10,15,15
jmp	main_message


go_set_hotel:
movd	"                    ",s12,230
movs	s6,115,s12,230,20
replace "/n ",s12,230,20
jmp	main_message

go_set_linefeeds:
movd	"    ",s12,220
movs	s6,114,s12,220,2
replace "/n ",s12,220,3
jmp	main_message






go_set_tln:

compd   "?????????xxxx",s6,108
jnz	tln_err_para
movs	s6,108,s15,0,4
movd	"002 0 ",s15,100
acall	pfirst_dbs
acall	find_dbs
jz	tln_err_found
call	test_tln_free
jnz	tln_err_nospace
call	find_ins_point
jnz	tln_err_ins
movs	s6,108,s14,0,13
call	dbs_write
call	ins_write
jnz	tln_err_ins
jmp	main_message




go_del_tln:
movd	"     ",s15,0
movs    s6,108,s15,0,4
compd	"999",s15,0
jz	error_not_possible
movd	"002 0 ",s15,100
acall	pfirst_dbs
acall	find_dbs
jnz	tln_err_notfound

acall	read11_dbs
compd	"255",s11,44
jz	go_del_1tln
movs	s15,0,s12,70,4
call	pr_tln_cl
movd	"002 0 ",s15,100
movs	s12,70,s15,0,4
acall	pfirst_dbs
acall	find_dbs
go_del_1tln:
call	del_write
jnz	tln_err_ins
jmp	main_message




go_cha_tln:
compd   "???????????xx",s6,108
jnz	tln_err_para
movs	s6,108,s15,0,4
compd	"999",s15,0
jz	error_not_possible
movd	"002 0 ",s15,100
acall	pfirst_dbs
acall	find_dbs
jnz	tln_err_notfound
acall	read11_dbs
movs	s6,112,s11,4,9
acall	write11_dbs
jmp	main_message


tln_err_ins:
movd	"ERROR on insert\delete of extension!/n",s6,0
out	s6,0,c4
jmp	main_message

tln_err_nospace:
movd	"ERROR no space in EXT-DBS!/n",s6,0
out	s6,0,c4
jmp	main_message

tln_err_notfound:
movd	"Extension not found in EXT-DBS!/n",s6,0
out	s6,0,c4
jmp	main_message

error_not_possible:
movd	"ERROR do not change or delete extension 999 !/n",s6,0
out	s6,0,c4
jmp	main_message

tln_err_found:
movd	"Extension allready defined!/n",s6,0
out	s6,0,c4
jmp	main_message

tln_err_para:
movd	"ERROR in parameter!/n",s6,0
out	s6,0,c4
jmp	main_message










save_smdr:
call	form_erg_cost
movd	"/n",s3,79         

movs	s3,12,s12,40,9	




movs	s3,0,s8,0,100

movs	s10,23,s12,49,1
compd   "0",s12,49             
jz      cs_saveit
movd    "0",s10,36          

comps	s12,40,s12,90,6	
jz	cs_saveit
comps	s12,43,s12,93,2
jz	cs_test_day




movd    "B  ",s15,0    
movd	"002 1     ",s15,100
acall	pfirst_dbs
acall	find_dbs
jnz	nom_barphone

call	print_trennl
movs	0x9900,128,s3,0,64	
call	print_smdrim
call	print_trennl
call	pr_bar_clear

nom_barphone:
movd    "M  ",s15,0    
movd	"002 3     ",s15,100
acall	pfirst_dbs
acall	find_dbs
jnz	nod_adminphone

call	print_trennl
movs	0x9b00,0,s3,0,80	
call	print_smdrim
call	print_trennl
call	pr_adminm_clear
call	print_trennl
movs	0x9100,32,s3,0,32	
call	print_smdrim
call    pr_formfeed
jmp	cs_saveit

cs_test_day:
comps	s12,40,s12,90,2
jz	cs_saveit

movd    "B  ",s15,0    
movd	"002 1     ",s15,100
acall	pfirst_dbs
acall	find_dbs
jnz	nod_barphone

call	print_trennl
movs	0x9900,128,s3,0,64	
call	print_smdrim
call	print_trennl
call	pr_bar_clear
nod_barphone:
movd    "D  ",s15,0    
movd	"002 3     ",s15,100
acall	pfirst_dbs
acall	find_dbs
jnz	nod_adminphone

call	print_trennl
movs	0x9b00,80,s3,0,80	
call	print_smdrim
call	print_trennl
call	pr_admind_clear
call	print_trennl
movs	0x9100,32,s3,0,32	
call	print_smdrim
call	pr_formfeed
nod_adminphone:

cs_saveit:
movs	s12,40,s12,90,9



movs	s8,0,s3,0,100




tln_dbs_search:
movs	s3,1,s15,0,4
movd	"002 0     ",s15,100
acall	pfirst_dbs
acall	find_dbs
jnz	tln_not_found
acall	read11_dbs
acall	getr_dbs
movs	s15,100,s12,60,9




movs	s12,50,s15,220,8
movs	s11,13,s15,210,8
acall	add
movs	s15,230,s11,13,8



compd   "N",s11,8
jz      skip_save

call    write_smdr      
jnz	err_smdr_save

skip_save:




movs	s10,26,s12,49,1

compd	"R",s11,4
jz	room_tln
compd	"P",s11,4
jz	phone_booth
compd	"B",s11,4
jz	bar_tln




compd	"I",s11,5
cz      admin_i_do
compd   "T",s11,5
cz      admin_t_do
jmp     csave_smdr

admin_i_do:
call    print_smdrim
ret

admin_t_do:
call    single_ticket
ret


csave_smdr:
movs	s12,60,s15,100,9
acall	preco_dbs
acall	write11_dbs
ret



room_tln:
compd	"I",s11,5
cz	print_smdrim
compd   "T",s11,5
cz      room_t_do

jmp	csave_smdr

room_t_do:
call    single_ticket
ret

phone_booth:
compd	"I",s11,5
cz	print_smdrim
compd   "T",s11,5
cz      phone_t_do

jmp	csave_smdr

phone_t_do:
call    single_ticket
ret

bar_tln:
compd	"I",s11,5
cz      print_smdrim
compd   "T",s11,5
cz      bar_t_do

jmp	csave_smdr

bar_t_do:
call    single_ticket
ret





tln_not_found:
movs	s10,25,s12,49,1

call	print_smdrim
movs	s3,0,s3,100,85	
movs	0x9400,192,s3,0,48	
call	print_smdrim
call	test_tln_free		
jz	tln_insert1
err_tln_insert:
movs	0x9500,0,s3,0,48	
call	print_smdrim
ret

tln_insert1:
call	ins_tln_admin
jnz	err_tln_insert
movs	0x9500,96,s3,0,48	
call	print_smdrim
movs	s3,100,s3,0,85	
jmp	tln_dbs_search

err_smdr_save:
call	print_smdrim
movs	0x9500,144,s3,0,48	
call	print_smdrim
call	pr_formfeed
ret













pr_adminm_clear:
movd	"A  ",s15,0    
movd	"002 1     ",s15,100
acall	pfirst_dbs
acall	find_dbs
jnz	pr_amcl_err

movd	"00000000",s12,140

pr_amcl_loop:
acall	read11_dbs
compd   "M",s10,37          
jz      pr_adm_1
compd   "M",s11,6
jz      pr_adm_1
compd   "D",s11,6
jnz     pr_amcl_next
pr_adm_1:
acall   getr_dbs
movs	s15,100,s12,60,9	
compd	"255",s11,44      
jz	pr_amcl_no_calls
pr_amcl_l1:
movs	s11,44,s15,100,9
acall	preco_dbs
acall	read_dbs
movs	s14,9,s3,0,82
call	print_smdrim
call	unlink_tln
call	link_free
compd	"255",s11,44
jnz	pr_amcl_l1

pr_amcl_sum:
call    print_sum
call	calc_total_sum
call	calc_closed_sum

movs	s12,60,s15,100,9
acall	preco_dbs
acall	write11_dbs	
pr_amcl_next:
acall	pnext_dbs
movd	"002 1     ",s15,100
acall	find_dbs	
jz	pr_amcl_loop




call	print_ges
ret

pr_amcl_no_calls:
compd   "M",s10,37          
jz      pr_amcl_sum
jmp     pr_amcl_next

pr_adcl_err:
pr_amcl_err:
movs	0x9900,192,s3,0,64	
call	print_smdrim
ret








pr_admind_clear:
movd	"A  ",s15,0    
movd	"002 1     ",s15,100
acall	pfirst_dbs
acall	find_dbs
jnz	pr_adcl_err

movd	"00000000",s12,140

pr_adcl_loop:
acall	read11_dbs
compd	"D",s11,6
jnz	pr_adcl_next
acall	getr_dbs
movs	s15,100,s12,60,9	
compd	"255",s11,44      
jz	pr_adcl_no_calls
pr_adcl_l1:
movs	s11,44,s15,100,9
acall	preco_dbs
acall	read_dbs
movs	s14,9,s3,0,82
call	print_smdrim
call	unlink_tln
call	link_free
compd	"255",s11,44
jnz	pr_adcl_l1
call	print_sum
call	calc_total_sum
call	calc_closed_sum

movs	s12,60,s15,100,9
acall	preco_dbs
acall	write11_dbs	
pr_adcl_next:
acall	pnext_dbs
movd	"002 1     ",s15,100
acall	find_dbs	
jz	pr_adcl_loop




call	print_ges
ret

pr_adcl_no_calls:
jmp	pr_adcl_next















pr_bar_clear:
movd	"B  ",s15,0    
movd	"002 1     ",s15,100
acall	pfirst_dbs
acall	find_dbs
jnz	pr_barcl_err

movd	"00000000",s12,140

pr_barcl_loop:
acall	read11_dbs
acall	getr_dbs
movs	s15,100,s12,60,9	
compd	"255",s11,44      
jz	pr_barcl_no_calls
pr_barcl_l1:
movs	s11,44,s15,100,9
acall	preco_dbs
acall	read_dbs
movs	s14,9,s3,0,82
call	print_smdrim
call	unlink_tln
call	link_free
compd	"255",s11,44
jnz	pr_barcl_l1
pr_barcl_prsum:
call    print_sum
call	calc_total_sum
call	calc_closed_sum

movs	s12,60,s15,100,9
acall	preco_dbs
acall	write11_dbs	
pr_barcl_next:
acall	pnext_dbs
movd	"002 1     ",s15,100
acall	find_dbs	
jz	pr_barcl_loop




call	print_ges
ret

pr_barcl_no_calls:
compd   "M",s10,37          
jz      pr_barcl_prsum
movd    " BAR-Telefon            keine Gespraeche/n",s3,0
movs	s11,0,s3,14,3
call	print_smdrim
call	print_trennl
jmp	pr_barcl_next

pr_barcl_err:
movs	0x9d00,0,s3,0,64	
call	print_smdrim
ret







pr_tln_nocl:
call	read_tln_dbs	
jnz	pr2_nocl_err

pr_tln_s11_nocl:
compd	"255",s11,44      
jz	pr2_nocl_noreco
movs	s11,44,s15,100,9
pr2_nocl_loop:
acall	preco_dbs
acall	read_dbs
movs	s14,9,s3,0,82
call	print_smdrim
movs	s14,0,s15,100,9
compd	"255",s14,0,8
jnz	pr2_nocl_loop

pr2_nocl_l1:
call    print_sum

ret

pr2_nocl_noreco:
compd   "M",s10,37          
jz      pr2_nocl_l1
compd	"0",s10,36
jz	pr2_nocl_exit
movs	0x9100,192,s3,0,32	
call	print_smdrim
pr2_nocl_exit:
ret

pr2_nocl_err:


ret






pr_tln_cl:
call	read_tln_dbs	
jnz	pr2_cl_err

compd	"255",s11,44      
jz	pr2_cl_noreco
pr2_cl_loop:
movs	s11,44,s15,100,9
acall	preco_dbs
acall	read_dbs
movs	s14,9,s3,0,82
call	print_smdrim
call	unlink_tln
call	link_free
compd	"255",s11,44
jnz	pr2_cl_loop

pr2_cl_prsum:
call    print_sum
call	calc_closed_sum

call	write_tln_dbs
ret

pr2_cl_noreco:
compd   "M",s10,37          
jz      pr2_cl_prsum
compd   "0",s10,36
jz	pr2_cl_exit
movs	0x9100,192,s3,0,32	
call	print_smdrim
pr2_cl_exit:
ret

pr2_cl_err:


ret



form_erg_cost:
compd	"00000000",s15,230
jnz	form_erg_cost1
movd    "     ",s15,230
jmp	form_erg_cost2
form_erg_cost1:
acall	cut_lz
replace " 0",s15,234,4
form_erg_cost2:
movs    s15,230,s3,71,5


movd	",",s3,76



movs    s15,235,s3,77,2
ret



print_sum:
call	load_def80
compd   "1",s10,40
jz      print_do_sum
compd   "00000000",s11,13
jnz     print_do_sum
ret
print_do_sum:

movs    0x9c00,0,s3,0,20  
movs    s11,0,s3,5,4    
movs    s11,13,s15,230,8
call	form_erg_cost
movd	"/n",s3,79         
compd   "0",s10,39
jz      print_do_ats
compd   "1",s10,39
jz      print_do_ats

movs    0x9300,243,s3,66,3 
compd   "2",s10,39
jnz     skip_print_sum

movs    s3,70,s9,200,9    
call    euro_to_ats
movs    s9,190,s3,50,10
movs    0x9300,240,s3,47,3 

jmp     skip_print_sum

print_do_ats:
movs    0x9300,240,s3,66,3 


compd   "1",s10,39
jnz     skip_print_sum
movs    s3,70,s9,200,9    
call    ats_to_euro
movs    s9,190,s3,50,10
movs    0x9300,243,s3,47,3
skip_print_sum:
call    print_smdrim
call	print_trennl
ret



calc_total_sum:
calc_total_open:
movs	s11,13,s15,210,8
movs	s12,140,s15,220,8
acall	add
movs	s15,230,s12,140,8
ret


calc_total_closed:
movs	s11,23,s15,210,8
movs	s12,140,s15,220,8
acall	add
movs	s15,230,s12,140,8
ret



calc_closed_sum:
movs	s11,13,s15,220,8
movs	s11,23,s15,210,8
acall	add
movs	s15,230,s11,23,8
movd	"00000000",s11,13
ret



print_ges:
compd	"00000000",s12,140
jz	print2_eges
call	load_def80
movs	0x9c00,20,s3,0,20	
movs	s12,140,s15,230,8
call	form_erg_cost
movd	"/n",s3,79         

compd   "0",s10,39
jz      print_ges_ats
compd   "1",s10,39
jz      print_ges_ats

movs    0x9300,243,s3,66,3 
compd   "2",s10,39
jnz     skip_print_ges

movs    s3,70,s9,200,9    
call    euro_to_ats
movs    s9,190,s3,50,10
movs    0x9300,240,s3,47,3 

jmp     skip_print_ges

print_ges_ats:
movs    0x9300,240,s3,66,3 


compd   "1",s10,39
jnz     skip_print_ges
movs    s3,70,s9,200,9    
call    ats_to_euro
movs    s9,190,s3,50,10
movs    0x9300,243,s3,47,3
skip_print_ges:

call    print_smdrim
call	print_trennl
print2_eges:
ret


load_h60:
movd    "-------------------------------------------------------------/n",s3,0
ret



load_def60:
movd    "|                                                           |/n",s3,0
ret



load_def80:
movd	"                                                                               /n",s3,0
ret




print_trennl:
call	line_fill_m3
call	print_smdrim
ret













print_smdrim:


compd	"1",s12,49
jz	send_to_pr1
compd	"2",s12,49
jz	send_to_pr2
compd	"9",s12,49
jz	send_to_save
ret



send_to_save:
call	save_smdr
ret



send_to_pr2:
check2_head:
compc	9,2
jz	check2_length

new_page2:
call	ff2_printer
call	smdrhead2_print

check2_length:
compc	8,68
jz	new_page2

call	print2_m3
ret



send_to_pr1:
check1_head:
compc	3,2
jz	check1_length

new_page1:
call	ff1_printer
call	smdrhead1_print

check1_length:
compc	2,68
jz	new_page1

call	print1_m3
ret















print_messim:


compd	"1",s12,49
jz	send_p1_mess
compd	"2",s12,49
jz	send_p2_mess
ret



send_p2_mess:
compc	9,4
jz	check2_mess_length

new_page2_mess:
call	ff2_printer
setc	9,4	

check2_mess_length:
compc	8,68
jz	new_page2_mess


movd	" modul_3_call_print2_m3/n",s6,200
out	s6,200,c4

call	print2_m3

ret



send_p1_mess:
compc	3,4
jz	check1_mess_length

new_page1_mess:
call	ff1_printer
setc	3,4	

check1_mess_length:
compc	2,68
jz	new_page1_mess

call	print1_m3
ret


























pr_ticket:


compd	"1",s12,49
jz	pr1_ticket
compd	"2",s12,49
jz	pr2_ticket
ret




pr2_ticket:
compc   9,3   
jz      pr2_go_ticket




new_pr2_ticket:
call    ff2_printer
setc    9,3   

pr2_go_ticket:
compc   8,68
jz      new_pr2_ticket

call    print2_m3
ret


pr1_ticket:
compc	3,3	
jz	pr1_go_ticket




new_pr1_ticket:
call	ff1_printer
setc	3,3	

pr1_go_ticket:
compc	2,68
jz	new_pr1_ticket

call	print1_m3
ret


pr_status_head:
call	print_trlmess

movs	0x9a00,0,s3,0,80	
call	print_messim

call	print_trlmess
movd	"                                                                                /n",s3,0
ret











pr_formfeed:



compd	"1",s12,49
jz	ff1_printer
compd	"2",s12,49
jz	ff2_printer
ret




ff1_printer:
movc	2,s12,215	
comps	s12,205,s12,215,3	
jz	eff1_printer
compc	2,68		
jz      do_ff1_ff                       
movc	s12,220,5	
compc	5,0			
jz	do_ff1_ff
movd	"/n",s6,100
go_lff1_ff:
call	print1_m36
compc	2,68		
jz	do_ff1_ff
decc	5
jnz	go_lff1_ff
movc	2,s12,215
movc	s12,215,5	
test_lff1_ff:
incc	5
compc	5,68		 
jz	do_ff1_ff

incc	5
compc	5,68		 
jz	do_ff1_ff

incc	5
compc	5,68		 
jz	do_ff1_ff

incc	5
compc	5,68		 
jz	do_ff1_ff

incc	5
compc	5,68		 
jz	do_ff1_ff

jmp	eff1_printer

do_ff1_ff:
compd   "1",s10,29
jz      ff1_skip
compd   "3",s10,29
jz      ff1_skip
movd    "^L/n",s6,100
call    print1_m36
ff1_skip:
setc	2,1		
setc	3,1		

eff1_printer:
movc	2,s12,205	
ret

smdrhead1_print:
movd	"-------------------------------------------------------------------------------/n",s6,100
call	print1_m36
movs	0x9a00,80,s6,100,80
call	print1_m36
movs	0x9a00,160,s6,100,80
compd   "0",s10,39
jz      skip_smdrhe
compd   "1",s10,39
jz      skip_smdrhe
movs    0x9300,243,s6,170,3 
skip_smdrhe:
call    print1_m36
movd	"-------------------------------------------------------------------------------/n",s6,100
call	print1_m36
setc	3,2		
ret



ff2_printer:
movc	8,s12,215	
comps	s12,210,s12,215,3	
jz	eff2_printer
compc	8,68		
jz	do_ff2_ff
movc	s12,220,5	
compc	5,0			
jz	do_ff2_ff
movd	"/n",s6,100
go_lff2_ff:
call	print2_m36
compc	8,68		
jz	do_ff2_ff
decc	5
jnz	go_lff2_ff
movc	8,s12,215
movc	s12,215,5	
test_lff2_ff:
incc	5
compc	5,68		 
jz	do_ff2_ff

incc	5
compc	5,68		 
jz	do_ff2_ff

incc	5
compc	5,68		 
jz	do_ff2_ff

incc	5
compc	5,68		 
jz	do_ff2_ff

incc	5
compc	5,68		 
jz	do_ff2_ff

jmp	eff2_printer

do_ff2_ff:
compd   "2",s10,29
jz      ff2_skip
compd   "3",s10,29
jz      ff2_skip
movd	"^L/n",s6,100
call	print2_m36
ff2_skip:
setc	8,1		
setc	9,1		
movd	"001 ",s12,210

eff2_printer:
movc	8,s12,210
ret

smdrhead2_print:
movd	"-------------------------------------------------------------------------------/n",s6,100
call	print2_m36
movs	0x9a00,80,s6,100,80
call	print2_m36
movs	0x9a00,160,s6,100,80
compd   "0",s10,39
jz      skip_smdrh2
compd   "1",s10,39
jz      skip_smdrh2
movs    0x9300,243,s6,170,3 
skip_smdrh2:
call	print2_m36
movd	"-------------------------------------------------------------------------------/n",s6,100
call	print2_m36
setc	9,2		
ret




print1_m36:

out	s6,100,c4

print11_m36:
writeb	s6,100,1
jz	eprint1
wait	tx_sign
jmp	print11_m36

eprint1:
incc	2
sendsig ans_sign,c0
wait	tx_sign
ret


print1_m3:

out	s3,0,c4

print12_m3:
writeb	s3,0,1
jz	eprint1
wait	tx_sign
jmp	print12_m3


print2_m36:

out	s6,100,c4

print21_m36:
writeb	s6,100,3
jz	eprint2
wait	tx_sign
jmp	print21_m36

eprint2:
incc	8
sendsig ans_sign,c2
wait	tx_sign
ret


print2_m3:

out	s3,0,c4

print22_m3:
writeb	s3,0,3
jz	eprint2
wait	tx_sign
jmp	print22_m3













read_tln_dbs:
movd	"002 0     ",s15,100
movs	s12,70,s15,0,4
acall	pfirst_dbs
acall	find_dbs
jz	found_read_tln
ret
found_read_tln:
acall	read11_dbs
acall	getr_dbs
movs	s15,100,s12,60,9
jmp	z_ret






write_tln_dbs:
movs	s12,60,s15,100,9
acall	preco_dbs
acall	write11_dbs
ret












write_smdr:
compd	"Gebuhrenzuordnung",s3,43
jnz	write_1_smdr



movd	"002 1     ",s15,100
movd	"P",s15,0
acall	pfirst_dbs
search_p_loop:
acall	find_dbs
jnz	wr_p_not_found
acall	read_dbs
acall	getr_dbs
movs	s15,100,s12,100,9
call	search_reco
jz	z_ret			

movs	s12,100,s15,100,9
acall	preco_dbs
acall	pnext_dbs
movd	"002 1     ",s15,100
movd	"P",s15,0
jmp	search_p_loop
wr_p_not_found:



movd	"002 1     ",s15,100
movd	"B",s15,0
acall	pfirst_dbs
search_b_loop:
acall	find_dbs
jnz	wr_b_not_found
acall	read_dbs
acall	getr_dbs
movs	s15,100,s12,100,9
call	search_reco
jz	z_ret			

movs	s12,100,s15,100,9
acall	preco_dbs
acall	pnext_dbs
movd	"002 1     ",s15,100
movd	"B",s15,0
jmp	search_b_loop
wr_b_not_found:

write_1_smdr:
call	unlink_free		
jnz	err_write_smdr
movs	s3,0,s14,9,81   
call	link_tln
jmp	z_ret
err_write_smdr:
ret










search_reco:



compd	"255",s14,44
jz	nz_ret			
comps	s14,44,s14,53,9
jnz	search_3_reco



movs	s14,44,s15,100,9
acall	preco_dbs
acall	read_dbs
comps	s3,12,s14,21,23
jnz	nz_ret
comps	s3,70,s14,79,9
jnz	nz_ret
movs	s15,100,s12,20,9	
movs	s14,9,s14,45,4
movs	s3,0,s14,9,4
movs	0x9300,249,s14,14,2	
acall	write_dbs
movs	s12,100,s15,100,9
acall	preco_dbs
acall	read_dbs
movd	"255",s14,44
movd	"255",s14,53
movs	s14,13,s15,210,8
movs	s12,50,s15,220,8
acall	subb
movs	s15,230,s14,13,8
acall	write_dbs
movs	s12,20,s15,100,9
acall	preco_dbs
acall	read_dbs
jmp	link_tln



search_3_reco:
movs	s14,44,s12,20,9
movs	s14,44,s12,110,9
movs	s14,53,s12,120,9
movd	"255",s12,130

search_loop:
movs	s12,20,s15,100,9

acall	preco_dbs
acall	read_dbs
comps	s3,12,s14,21,23
jnz	search_3_next
comps	s3,70,s14,79,9
jnz	search_3_next

movs	s14,9,s14,45,4
movs	s3,0,s14,9,4
movs	0x9300,249,s14,14,2	
acall	write_dbs



comps	s12,20,s12,110,9
jnz	search_3_1
movs	s14,0,s12,110,9
jmp	search_3_link

search_3_1:



comps	s12,20,s12,120,9
jnz	search_3_2
movs	s12,130,s12,120,9
movs	s12,120,s15,100,9
acall	preco_dbs
acall	read_dbs
movd	"255",s14,0
acall	write_dbs
jmp	search_3_link

search_3_2:



movs	s12,130,s15,100,9
movs	s14,0,s12,130,9
acall	preco_dbs
acall	read_dbs
movs	s12,130,s14,0,9
acall	write_dbs
jmp	search_3_link



search_3_next:
movs	s12,20,s12,130,9
movs	s14,0,s12,20,9
compd	"255",s12,20
jnz	search_loop
jmp	nz_ret

search_3_link:
movs	s12,100,s15,100,9
acall	preco_dbs
acall	read_dbs
movs	s12,110,s14,44,9
movs	s12,120,s14,53,9
movs	s14,13,s15,210,8
movs	s12,50,s15,220,8
acall	subb
movs	s15,230,s14,13,8
acall	write_dbs
movs	s12,20,s15,100,9
acall	preco_dbs
acall	read_dbs
jmp	link_tln










link_tln:
compd	"255",s11,44              
jz	tln_to_empty
tln_ln_write:
movs	s12,20,s15,100,9
acall	preco_dbs
movd	"255",s14,0
acall	write_dbs

movs	s11,53,s15,100,9
acall	preco_dbs
acall	read_dbs
movs	s12,20,s14,0,9
movs	s12,20,s11,53,9
acall	write_dbs
jmp	tln_pcount
tln_to_empty:
movs	s12,20,s15,100,9
acall	preco_dbs
movd	"255",s14,0
acall	write_dbs

movs	s12,20,s11,44,9
movs	s12,20,s11,53,9
tln_pcount:




jmp	z_ret













unlink_tln:
compd	"255",s11,44
jz	err_tln_unlink
comps	s11,44,s11,53,8	      
jz	unlink_tln_last
movs	s11,44,s15,100,9
acall	preco_dbs
acall	read_dbs
movs	s11,44,s12,20,9
movs	s14,0,s11,44,9




jmp     unlink_save_ext         



err_tln_unlink:
jz	nz_ret

unlink_tln_last:
movs	s11,44,s12,20,8
movd	"255 ",s11,44
movd	"255 ",s11,53





unlink_save_ext:
movs    s12,60,s15,100,9
acall	preco_dbs
acall	write11_dbs	

jmp     z_ret









link_free:
compd	"255",s12,0           
jz	link_to_empty
movs	s12,10,s15,100,9
acall	preco_dbs
movs	s12,20,s14,0,9
acall	write_dbs
movs	s12,20,s12,10,9
jmp	link_pcount
link_to_empty:
movs	s12,20,s12,0,9
movs	s12,20,s12,10,9
link_pcount:
movs	s12,30,s15,230,8
acall	inc_erg
movs	s15,230,s12,30,8

call	update_bled
jmp	z_ret












unlink_free:
call	update_bled
comps	s12,0,s12,10,8	
jz	unlink_f_last
movs	s12,0,s15,100,9
acall	preco_dbs
acall	read_dbs
movs	s12,0,s12,20,9
movs	s14,0,s12,0,9
movs	s12,30,s15,230,8
acall	dec_erg
movs	s15,230,s12,30,8

jmp	z_ret

unlink_f_last:
compd	"255",s12,0
jz	nz_ret

movs	s12,0,s12,20,8
movd	"255 ",s12,0
movd	"255 ",s12,10
movs	s12,30,s15,230,8
acall	dec_erg
movs	s15,230,s12,30,8
jmp	z_ret



z_ret:
setc	4,1
decc	4
ret


nz_ret:
setc	4,0
decc	4
ret


dbs_pool_init:
setc	1,62	








setc    0,128          
movd	"00000000 ",s15,230
movd	"128 0000 ",s12,0
movd	"128 0000 ",s12,10
movd	"128 0000 ",s12,20
movd	"00000000 ",s12,30     




init_loop:
movd	" INIT DBS          /n",s3,0
movc	0,s3,10
out	s3,0,c4

movd	"    0 360 2 9 81 ",s15,100		
movc	0,s15,100		
acall	open_dbs

movd	"                                                                                         /n",s14,0
acall	pfirst_dbs
movc	0,s14,0		

set_dbs_loop:
acall	inc_erg
movs	s15,234,s14,4,4	
acall	write_dbs
acall	pnext_dbs
jz	set_dbs_loop

set_to_next:
movs	s12,30,s15,210,8	
movs	s15,230,s15,220,8		
acall	add
movs	s15,230,s12,30,8
incc	0			
decc	1			
jnz	set_next_point



movd	"255",s14,0
acall	write_dbs
movd	"        ",s15,104
acall	getr_dbs
movs	s15,100,s12,10,9      
movd	"          Free Cells in SMDR DBS!/n",s6,100
movs	s12,30,s6,100,8
out	s6,100,c4
ret


set_next_point:
movd	"00000000 ",s15,230
movc	0,s14,0		
movs	s15,234,s14,4,4	
acall	write_dbs
jmp	init_loop





init_b0:
setp	0XD300,0x10	
setp	0XD301,0x00		

setp	0Xd302,0x10	
setp	0XD303,0x00		

setp	0Xd304,0x10	
setp	0XD305,0x00		

setp	0Xd306,0x10	
setp	0XD307,0x00		

setp	0Xd308,0x10	
setp	0XD309,0x00		

setp	0Xd30A,0x10	
setp	0XD30B,0x00		

setp	0Xd30C,0x10	
setp	0XD30D,0x00		

setp	0XD30E,0x00 	

ret






init_b1:
setp	0Xd310,0x20	
setp	0Xd311,0x00		

setp	0Xd312,0x50	
setp	0Xd313,0x00		

setp	0Xd314,0x50	
setp	0Xd315,0x00		

setp	0Xd316,0x20	
setp	0Xd317,0x00		

setp	0Xd318,0x50	
setp	0Xd319,0x00		

setp	0Xd31A,0x20	
setp	0Xd31B,0x00		

setp	0Xd31C,0x50	
setp	0Xd31D,0x00		

setp	0Xd31E,0x00 	

ret






init_b2:
setp	0Xd320,0x10	
setp	0Xd321,0x00		

setp	0Xd322,0x50	
setp	0Xd323,0x00		

setp	0Xd324,0x50	
setp	0Xd325,0x00		

setp	0Xd326,0x10	
setp	0Xd327,0x00		

setp	0Xd328,0x50	
setp	0Xd329,0x00		

setp	0Xd32A,0x10	
setp	0Xd32B,0x00		

setp	0Xd32C,0x50	
setp	0Xd32D,0x00		

setp	0Xd32E,0x01 	

ret






init_b3:
setp	0Xd330,0x20	
setp	0Xd331,0x00		

setp	0Xd332,0x50	
setp	0Xd333,0x00		

setp	0Xd334,0x50	
setp	0Xd335,0x00		

setp	0Xd336,0x20	
setp	0Xd337,0x00		

setp	0Xd338,0x50	
setp	0Xd339,0x00		

setp	0Xd33A,0x20	
setp	0Xd33B,0x00		

setp	0Xd33C,0x50	
setp	0Xd33D,0x00		

setp	0Xd33E,0x04 	

ret






init_b4:
setp	0Xd340,0x00	
setp	0Xd341,0x00		

setp	0Xd342,0x70	
setp	0Xd343,0x00		

setp	0Xd344,0x70	
setp	0Xd345,0x00		

setp	0Xd346,0x00	
setp	0Xd347,0x00		

setp	0Xd348,0x70	
setp	0Xd349,0x00		

setp	0Xd34A,0x00	
setp	0Xd34B,0x00		

setp	0Xd34C,0x70	
setp	0Xd34D,0x00		

setp	0Xd34E,0xbe 	

ret






init_b5:
setp	0Xd350,0x00	
setp	0Xd351,0x00		

setp	0Xd352,0x70	
setp	0Xd353,0x00		

setp	0Xd354,0x70	
setp	0Xd355,0x00		

setp	0Xd356,0x00	
setp	0Xd357,0x00		

setp	0Xd358,0x70	
setp	0Xd359,0x00		

setp	0Xd35A,0x00	
setp	0Xd35B,0x00		

setp	0Xd35C,0x70	
setp	0Xd35D,0x00		

setp	0Xd35E,0xbf 	

ret






init_b6:
setp	0Xd360,0x60	
setp	0Xd361,0x00		

setp	0Xd362,0x10	
setp	0Xd363,0x00		

setp	0Xd364,0x10	
setp	0Xd365,0x00		

setp	0Xd366,0x60	
setp	0Xd367,0x00		

setp	0Xd368,0x10	
setp	0Xd369,0x00		

setp	0Xd36A,0x60	
setp	0Xd36B,0x00		

setp	0Xd36C,0x10	
setp	0Xd36D,0x00		

setp	0Xd36E,0x01 	

ret




cfg_display:
movd	"          ... free_pool_first/n",s6,0
movs	s12,0,s6,0,8
out	s6,0,c4

movd	"          ... free_pool_last/n",s6,0
movs	s12,10,s6,0,8
out	s6,0,c4

movd	"          ... reco_count_free/n",s6,0
movs	s12,30,s6,0,8
out	s6,0,c4

movd	"          ... aktu_reco/n",s6,0
movs	s12,20,s6,0,8
out	s6,0,c4

movd	"          ... date_last/n",s6,0
movs	s12,40,s6,0,8
out	s6,0,c4

movd	"                 ... printers/n",s6,0
movs	s10,15,s6,0,15
out	s6,0,c4

movd    "          ... EURO_Parameter/n",s6,0
movs    s10,39,s6,0,1
out	s6,0,c4

movd	"          ... geb_aktu/n",s6,0
movs	s12,50,s6,0,8
out	s6,0,c4

movd	"          ... tln_pointer/n",s6,0
movs	s12,60,s6,0,9
out	s6,0,c4

movd	"          ... extension_num/n",s6,0
movs	s12,70,s6,0,4
out	s6,0,c4

movd	"          ... input_state/n",s6,0
movs	s12,75,s6,0,4
out	s6,0,c4

movd	"          ... old_state/n",s6,0
movs	s12,80,s6,0,4
out	s6,0,c4

movd	"          ... old_date/n",s6,0
movs	s12,90,s6,0,8
out	s6,0,c4

movd	"          ... tln_point_sub/n",s6,0
movs	s12,100,s6,0,9
out	s6,0,c4

movd	"          ... ext_point_top/n",s6,0
movs	s12,110,s6,0,9
out	s6,0,c4

movd	"          ... ext_point_bott/n",s6,0
movs	s12,120,s6,0,9
out	s6,0,c4

movd	"          ... ext_pree_point/n",s6,0
movs	s12,130,s6,0,9
out	s6,0,c4

movd	"          ... geb_total/n",s6,0
movs	s12,140,s6,0,8
out	s6,0,c4

movd	"          ... status_pointer/n",s6,0
movs	s12,150,s6,0,9
out	s6,0,c4

movd	"                ... last_date_time/n",s6,0
movs	s12,160,s6,0,15
out	s6,0,c4

movd	"                ... last_date_telef/n",s6,0
movs	s12,175,s6,0,15
out	s6,0,c4

movd	"                ... last_date_bar/n",s6,0
movs	s12,190,s6,0,15
out	s6,0,c4

movd	"           ... page_calc1/n",s6,0
movs	s12,205,s6,0,3
out	s6,0,c4

movd	"           ... page_calc2/n",s6,0
movs	s12,210,s6,0,3
out	s6,0,c4

movd	"           ... page_calc_sub/n",s6,0
movs	s12,215,s6,0,3
out	s6,0,c4

movd	"           ... page_lf_number/n",s6,0
movs	s12,220,s6,0,3
out	s6,0,c4

movd	"                    ... hotel_name/n",s6,0
movs	s12,230,s6,0,20
replace "/n ",s6,0,20
out	s6,0,c4

movd	"           ... page1_state/n",s6,0
movc	3,s6,0
out	s6,0,c4

movd	"           ... page1_line/n",s6,0
movc	2,s6,0
out	s6,0,c4

movd	"           ... page2_state/n",s6,0
movc	9,s6,0
out	s6,0,c4

movd	"           ... page2_line/n",s6,0
movc	8,s6,0
out	s6,0,c4

movd	"           ... language/n",s6,0
movs	s10,30,s6,0,3
out	s6,0,c4

ret



tln_display:
movd	"2 ",s15,100
acall	pfirst_dbs
movd	" EXTENSION TABLE /n",s6,0
out	s6,0,c4

tln_ldisplay:
acall	read_dbs
compd   "    ",s14,0
jz	tln_edisplay
movd	"/n",s14,88
out	s14,0,c4
acall	pnext_dbs
jz	tln_ldisplay

tln_edisplay:
movd	" END OF TABLE/n",s6,0
out	s6,0,c4

ret



test_tln_free:
movd	"002 119 ",s15,100
acall	preco_dbs
acall	read_dbs
compd	"    ",s14,0
ret





ins_tln_room:
call	find_ins_point
jnz	err_tln_room

movs	s15,0,s14,0,4
movd    "RSXxxxxxx ",s14,4
call	dbs_write		
call	ins_write		

err_tln_room:
ret





ins_tln_admin:
call	find_ins_point
jnz	err_tln_admin

movs	s15,0,s14,0,4



movd    "ASMxxxxxx ",s14,4

call    dbs_write               
call	ins_write		

err_tln_admin:
ret










find_ins_point:
movd	"      ",s15,220
movd	"      ",s15,210
movs	s15,0,s15,220,4
movd	"002  ",s15,100
acall	pfirst_dbs
ins_find:
acall	read11_dbs
movs	s11,0,s15,210,4
acall	comp
compd	"LT",s15,204
jnz	insert_point
compd   "999",s11,0
jz      insert_point
acall   pnext_dbs
jnz	ins_error
jmp	ins_find

insert_point:
jmp	z_ret

ins_error:
ret










ins_write:
movs	s11,0,s14,0,100	
acall	read11_dbs		
acall	write_dbs		
acall	pnext_dbs		
jnz	err_ins_write
compd	"    ",s11,0
jnz	ins_write
err_ins_write:
ret












del_write:
acall	pnext_dbs
jnz	err_del_write
acall	read_dbs		
acall	pprev_dbs
acall	write_dbs		
acall	pnext_dbs		
jnz	err_del_write
compd	"999",s14,0
jnz	del_write
movd	"                                          ",s14,0
acall	write_dbs
err_del_write:
ret





update_bled:
incc	6
jnz	e_update
movs	s12,30,s15,210,8



movd    "19585 ",s15,220

acall   comp
compd	"LT",s15,204
jz	t_16788
setl	1,0
setl	2,0
setl	3,0
setl	4,0
e_update:
ret

t_16788:



movd    "16788 ",s15,220

acall	comp
compd	"LT",s15,204
jz	t_13991
setl	1,2
setl	2,0
setl	3,0
setl	4,0
ret

t_13991:



movd	"13991 ",s15,220

acall	comp
compd	"LT",s15,204
jz	t_11194
setl	1,1
setl	2,0
setl	3,0
setl	4,0
ret

t_11194:



movd    "11194 ",s15,220

acall	comp
compd	"LT",s15,204
jz	t_8397
setl	1,1
setl	2,2
setl	3,0
setl	4,0
ret

t_8397:



movd    "8397 ",s15,220

acall	comp
compd	"LT",s15,204
jz	t_5600
setl	1,1
setl	2,1
setl	3,0
setl	4,0
ret

t_5600:



movd    "5600 ",s15,220

acall	comp
compd	"LT",s15,204
jz	t_2803
setl	1,1
setl	2,1
setl	3,2
setl	4,0
ret

t_2803:



movd    "2803 ",s15,220

acall	comp
compd	"LT",s15,204
jz	t_1500
setl	1,1
setl	2,1
setl	3,1
setl	4,0
ret

t_1500:



movd    "1500 ",s15,220

acall	comp
compd	"LT",s15,204
jz	t_100
setl	1,1
setl	2,1
setl	3,1
setl	4,2
ret

t_100:
setl	1,1
setl	2,1
setl	3,1
setl	4,1
ret






























dbs_tln_init:
movd	"2 16384 120 21 4 1 1 1 1 1 1 1 1 1 10 10 5 4 1 1 36 1 1 1 4  ",s15,100
acall	open_dbs
movd	"                                                                                                                     ",s14,0
acall	init_dbs
acall	pfirst_dbs
;
; Tabelle fuer TLN
;      TLN Rufnummer (3 digit + 1 Space fix)
;      |   FLAG 1 TYPE A...administration
;      |   |	       R...Room
;      |   |	       P...Phone booth
;      |   |	       B...Bar phone
;      |   |Flag 2 PRINT_FLAG S...Standard, I...Immediate
;      |   ||Flag 3 Printing periode
;      |   |||Flag 4 Logische Extension number (0-9) For print ticket
;      |   ||||Flag 5 - 9
;      |   |||||    cost_open ( offene Kosten 10 digigt (auto init))
;      |   |||||    |	      cost_closed (bereits verrechnete Kosten 10 digit (auto init))
;      |   |||||    |	      |









movd  "999 SSxxxxxxx ",s14,0    
call  dbs_write
ret

dbs_write:
movd	"00000000  00000000     1 000 NN255 0000 255 0000 255 0000 255 0000 xxx0000  /n",s14,13
acall	write_dbs
acall	pnext_dbs
jz	dbs_wr_ok
movd	"Runtime-error DBS3 too small!!/n",s14,150
out	s14,150,c4
dbs_wr_ok:
ret



t_zusatzkosten:
compd   "1",s10,28
jnz     rt_zusatzkosten
compd   "Zusatzkosten",s3,43
rt_zusatzkosten:
ret



t_ti_name:

compd	"| Name :",s3,0
jz	t_ti_exit



compd	"| Nom :",s3,0
jz	t_ti_exit








compd	"| Nome :",s3,0
jz	t_ti_exit



compd	"| Namn :",s3,0
jz	t_ti_exit













compd	"| Navn :",s3,0
jz	t_ti_exit



compd	"| Nombre :",s3,0
jz	t_ti_exit



compd	"| Nimi :",s3,0
jz	t_ti_exit



compd	"! Name :",s3,0
jz	t_ti_exit












t_ti_exit:
ret



t_ti_cabin_set:

compd	"| Cabin set no. :",s3,0
jz	t_ti_exit



compd	"| Num?ro de Cabine",s3,0
jz	t_ti_exit



compd	"| Telefonzellennummer",s3,0
jz	t_ti_exit



compd	"| Numero apparecchio",s3,0
jz	t_ti_exit



compd	"| Lobby-",s3,0
jz	t_ti_exit



compd	"! Cabin set no. :",s3,0
jz	t_ti_exit








compd	"| Telefonboks nr.",s3,0
jz	t_ti_exit



compd	"! Cabina no :",s3,0
jz	t_ti_exit



compd	"| Yleis?puhel",s3,0
jz	t_ti_exit













compd	"! Cabine n? :",s3,0
jz	t_ti_exit


ret



t_ti_room:

compd	"| Room number :",s3,0
jz	lang_gb_set


compd	"| Num?ro de chambre :",s3,0
jz	lang_fr_set


compd	"| Rumsnummer :",s3,0
jz	lang_se_set


compd	"! Room number :",s3,0
jz	lang_be_set






compd	"| Zimmernummer :",s3,0
jz	lang_de_set


compd	"| V?relses",s3,0
jz	lang_dk_set


compd	"! Habitacion",s3,0
jz	lang_es_set


compd	"| Huone numero",s3,0
jz	lang_fi_set


compd   "| Camera numero",s3,0
jz	lang_it_set






compd	"| Rom nummer :",s3,0
jz	lang_no_set


compd   "! Qarto n? :",s3,0
jz	lang_pt_set

ret



t_ti_language:

compd	"| Language :",s3,0
jz	t_ti_exit



compd	"| Langue :",s3,0
jz	t_ti_exit



compd	"| Sprache :",s3,0
jz	t_ti_exit



compd	"| Lingua :",s3,0
jz	t_ti_exit



compd	"| Spr?k :",s3,0
jz	t_ti_exit



compd	"! Language :",s3,0
jz	t_ti_exit








compd	"| Sprog :",s3,0
jz	t_ti_exit



compd	"! Idioma :",s3,0
jz	t_ti_exit



compd	"| Kieli :",s3,0
jz	t_ti_exit

















ret



t_ti_deposit:

compd	"| Deposit",s3,0
jz	t_ti_exit



compd	"| Cr?dit :",s3,0
jz	t_ti_exit



compd	"| Vorkasse :",s3,0
jz	t_ti_exit








compd	"| Deposition :",s3,0
jz	t_ti_exit



compd	"! Deposit",s3,0
jz	t_ti_exit








compd	"| Forskud :",s3,0
jz	t_ti_exit








compd	"| Ennakko :",s3,0
jz	t_ti_exit


















ret



t_ti_number:

compd	"| Number",s3,0
jz	t_ti_exit



compd	"| Nombre",s3,0
jz	t_ti_exit



compd	"| Anzahl",s3,0
jz	t_ti_exit



compd	"| Numero",s3,0
jz	t_ti_exit



compd	"| Antal ",s3,0
jz	t_ti_exit



compd	"! Number",s3,0
jz	t_ti_exit













compd	"! Numero",s3,0
jz	t_ti_exit



compd	"| Puhelu",s3,0
jz	t_ti_exit



compd	"! Number",s3,0
jz	t_ti_exit



compd	"| Antall",s3,0
jz	t_ti_exit








ret


lang_fr_set:
movd	"2  ",s10,30

ret
lang_de_set:
movd	"1  ",s10,30

ret
lang_gb_set:
movd	"0  ",s10,30

ret
lang_se_set:
movd	"3  ",s10,30

ret
lang_be_set:
movd	"4  ",s10,30

ret
lang_ct_set:
movd	"5  ",s10,30

ret
lang_dk_set:
movd	"6  ",s10,30

ret
lang_es_set:
movd	"7  ",s10,30

ret
lang_fi_set:
movd	"8  ",s10,30

ret
lang_it_set:
movd	"9  ",s10,30

ret
lang_nl_set:
movd	"10 ",s10,30

ret
lang_no_set:
movd	"11 ",s10,30

ret
lang_pt_set:
movd	"12 ",s10,30

ret


form_r311:
movs    s3,7,s3,0,5     
movs    s3,13,s3,5,3   
movs    s3,17,s3,8,28   
movs    s3,50,s3,36,7       
movs    s3,60,s3,43,27      
movs    s3,95,s3,70,10          
jmp     form_cost

form_r312:
movs    s3,1,s3,0,5     
movs    s3,7,s3,5,3   
movs    s3,11,s3,8,28   
movs    s3,44,s3,36,7       
movs    s3,54,s3,43,27      
movs    s3,89,s3,70,10          
jmp     form_cost

form_r26_3dg:
movs    s3,2,s3,0,36         
movs	s3,43,s3,36,34	
movs    s3,85,s3,70,10

form_cost:
compd   ".",s3,71
jz	format_1
compd   ".",s3,72
jz	format_2
compd   ".",s3,73
jz	format_3
compd   ".",s3,74
jz	format_4
compd   ".",s3,75
jz	format_5
compd   ".",s3,76
jz	format_6
format_6:
movd	"00000000",s15,210
movd	"00  ",s15,220


jmp	format_end
format_5:
compd   " ",s3,78
jnz	format_5_1
movd    "0",s3,78
format_5_1:
movd	"00000000 ",s15,210
movd	"000  ",s15,220
movs    s3,70,s15,210,5
movs    s3,76,s15,220,3
jmp	format_end
format_4:
compd   " ",s3,77
jnz	format_4_1
movd    "0",s3,77
format_4_1:
movd	"0000000 ",s15,210
movd	"000  ",s15,220
movs    s3,70,s15,210,4
movs    s3,75,s15,220,3
jmp	format_end
format_3:
compd   " ",s3,76
jnz	format_3_1
movd    "0",s3,76
format_3_1:
movd	"000000 ",s15,210
movd	"000  ",s15,220
movs    s3,70,s15,210,3
movs    s3,74,s15,220,3
jmp	format_end
format_2:
compd   " ",s3,75
jnz	format_2_1
movd    "0",s3,75
format_2_1:
movd	"00000 ",s15,210
movd	"000  ",s15,220
movs    s3,70,s15,210,2
movs    s3,73,s15,220,3
jmp	format_end
format_1:
compd   " ",s3,74
jnz	format_1_1
movd    "0",s3,74
format_1_1:
movd	"0000 ",s15,210
movd	"000  ",s15,220
movs    s3,70,s15,210,1
movs    s3,72,s15,220,3
format_end:
acall	add
movs	s15,230,s12,50,8
movd    "        ",s3,70
ret








to_right:

movd    "                    >/n",s9,220




setc    12,0    
setc    11,20   
setc    10,200  

spl_to_right:
compd   " ",S9,c10
jnz     f_to_right
incc    10
decc    11
jnz     spl_to_right
ret



f_to_right:
compd   " ",S9,c10
jz      f1_to_right
incc    10
incc    12              
decc    11
jnz     f_to_right

f1_to_right:
setc	11,239	
decc    10
lto_right:
compd   " ",S9,c10
jnz	mto_right
decc	10
decc	12
jnz	lto_right

movd    "                    ",s9,200

ret

mto_right:
movs    S9,c10,S9,c11,1
decc	10
decc	11
decc	12
jnz     mto_right

movd    "                    ",s9,200

ret







to_left:

movd    "                    >/n",s9,220
setc	12,20	
setc	10,200	
setc	11,220	
lto_left:
compd   " ",S9,c10
jnz	mto_left
incc	10
decc	12
jnz     lto_left
eto_left:

movd    "                    ",s9,200
ret

mto_left:
movs    S9,c10,S9,c11,1

incc    10
incc	11
decc	12
jz      eto_left
compd   " ",S9,c10
jz      eto_left
compd   "/n",S9,c10
jz      eto_left
jmp     mto_left









euro_to_ats:
movd    "                    ",s9,160
call    to_right        
replace ".,",s9,220,20 
compd   ",",s9,237
jz      to_ats2comma

compd   ",",s9,236
jnz     error_comma



movd    "00000   ",s15,210
movd    "000 ",s15,220
movs    s9,231,s15,210,5
movs    s9,237,s15,220,3
jmp     to_ats_common

to_ats2comma:
movd    "00000   ",s15,210
movd    "000 ",s15,220
movs    s9,232,s15,210,5
movs    s9,238,s15,220,2
jmp     to_ats_common

to_ats_common:

movd    "       ,  ",s9,190

movs    s15,220,s9,200,8
movd    "13 ",s15,220
acall   mul
movd    "00000000",s9,220
movs    s15,232,s9,220,6

movd    "76 ",s15,220
acall   mul
movs    s15,230,s9,180,8

movd    "03 ",s15,220
acall   mul
movd    "        ",s15,220
movs    s15,230,s15,220,6
movs    s9,180,s15,210,8
movd    "       ",s9,180
movs    s15,236,s9,180,2
acall   add
movs    s15,230,s15,210,8
movs    s9,220,s15,220,8
acall   add
movs    s15,230,s9,220,8

movs    s9,200,s15,210,8
movd    "1376 ",s15,220
acall   mul
movd    "        ",s9,200
movs    s15,230,s9,200,5
movd    "        ",s15,210
movd    "000 ",s15,220
movs    s15,235,s15,210,3
movs    s9,180,s15,220,2
acall   add
movd    "        ",s15,210
movd    "        ",s15,220
movs    s15,230,s15,210,5
movs    s9,200,s15,220,5

movs    s15,235,s9,200,3

acall   add
movs    s15,230,s15,210,8
movs    s9,220,s15,220,8
acall   add
acall   cut_lz
movs    s15,230,s9,220,8
movd    "        ",s15,210
movs    s9,200,s15,210,3
movd    "500 ",s15,220
acall   comp
compd   "GT",s15,204
jnz     to_atsend

movs    s9,220,s15,230,8
acall   inc_erg
acall   cut_lz
jmp     to_1_atsend

to_atsend:
movs    s9,220,s15,230,8
to_1_atsend:
replace " 0",s15,235,3
movs    s15,230,s9,191,6
movs    s15,236,s9,198,2

ret









ats_to_euro:
call    to_right        
replace ".,",s9,220,20 
compd   ",",s9,237
jz      to_eur2comma

compd   ",",s9,236
jnz     error_comma



movd    "00000000",s15,210
movd    "000 ",s15,220
movs    s9,231,s15,210,5
movs    s9,237,s15,220,3
jmp     to_euro_common

to_eur2comma:
movd    "00000000",s15,210
movd    "000 ",s15,220
movs    s9,232,s15,210,5
movs    s9,238,s15,220,2
jmp     to_euro_common

to_euro_common:

movd    "       ,  ",s9,190
acall   add
movs    s15,230,s15,210,8

movd    "13760 ",s15,220
acall   div
acall   cut_lz
movs    s15,231,s9,190,7

movs    s15,240,s15,210,8
movd    "100 ",s15,220
acall   mul

movs    s15,230,s15,210,8
movd    "13760 ",s15,220
acall   div
movs    s15,236,s9,198,2

movs    s15,240,s15,210,8
movd    "6880 ",s15,220
acall   comp
compd   "GT",s15,204
jnz     to_eurend

movd    "        ",s15,230
movs    s9,198,s15,236,2
acall   inc_erg
movs    s15,236,s9,198,2
compd   "000000",s15,230
jz      to_eurend

movs    s9,190,s15,231,7
acall   inc_erg
acall   cut_lz
movs    s15,231,s9,190,7
error_comma:
to_eurend:
ret




single_ticket:
movs	s10,24,s12,49,1	   

movs    s3,0,s14,9,100          



call	test_form_ff
call	load_h60
call	print_load
movs	s12,230,s3,2,20
call	print_load
movs	s14,21,s3,2,14
call	print_load
call	print_load
movs    0x9000,0,s3,2,32  
call	print_load
movs	0x9000,32,s3,2,32	
movs    s14,10,s3,34,3
call	print_load
call	print_load
movs	0x9000,64,s3,2,32	
movs	s14,52,s3,34,20
replace ". ",s3,34,20
call	print_load
movs	0x9000,96,s3,2,32	
movs	s14,36,s3,34,8
call	print_load
call	print_load
movs	0x9000,128,s3,2,32	
movs	s14,79,s3,34,9
movs	0x9300,240,s3,44,3	
compd   "0",s10,39
jz      skip_single_t
compd   "1",s10,39
jz      skip_single_t
movs    0x9300,243,s3,44,3  
skip_single_t:
call    ticket_euro
call    print_load
movs    0x9000,192,s3,2,32  


































call	print_load
call	print_load
movs	0x9000,224,s3,2,32	
call	pr_ticket
call	load_h60



call	pr_ticket
call	pr_formfeed
ret



ticket_euro:



replace ".,",s3,34,15

compd   "0",s10,39
jz      skip_ticket_euro
compd   "3",s10,39
jz      skip_ticket_euro
compd   "1",s10,39
jz      calc_ticket_euro

movd    "                    ",s9,200
movs    s3,34,s9,200,9    
call    euro_to_ats
movs    s9,192,s3,48,8
movs    0x9300,240,s3,57,3  
jmp     skip_ticket_euro
calc_ticket_euro:
movs    s3,34,s9,200,9    
call    ats_to_euro
movs    s9,192,s3,48,8
movs    0x9300,243,s3,57,3  
skip_ticket_euro:

ret



zzz:
end

