Store the length of the first string as 0 Read and store the first line - Read a char from stdin - Did we read 0 chars? If so, we got EOF (exit) - Update the length - DEBUG: print number chars read in first line - DEBUG: print chars read in first line - Is it a LF? Yes - move on to next part No - Is the buffer full? Yes - print an error and exit. No - goto read a char from stdin read_rest_of_file - Put a 0 in the place of the LF - Adjust str2find_len - Fill the buffer with the same number of chars as the search string. - DEBUG: print number chars in buffer - DEBUG: print chars read into buffer - Did we read 0 chars? Yes - goto eof_reached - Did we read fewer chars than what is in search string? Yes - goto eof_reached Check each char, and see if they match. match: print message (no_match: keep going) re-fill buffer, check again - move_everything_over by 1 char - Increment shift_count, which is the start position of the buffer. - Read another character Recommend a DEBUG and DEBUG2 (and maybe DEBUG3) ;DEBUG equ 0 ; Flag for printing DEBUG information. (off) DEBUG equ 1 ; Flag for printing DEBUG information. (on) ; ... checkpt: db "Check point", 0 ; ... mov al, 01 test al, DEBUG jz no_message1 mov rdi, checkpt ; string to print call puts ; puts automatically adds a newline no_message1: [mweeks@gsuad.gsu.edu@snowball ~]$ cat partial_h3.asm | wc -l 89 [mweeks@gsuad.gsu.edu@snowball ~]$ cat partial_h4.asm | wc -l 467