@section text //////////////////////// i_sread .i_tokenise ::i_sread_mode rh :i_sread_mode rl 2 rh,rl //get actual number of chars //get text buf addr ::opc_operands0 rh :opc_operands0 rl rh,rl(i) a rh,rl b ::__subvar rh 0 rl a rh,rl(i) b rh,rl //get max len call :get_byte ::__subvar rh rh,1 a 2 b 0 flags ::i_sread_max_chars rh add rh,:i_sread_max_chars //+ 1 ::__subvar rh 0 rl rh,rl a 1 b 0 flags add rh,rl rh,rl(i) a 0 b add rh,rl(i) //get current char count call :get_byte ::__subvar rh rh,1 a 2 b 0 flags ::i_sread_i_max rh add rh,:i_sread_i_max branch :i_tokenise_entry 1 .i_sread ::i_sread_mode rh :i_sread_mode rl 1 rh,rl ::header_version rh rh,:header_version a 4 b branch :i_sread_input_v5 a>b 3 b branch :i_sread_input_v4 a>b .i_sread_input_v3 call :update_status_line .i_sread_input_v4 //get text buf addr ::opc_operands0 rh :opc_operands0 rl rh,rl(i) a rh,rl b ::__subvar rh 0 rl a rh,rl(i) b rh,rl //get max len call :get_byte ::__subvar rh rh,1 a ::i_sread_max_chars rh a rh,:i_sread_max_chars //- 1 255 b 0 flags add a //store ::__subvar rh a rh,3 //255,0 + 1 -> 255,2 ::__subvar rh rh,0 a 1 b 0 flags add rh,2 0 rl rh,rl(i) a 0 b 2 rl add rh,rl(i) //yes, do null-terminate ::__subvar rh 5 rl 1 rh,rl //just start at the beginning ::__subvar rh 6 rl 0 rh,rl call :tty_get_line ::__subvar rh rh,4 a 1 b 0 flags ::i_sread_i_max rh add rh,:i_sread_i_max ::i_sread_i_initial rh :i_sread_i_initial rl 1 rh,rl branch :i_sread_input_done 1 .i_sread_input_v5 //get text buf addr ::opc_operands0 rh :opc_operands0 rl rh,rl(i) a rh,rl b ::__subvar rh 0 rl a rh,rl(i) b rh,rl //get max len -> 255,3 call :get_byte ::__subvar rh rh,1 a ::__subvar rh a rh,3 2 b 0 flags ::i_sread_max_chars rh add rh,:i_sread_max_chars //+ 1 ::__subvar rh 0 rl rh,rl a 1 b 0 flags add rh,rl rh,rl(i) a 0 b add rh,rl(i) //get current char count -> b call :get_byte ::__subvar rh rh,1 b //feed the current char count to tty_getline via 255,6 ::__subvar rh 6 rl b rh,rl //255,0 + 1 -> 255,2 ::__subvar rh rh,0 a 1 b 0 flags add rh,2 0 rl rh,rl(i) a 0 b 2 rl add rh,rl(i) //no, don't null-terminate ::__subvar rh 5 rl 0 rh,rl call :tty_get_line //store actual number of chars //get text buf addr ::opc_operands0 rh :opc_operands0 rl rh,rl(i) a rh,rl b ::__subvar rh 0 rl a rh,rl(i) b rh,rl //+ 1 rh,rl a 1 b 0 flags add rh,rl rh,rl(i) a 0 b add rh,rl(i) //get char count reported by tty_get_line ::__subvar rh rh,4 a a rh,1 //set_byte call :set_byte ::__subvar rh rh,4 a 2 b 0 flags ::i_sread_i_max rh add rh,:i_sread_i_max ::i_sread_i_initial rh :i_sread_i_initial rl 2 rh,rl branch :i_sread_input_done 1 .i_tokenise_entry .i_sread_input_done //exit if parse-buffer is zero ::opc_operands1 rh :opc_operands1 rl rh,rl(i) a 0 b branch :i_sread_do_parse_not_zero a>b rh,rl a branch :i_sread_do_parse_not_zero a>b branch :i_sread_do_parse_zero 1 .i_sread_do_parse_not_zero //get some values ::opc_operands1 rh :opc_operands1 rl rh,rl(i) a rh,rl b ::__subvar rh 0 rl a rh,rl(i) b rh,rl call :get_byte ::__subvar rh rh,1 a ::i_sread_max_words rh a rh,:i_sread_max_words ::header_dict_loc rh :header_dict_loc rl rh,rl(i) a rh,rl b ::__subvar rh 0 rl a rh,rl(i) b rh,rl ::i_sread_ignore_unrecognized_flag rh :i_sread_ignore_unrecognized_flag rl 0 rh,rl //handle optional operands for i_tokenise //i_sread_mode will be 1 for sread and 2 for tokenise ::i_sread_mode rh rh,:i_sread_mode a 1 b branch :i_sread_dict_addr_normal a=b ::opc_operand_qty rh rh,:opc_operand_qty a 3 b branch :i_sread_dict_addr_normal a= b //--- call :get_byte ::__subvar rh rh,1 a ::i_temp rh rh,:i_temp rl ::i_sread_sep_chars rh a rh,rl //+ 1 ::__subvar rh 0 rl rh,rl a 1 b 0 flags add rh,rl rh,rl(i) a 0 b add rh,rl(i) //--- ::i_temp rh rh,:i_temp a 1 b 0 flags add rh,:i_temp branch :i_sread_sep_char_loop 1 .i_sread_sep_char_loop_end //null-terminate list of sep chars ::i_sread_sep_char_count rh rh,:i_sread_sep_char_count b ::i_sread_sep_chars rh b rl 0 rh,rl call :get_byte ::__subvar rh rh,1 a ::i_sread_dict_entry_len rh a rh,:i_sread_dict_entry_len //+ 1 ::__subvar rh 0 rl rh,rl a 1 b 0 flags add rh,rl rh,rl(i) a 0 b add rh,rl(i) call :get_byte ::__subvar rh rh,1 a ::i_sread_dict_entry_count rh :i_sread_dict_entry_count rl a rh,rl(i) //+ 1 ::__subvar rh 0 rl rh,rl a 1 b 0 flags add rh,rl rh,rl(i) a 0 b add rh,rl(i) call :get_byte ::__subvar rh rh,1 a ::i_sread_dict_entry_count rh a rh,:i_sread_dict_entry_count //check if i_sread_dict_entry_count is positive (sorted) or negative (unsorted, may be used by i_tokenise) ::i_sread_sort_flag rh :i_sread_sort_flag rl 1 rh,rl ::i_sread_dict_entry_count rh :i_sread_dict_entry_count rl rh,rl(i) a 0b10000000 b and a branch :i_sread_dict_sorted a= b ::i_sread_max_chars rh rh,:i_sread_max_chars b branch :i_sread_parse_loop_end a=b //really a >= b //--- //get mem addr ::i_sread_i rh rh,:i_sread_i a ::opc_operands0 rh rh,:opc_operands0 b 0 flags ::__subvar rh add rh,0 ::opc_operands0 rh :opc_operands0 rl rh,rl(i) a 0 b ::__subvar rh 0 rl add rh,rl(i) //get data call :get_byte //zero? ::__subvar rh rh,1 a 0 b branch :i_sread_parse_not_zero a>b ::i_sread_word_len rh rh,:i_sread_word_len a 0 b branch :i_sread_parse_zero_skipnewword a=b //handle word call :sread_word_lookup //i_sread_word_count++ ::i_sread_word_count rh rh,:i_sread_word_count a 1 b 0 flags add rh,:i_sread_word_count .i_sread_parse_zero_skipnewword //i_sread_word_len = 0 ::i_sread_word_len rh :i_sread_word_len rl 0 rh,rl branch :i_sread_parse_loop_end 1 .i_sread_parse_not_zero //space? ::__subvar rh rh,1 a 32 b a=b a 255 b branch :i_sread_parse_not_space xor ::i_sread_word_len rh rh,:i_sread_word_len a 0 b branch :i_sread_parse_space_skipnewword a=b //handle word call :sread_word_lookup //i_sread_word_count++ ::i_sread_word_count rh rh,:i_sread_word_count a 1 b 0 flags add rh,:i_sread_word_count .i_sread_parse_space_skipnewword //i_sread_word_len = 0 ::i_sread_word_len rh :i_sread_word_len rl 0 rh,rl branch :i_sread_parse_loop_inc 1 .i_sread_parse_not_space //FIXME verify that separators work correctly //separator? ::i_temp rh :i_temp rl 0 rh,rl .i_sread_parse_check_sep_loop ::i_temp rh rh,:i_temp rl ::i_sread_sep_chars rh rh,rl a 0 b branch :i_sread_parse_not_sep a=b ::__subvar rh rh,1 b branch :i_sread_parse_is_sep a=b ::i_temp rh rh,:i_temp a 0 flags 1 b add rh,:i_temp branch :i_sread_parse_check_sep_loop 1 .i_sread_parse_is_sep ::i_sread_word_len rh rh,:i_sread_word_len a 0 b branch :i_sread_parse_is_sep_skipnewword a=b //handle word call :sread_word_lookup //i_sread_word_count++ ::i_sread_word_count rh rh,:i_sread_word_count a 1 b 0 flags add rh,:i_sread_word_count //i_sread_word_len = 0 .i_sread_parse_is_sep_skipnewword ::i_sread_word_len rh :i_sread_word_len rl 0 rh,rl //do another word for the separator ::i_sread_i rh rh,:i_sread_i a ::i_sread_word_start rh a rh,:i_sread_word_start ::i_sread_word_len rh :i_sread_word_len rl 1 rh,rl //handle word call :sread_word_lookup //i_sread_word_count++ ::i_sread_word_count rh rh,:i_sread_word_count a 1 b 0 flags add rh,:i_sread_word_count //i_sread_word_len = 0 ::i_sread_word_len rh :i_sread_word_len rl 0 rh,rl branch :i_sread_parse_loop_inc 1 .i_sread_parse_not_sep ::i_sread_word_len rh rh,:i_sread_word_len a 0 b branch :i_sread_parse_len_not_zero a>b ::i_sread_i rh rh,:i_sread_i a ::i_sread_word_start rh a rh,:i_sread_word_start .i_sread_parse_len_not_zero ::i_sread_word_len rh rh,:i_sread_word_len a 1 b 0 flags add rh,:i_sread_word_len //--- .i_sread_parse_loop_inc ::i_sread_i rh rh,:i_sread_i a 1 b 0 flags add rh,:i_sread_i branch :i_sread_parse_loop 1 .i_sread_parse_loop_end //make sure we got the last word, if any ::i_sread_word_len rh rh,:i_sread_word_len a 0 b branch :i_sread_parse_loop_end_skipnewword a=b //handle word call :sread_word_lookup //i_sread_word_count++ ::i_sread_word_count rh rh,:i_sread_word_count a 1 b 0 flags add rh,:i_sread_word_count //i_sread_word_len = 0 ::i_sread_word_len rh :i_sread_word_len rl 0 rh,rl .i_sread_parse_loop_end_skipnewword //save word count ::i_sread_word_count rh rh,:i_sread_word_count a ::__subvar rh a rh,1 ::opc_operands1 rh :opc_operands1 rl rh,rl(i) a rh,rl b ::__subvar rh 0 rl a rh,rl(i) b rh,rl //+ 1 rh,rl a 1 b 0 flags add rh,rl rh,rl(i) a 0 b add rh,rl(i) call :set_byte .i_sread_do_parse_zero //no store for i_tokenise ::i_sread_mode rh rh,:i_sread_mode a 2 b branch :opcode_done a=b //store a 13 for v5+ //FIXME store a 0 if input times out ::header_version rh rh,:header_version a 5 b branch :opcode_done a= b ::i_temp2 rh rh,:i_temp2 a 9 b branch :i_sread_enc_loop_end a=b //really a >= b call :get_byte //--- //lookup the char ::__subvar rh rh,1 rl ::zalpha_rev_lookup rh rh,rl b 0b11100000 a and b 0 a branch :i_sread_enc_t_invalid a=b 0b00100000 a branch :i_sread_enc_t_0 a=b 0b01000000 a branch :i_sread_enc_t_1 a=b 0b01100000 a branch :i_sread_enc_t_2 a=b branch :i_sread_enc_t_invalid 1 .i_sread_enc_t_1 //encode a z-character 4 and then the looked-up character //NOTE: relies on input to already be all-lowercase ::__subvar rh rh,1 a ::i_sread_enc_second rh a rh,:i_sread_enc_second ::i_sread_enc_has_second rh :i_sread_enc_has_second rl 1 rh,rl ::__subvar rh 1 rl 4 rh,rl branch :i_sread_enc_t_generic 1 .i_sread_enc_t_2 //encode a z-character 5 and then the looked-up character ::__subvar rh rh,1 a ::i_sread_enc_second rh a rh,:i_sread_enc_second ::i_sread_enc_has_second rh :i_sread_enc_has_second rl 1 rh,rl ::__subvar rh 1 rl 5 rh,rl branch :i_sread_enc_t_generic 1 .i_sread_enc_t_0 ::i_sread_enc_has_second rh :i_sread_enc_has_second rl 0 rh,rl .i_sread_enc_t_generic ::i_temp2 rh rh,:i_temp2 a 0 b branch :i_sread_enc_t0_n0 a=b 1 b branch :i_sread_enc_t0_n1 a=b 2 b branch :i_sread_enc_t0_n2 a=b 3 b branch :i_sread_enc_t0_n3 a=b 4 b branch :i_sread_enc_t0_n4 a=b 5 b branch :i_sread_enc_t0_n5 a=b 6 b branch :i_sread_enc_t0_n6 a=b 7 b branch :i_sread_enc_t0_n7 a=b 8 b branch :i_sread_enc_t0_n8 a=b branch :i_sread_enc_t0_inc 1 //zword0 .i_sread_enc_t0_n0 ::i_sread_zword0 rh :i_sread_zword0 rl rh,rl(i) a 0b10000011 b and rh,rl(i) ::__subvar rh rh,1 rl ::zalpha_rev_lookup rh rh,rl b 0b00011111 a and b bsr b bsr b bsr b bsr b bsr b bsr b ::i_sread_zword0 rh :i_sread_zword0 rl rh,rl(i) a or rh,rl(i) branch :i_sread_enc_t0_inc 1 .i_sread_enc_t0_n1 ::i_sread_zword0 rh :i_sread_zword0 rl rh,rl(i) a 0b11111100 b and rh,rl(i) rh,rl a 0b00011111 b and rh,rl ::__subvar rh rh,1 rl ::zalpha_rev_lookup rh rh,rl b bsr b bsr b bsr b 0b00000011 a and b ::i_sread_zword0 rh :i_sread_zword0 rl rh,rl(i) a or rh,rl(i) ::__subvar rh rh,1 rl ::zalpha_rev_lookup rh rh,rl b bsr b bsr b bsr b 0b11100000 a and b ::i_sread_zword0 rh :i_sread_zword0 rl rh,rl a or rh,rl branch :i_sread_enc_t0_inc 1 .i_sread_enc_t0_n2 ::i_sread_zword0 rh :i_sread_zword0 rl rh,rl a 0b11100000 b and rh,rl ::__subvar rh rh,1 rl ::zalpha_rev_lookup rh rh,rl b 0b00011111 a and b ::i_sread_zword0 rh :i_sread_zword0 rl rh,rl a or rh,rl branch :i_sread_enc_t0_inc 1 //zword1 .i_sread_enc_t0_n3 ::i_sread_zword1 rh :i_sread_zword1 rl rh,rl(i) a 0b10000011 b and rh,rl(i) ::__subvar rh rh,1 rl ::zalpha_rev_lookup rh rh,rl b 0b00011111 a and b bsr b bsr b bsr b bsr b bsr b bsr b ::i_sread_zword1 rh :i_sread_zword1 rl rh,rl(i) a or rh,rl(i) branch :i_sread_enc_t0_inc 1 .i_sread_enc_t0_n4 ::i_sread_zword1 rh :i_sread_zword1 rl rh,rl(i) a 0b11111100 b and rh,rl(i) rh,rl a 0b00011111 b and rh,rl ::__subvar rh rh,1 rl ::zalpha_rev_lookup rh rh,rl b bsr b bsr b bsr b 0b00000011 a and b ::i_sread_zword1 rh :i_sread_zword1 rl rh,rl(i) a or rh,rl(i) ::__subvar rh rh,1 rl ::zalpha_rev_lookup rh rh,rl b bsr b bsr b bsr b 0b11100000 a and b ::i_sread_zword1 rh :i_sread_zword1 rl rh,rl a or rh,rl branch :i_sread_enc_t0_inc 1 .i_sread_enc_t0_n5 ::i_sread_zword1 rh :i_sread_zword1 rl rh,rl a 0b11100000 b and rh,rl ::__subvar rh rh,1 rl ::zalpha_rev_lookup rh rh,rl b 0b00011111 a and b ::i_sread_zword1 rh :i_sread_zword1 rl rh,rl a or rh,rl branch :i_sread_enc_t0_inc 1 //zword2 .i_sread_enc_t0_n6 ::i_sread_zword2 rh :i_sread_zword2 rl rh,rl(i) a 0b10000011 b and rh,rl(i) ::__subvar rh rh,1 rl ::zalpha_rev_lookup rh rh,rl b 0b00011111 a and b bsr b bsr b bsr b bsr b bsr b bsr b ::i_sread_zword2 rh :i_sread_zword2 rl rh,rl(i) a or rh,rl(i) branch :i_sread_enc_t0_inc 1 .i_sread_enc_t0_n7 ::i_sread_zword2 rh :i_sread_zword2 rl rh,rl(i) a 0b11111100 b and rh,rl(i) rh,rl a 0b00011111 b and rh,rl ::__subvar rh rh,1 rl ::zalpha_rev_lookup rh rh,rl b bsr b bsr b bsr b 0b00000011 a and b ::i_sread_zword2 rh :i_sread_zword2 rl rh,rl(i) a or rh,rl(i) ::__subvar rh rh,1 rl ::zalpha_rev_lookup rh rh,rl b bsr b bsr b bsr b 0b11100000 a and b ::i_sread_zword2 rh :i_sread_zword2 rl rh,rl a or rh,rl branch :i_sread_enc_t0_inc 1 .i_sread_enc_t0_n8 ::i_sread_zword2 rh :i_sread_zword2 rl rh,rl a 0b11100000 b and rh,rl ::__subvar rh rh,1 rl ::zalpha_rev_lookup rh rh,rl b 0b00011111 a and b ::i_sread_zword2 rh :i_sread_zword2 rl rh,rl a or rh,rl branch :i_sread_enc_t0_inc 1 .i_sread_enc_t0_inc ::i_temp2 rh rh,:i_temp2 a 1 b 0 flags add rh,:i_temp2 ::i_sread_enc_has_second rh rh,:i_sread_enc_has_second a 0 b branch :i_sread_enc_no_second a=b ::i_sread_enc_second rh rh,:i_sread_enc_second a ::__subvar rh a rh,1 //::i_sread_enc_has_second rh //:i_sread_enc_has_second rl //0 rh,rl branch :i_sread_enc_t_0 1 .i_sread_enc_no_second .i_sread_enc_t_invalid //--- //+ 1 ::__subvar rh 0 rl rh,rl a 1 b 0 flags add rh,rl rh,rl(i) a 0 b add rh,rl(i) ::i_temp rh rh,:i_temp a 1 b 0 flags add rh,:i_temp branch :i_sread_enc_loop 1 .i_sread_enc_loop_end //--- //find word in dictionary //init upper and lower bounds ::i_sread_chop_lower rh :i_sread_chop_lower rl 0 rh,rl(i) 0 rh,rl ::i_sread_dict_entry_count rh rh,:i_sread_dict_entry_count a 255 b 0 flags ::i_sread_chop_upper rh add rh,:i_sread_chop_upper ::i_sread_dict_entry_count rh :i_sread_dict_entry_count rl rh,rl(i) a ::i_sread_chop_upper rh :i_sread_chop_upper rl add rh,rl(i) .i_sread_chop_loop ::i_sread_chop_lower rh :i_sread_chop_lower rl rh,rl(i) a ::i_sread_chop_upper rh :i_sread_chop_upper rl rh,rl(i) b branch :i_sread_chop_loop_end a>b branch :i_sread_chop_loop_lt ab .i_sread_chop_loop_lt //--- ::i_sread_sort_flag rh rh,:i_sread_sort_flag a 0 b branch :i_sread_chop_loop_lt_unsorted a=b .i_sread_chop_loop_lt_sorted //(i_sread_chop_lower + i_sread_chop_upper) -> i_temp ::i_sread_chop_lower rh rh,:i_sread_chop_lower a ::i_sread_chop_upper rh rh,:i_sread_chop_upper b 0 flags ::i_temp rh add rh,:i_temp ::i_sread_chop_lower rh :i_sread_chop_lower rl rh,rl(i) a ::i_sread_chop_upper rh :i_sread_chop_upper rl rh,rl(i) b ::i_temp rh :i_temp rl add rh,rl(i) //i_temp / 2 -> i_temp ::i_temp rh :i_temp rl rh,rl b bsr b 0b01111111 a and rh,rl rh,rl(i) b bsr b 0b10000000 a and a rh,rl b or rh,rl rh,rl(i) b bsr b 0b01111111 a and rh,rl(i) branch :i_sread_chop_loop_lt_sort_unsort_end 1 .i_sread_chop_loop_lt_unsorted //i_sread_chop_lower -> i_temp ::i_sread_chop_lower rh :i_sread_chop_lower rl rh,rl(i) a rh,rl b ::i_temp rh :i_temp rl a rh,rl(i) b rh,rl .i_sread_chop_loop_lt_sort_unsort_end //i_temp -> i_temp2 ::i_temp rh :i_temp rl rh,rl(i) a rh,rl b ::i_temp2 rh :i_temp2 rl a rh,rl(i) b rh,rl //i_temp * i_sread_dict_entry_len -> i_mul_interim ::i_mul_interim rh :i_mul_interim rl 0 rh,rl(i) 0 rh,rl ::temp rh :temp rl 0b00000001 rh,rl .i_sread_mul_loop1 //test if addition is needed ::temp rh rh,:temp b ::i_sread_dict_entry_len rh rh,:i_sread_dict_entry_len a and a branch :i_sread_mul_skip1 ab //i_mul_interim + i_sread_dict_addr -> i_temp ::i_mul_interim rh rh,:i_mul_interim a ::i_sread_dict_addr rh rh,:i_sread_dict_addr b 0 flags ::i_temp rh add rh,:i_temp ::i_mul_interim rh :i_mul_interim rl rh,rl(i) a ::i_sread_dict_addr rh :i_sread_dict_addr rl rh,rl(i) b ::i_temp rh :i_temp rl add rh,rl(i) //i_temp -> 255,0 ::i_temp rh :i_temp rl rh,rl(i) a rh,rl b ::__subvar rh 0 rl a rh,rl(i) b rh,rl //FIXME optimize //first byte call :get_byte ::i_sread_zword0 rh :i_sread_zword0 rl rh,rl(i) a ::__subvar rh a rh,2 ::__subvar rh rh,1 b a=b a 255 b branch :i_sread_lookup_no xor //+ 1 ::__subvar rh 0 rl rh,rl a 1 b 0 flags add rh,rl rh,rl(i) a 0 b add rh,rl(i) //second byte call :get_byte ::i_sread_zword0 rh rh,:i_sread_zword0 a ::__subvar rh a rh,2 ::__subvar rh rh,1 b a=b a 255 b branch :i_sread_lookup_no xor //+ 1 ::__subvar rh 0 rl rh,rl a 1 b 0 flags add rh,rl rh,rl(i) a 0 b add rh,rl(i) //third byte call :get_byte ::i_sread_zword1 rh :i_sread_zword1 rl rh,rl(i) a ::__subvar rh a rh,2 ::__subvar rh rh,1 b a=b a 255 b branch :i_sread_lookup_no xor //+ 1 ::__subvar rh 0 rl rh,rl a 1 b 0 flags add rh,rl rh,rl(i) a 0 b add rh,rl(i) //fourth byte call :get_byte ::i_sread_zword1 rh rh,:i_sread_zword1 a ::__subvar rh a rh,2 ::__subvar rh rh,1 b a=b a 255 b branch :i_sread_lookup_no xor //behavior diverges for v3 (4 bytes and 6 z-chars) and v4+ (6 bytes and 9 z-chars) ::header_version rh rh,:header_version a 4 b branch :i_sread_lookup_found ab //i_sread_chop_lower = i_temp2 + 1 .i_sread_lookup_nl ::i_temp2 rh rh,:i_temp2 a 1 b 0 flags ::i_sread_chop_lower rh add rh,:i_sread_chop_lower ::i_temp2 rh :i_temp2 rl rh,rl(i) a 0 b ::i_sread_chop_lower rh :i_sread_chop_lower rl add rh,rl(i) branch :i_sread_chop_loop 1 //i_sread_chop_upper = i_temp2 - 1 .i_sread_lookup_nu ::i_temp2 rh rh,:i_temp2 a 255 b 0 flags ::i_sread_chop_upper rh add rh,:i_sread_chop_upper ::i_temp2 rh :i_temp2 rl rh,rl(i) a ::i_sread_chop_upper rh :i_sread_chop_upper rl add rh,rl(i) branch :i_sread_chop_loop 1 .i_sread_chop_loop_end //no match ::i_temp rh :i_temp rl 0 rh,rl(i) 0 rh,rl ::i_sread_ignore_unrecognized_flag rh rh,:i_sread_ignore_unrecognized_flag a 1 b branch :i_sread_lookup_found_skip_write a=b .i_sread_lookup_found //save ::i_sread_parse_buf_addr rh :i_sread_parse_buf_addr rl rh,rl(i) a rh,rl b ::__subvar rh 0 rl a rh,rl(i) b rh,rl //i_temp high ::i_temp rh :i_temp rl rh,rl(i) a ::__subvar rh a rh,1 call :set_byte //+ 1 ::__subvar rh 0 rl rh,rl a 1 b 0 flags add rh,rl rh,rl(i) a 0 b add rh,rl(i) //i_temp low ::i_temp rh rh,:i_temp a ::__subvar rh a rh,1 call :set_byte //+ 1 ::__subvar rh 0 rl rh,rl a 1 b 0 flags add rh,rl rh,rl(i) a 0 b add rh,rl(i) //word len ::i_sread_word_len rh rh,:i_sread_word_len a ::__subvar rh a rh,1 call :set_byte //+ 1 ::__subvar rh 0 rl rh,rl a 1 b 0 flags add rh,rl rh,rl(i) a 0 b add rh,rl(i) //word pos ::i_sread_word_start rh rh,:i_sread_word_start a ::__subvar rh a rh,1 call :set_byte .i_sread_lookup_found_skip_write //parse addr += 4 ::i_sread_parse_buf_addr rh :i_sread_parse_buf_addr rl rh,rl a 4 b 0 flags add rh,rl rh,rl(i) a 0 b add rh,rl(i) ret @section bss //i_sread .i_sread_mode dw 0 .i_sread_ignore_unrecognized_flag dw 0 .i_sread_sort_flag dw 0 .i_sread_max_chars dw 0 .i_sread_max_words dw 0 .i_sread_dict_addr dl 0 .i_sread_sep_char_count dw 0 .i_sread_dict_entry_len dw 0 .i_sread_dict_entry_count dl 0 .i_sread_parse_buf_addr dl 0 .i_sread_word_count dw 0 .i_sread_i_initial dw 0 .i_sread_i_max dw 0 .i_sread_i dw 0 .i_sread_word_start dw 0 .i_sread_word_len dw 0 .i_sread_zword0 dl 0 .i_sread_zword1 dl 0 .i_sread_zword2 dl 0 .i_sread_chop_lower dl 0 .i_sread_chop_upper dl 0 .i_sread_enc_has_second dw 0 .i_sread_enc_second dw 0 //---i_sread--- ..i_sread_sep_chars dw 0 256 @section rodata ..zalpha_rev_lookup dw 0 dw 0 dw 0 dw 0 dw 4 dw 5 dw 0 dw 0 dw 0 dw 0 dw 0b01100111 //'\n' dw 0 dw 0 dw 0 dw 0 dw 0 dw 0 dw 0 dw 0 dw 0 dw 0 dw 0 dw 0 dw 0 dw 0 dw 0 dw 0 dw 0 dw 0 dw 0 dw 0 dw 0 dw 0b00100000 //' ' dw 0b01110100 //'!' dw 0b01111001 //'"' dw 0b01110111 //'#' dw 0 //'$' dw 0 //'%' dw 0 //'&' dw 0b01111000 //''' dw 0b01111110 //'(' dw 0b01111111 //')' dw 0 //'*' dw 0 //'+' dw 0b01110011 //',' dw 0b01111100 //'-' dw 0b01110010 //'.' dw 0b01111010 //'/' dw 0b01101000 //'0' dw 0b01101001 //'1' dw 0b01101010 //'2' dw 0b01101011 //'3' dw 0b01101100 //'4' dw 0b01101101 //'5' dw 0b01101110 //'6' dw 0b01101111 //'7' dw 0b01110000 //'8' dw 0b01110001 //'9' dw 0b01111101 //':' dw 0 //';' dw 0 //'<' dw 0 //'=' dw 0 //'>' dw 0b01110101 //'?' dw 0 //'@' dw 0b01000110 //'A' dw 0b01000111 //'B' dw 0b01001000 //'C' dw 0b01001001 //'D' dw 0b01001010 //'E' dw 0b01001011 //'F' dw 0b01001100 //'G' dw 0b01001101 //'H' dw 0b01001110 //'I' dw 0b01001111 //'J' dw 0b01010000 //'K' dw 0b01010001 //'L' dw 0b01010010 //'M' dw 0b01010011 //'N' dw 0b01010100 //'O' dw 0b01010101 //'P' dw 0b01010110 //'Q' dw 0b01010111 //'R' dw 0b01011000 //'S' dw 0b01011001 //'T' dw 0b01011010 //'U' dw 0b01011011 //'V' dw 0b01011100 //'W' dw 0b01011101 //'X' dw 0b01011110 //'Y' dw 0b01011111 //'Z' dw 0 //'[' dw 0b01111011 //'\' dw 0 //']' dw 0 //'^' dw 0b01110110 //'_' dw 0 //'`' dw 0b00100110 //'a' dw 0b00100111 //'b' dw 0b00101000 //'c' dw 0b00101001 //'d' dw 0b00101010 //'e' dw 0b00101011 //'f' dw 0b00101100 //'g' dw 0b00101101 //'h' dw 0b00101110 //'i' dw 0b00101111 //'j' dw 0b00110000 //'k' dw 0b00110001 //'l' dw 0b00110010 //'m' dw 0b00110011 //'n' dw 0b00110100 //'o' dw 0b00110101 //'p' dw 0b00110110 //'q' dw 0b00110111 //'r' dw 0b00111000 //'s' dw 0b00111001 //'t' dw 0b00111010 //'u' dw 0b00111011 //'v' dw 0b00111100 //'w' dw 0b00111101 //'x' dw 0b00111110 //'y' dw 0b00111111 //'z' dw 0 //'{' dw 0 //'|' dw 0 //'}' dw 0 //'~' dw 0 //DEL