A 16-bit Turbo assembly program that reads a character and prints all its positions in a text file. You can provide the character as a command-line argument or input it interactively.
- Find all positions of a specific character in a file.
- Optional
-p
flag for paged output (shows 23 lines at a time). - Interactive character input if not provided via CLI.
- Counts how many times the character appears.
- Uses
MOVS
for efficient argument copying. - External procedure for printing decimal numbers.
- Clean output with optional filename printing during paging.
- MS-DOS or compatible emulator (e.g., DOSBox, js-dos)
TASM
andTLINK
to assemble and link
tasm main
tasm printnum
tlink main printnum
main -h # Show help message
main <filename> <symbol> # Run with character as argument
main <filename> # Run and enter character from keyboard
main -p <filename> <symbol> # Enable paging
main input.txt a
- Designed for files up to 64KB (positions wrap after 65535).
- Input buffer is 128 bytes; long command-line strings are truncated.
- On paging mode, press Enter to go to the next screen of results.
Made with DOS-era love by kuzlik340