I'm not sure I understand what you're trying to do. This is pretty screwed up, but may serve to clarify the question, "do you mean something like this?":
;
; Compiling this code for 32-bit use:
; nasm -f elf file.asm
;
;
;~.~. Definitions for readability: ~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.
%define SYS_EXIT 1
%define SYS_READ 3
%define SYS_WRITE 4
%define STDIN 0
%define STDOUT 1
%define STDERR 2
;~.~. Initialized data: .~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.
SECTION .data
Title: db 'title.txt', 0 ; Everything from title.txt
Board: db 'cBoard.txt', 0 ; Everything from cBoard.txt
OpenFile1: db 'r', 0 ; Opens an existing text file for reading
OpenFile2: db 'rb', 0
fmt_cx db `%c 0x%2X\n`, 0
;~. Uninitialized data: .~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.
SECTION .bss
TLENGTH EQU 72
tLENGTH resb TLENGTH
;~.~. Program code: .~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.
SECTION .text
; Place all your extern declarations in this area.
extern fopen
extern fclose
extern fgets
extern printf
global main ; specify starting with main
main:
nop
xor ebx, ebx
mov ebx, Title
call DisplayTitle
xor ebx, ebx
mov ebx, Board
call DisplayBoard
jmp home
;~.~. Subroutines: ~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.
; Place all your subroutine code in this area.
DisplayTitle:
push OpenFile1
push ebx
call fopen
add esp, 8
cmp eax, 0
jne continue1
ret
DisplayBoard:
push OpenFile2
push ebx
call fopen
add esp, 8
cmp eax, 0
jne continue2
ret
continue1:
mov ebx, eax
jmp readln1
continue2:
mov ebx, eax
jmp readln2
readln1:
push ebx
push DWORD TLENGTH
push tLENGTH
call fgets
add esp, 12
cmp eax, 0
jle done
push tLENGTH
call printf
add esp, 4
jmp readln1
readln2:
push ebx
push DWORD TLENGTH
push tLENGTH
call fgets
add esp, 12
cmp eax, 0
jle done
mov esi, tLENGTH
.top:
movzx eax, byte [esi]
inc esi
test eax, eax
jz done
push eax
push eax
push fmt_cx
call printf
add esp, 4 * 3
jmp .top
; push tLENGTH
; call printf
; add esp, 4
; jmp readln2
done:
push ebx
call fclose
add esp, 4
ret
;~.~. Procedures: .~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.
; Place all your non-main procedure code in this area.
;~.~. The starting function: ~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.
; this satisfies some compilers
; Place all your code for the main function in this area.
home:
ret ; for main instead of exit
;~_~_~ (end of file) ~_~_~_~_~_~_~_~_~_~_~_~_~_~_~_
Best,
Frank