Thread View: comp.sys.ibm.pc.programmer
1 messages
1 total messages
Started by Worm
Fri, 09 Mar 1990 14:57
Help with TSR Command Line Editor
Author: Worm
Date: Fri, 09 Mar 1990 14:57
Date: Fri, 09 Mar 1990 14:57
46 lines
1714 bytes
1714 bytes
I am trying to write a Command Line Editor as a TSR using MSC and MASM
4.0. I am using the small model which means the code is in the CS segment and
everything else is put in a GROUP. This means when function 31h is executed
space is reserved to hold the code in the CS segment. This means that
anything used by a C library routine in the DS segment is likely to get
corrupted. Does this mean that I have to write my own version of malloc to use
the space specially reserved? Has anybody ever tried to do this sort of thing
before ?
The routines I use are something like this :
main ()
{
do_tsr () ;
}
In tsr.asm
_do_tsr PROC NEAR
; Change int 21h to use my routine first (new_21)
; Calc space to save
mov ax,3100h
int 21h
_do_tsr ENDP
_new_21 PROC NEAR
; Save state
; Swap to my stack
; Put args on stack where dos buffer is located ie SEG and OFF
call edit_cl
; Restore stack
; Restore state
_new_21 ENDP
In edit.c
edit_cl ()
{
/* Do the editing */
}
Many thanks for any help,
Stu
estxrah@warwick.UUCP ** estxrah@uk.ac.warwick.cs ** estxrah@cs.warwick.ac.uk
"She's not Ben Johnson, but then who is ?" - David Coleman
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads