From 7a7f69e1524d7e1ee3c6a9e9d56428edaf785e3d Mon Sep 17 00:00:00 2001 From: Liu Aleaxander Date: Sat, 6 Jun 2009 06:04:16 +0800 Subject: [PATCH] Core: move close_file function in getc.inc because (I think) all the close_file are the same. --- core/extlinux.asm | 12 ------------ core/getc.inc | 13 +++++++++++++ 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/core/extlinux.asm b/core/extlinux.asm index 4a4d8ac..55ae363 100644 --- a/core/extlinux.asm +++ b/core/extlinux.asm @@ -173,18 +173,6 @@ Files resb MAX_OPEN*open_file_t_size global ThisInode ThisInode resb EXT2_GOOD_OLD_INODE_SIZE ; The most recently opened inode - section .text16 -; -; close_file: -; Deallocates a file structure (pointer in SI) -; Assumes CS == DS. -; -close_file: - and si,si - jz .closed - mov dword [si],0 ; First dword == file_bytesleft - xor si,si -.closed: ret section .bss16 alignb 4 diff --git a/core/getc.inc b/core/getc.inc index a8b4954..0aa140b 100644 --- a/core/getc.inc +++ b/core/getc.inc @@ -87,6 +87,19 @@ openfd: xor ax,ax ; ZF <- 1 pop bx ret + +; +; close_file: +; Deallocates a file structure (pointer in SI) +; Assumes CS == DS. +; +close_file: + and si,si + jz .closed + mov dword [si],0 ; First dword == file_bytesleft + xor si,si +.closed: ret + getc: push bx -- 2.7.4