TIP: Click on subject to list as thread! ANSI
echo: power_bas
to: SID LEE
from: SAM PAULSON
date: 1995-11-13 00:49:00
subject: TSR`s

SL>SP> Is it normal for a PowerBASIC TSR to take up 94k of RAM?
SL>SP> All my program does is display the time and date.
SL> Do you mean when it is waiting to be invoked or when it is
SL> actually running?
While it is waiting to be invoked.  My offline mail reader (SLMR)
displays the amount of memory available, so I checked to see what
it said with both the TSR loaded and unloaded, and there was a 94k
difference.
SL> I'm using PB 3.1 here and the several "test" TSR's I've written
SL> seem to be about 5K in size when they are waiting to be triggered.
SL> I've never checked how large they are when actually running but I'd
SL> expect them to be a lot bigger since the mechanism swaps whatever
SL> is running out while it loads the running code for the TSR.
I use PB 3.00a, and my program was just a first attempt at writing
a TSR with PB.  Using the example from one of the online help topics,
I figured out how to leave the disk swapping out of the program (takes
forever to load on a floppy-only system like mine), so maybe that's
the reason.
I guess my program isn't any big secret , so here it is for all to
examine (and poke fun at):
'-------------------------------------
'Time & Date TSR
$compile exe
$lib iprint off
$option cntlbreak off
x& = setmem(-700000)
popup key chr$(8,30,247)
popup multiplex &HC000,254
reg 1,&HC000 : reg 4,254
call interrupt &H2F
if reg(1)  &HC000 and reg(4)  254 then end
print "Time & Date Installed. Press Alt-A to activate."
reg 1,&HC001 : reg 4,252
popup sleep
while 1=1
  x% = pos         : y% = csrlin
  def seg = &hB800 : savedSreen$ = peek$(0,4000)
  color 9,1 : Center 11, ""
      Center 12, "                   "
      Center 13, "                   "
  if reg(1) = &HC000 and reg(4) = 254 then
     Center 14, ""
     color 15,1 : Center 12, "Time & Date"
  Center 13, "Already Installed"
     i$ = input$(1)
  else
     Center 14, "ninstall"
     color 15,1 : while a$ = ""
                     a$ = inkey$
     TimeConvert tim$ : Center 12, tim$
     DateConvert dat$ : Center 13, dat$
                  wend
  end if
  poke$ 0, savedSreen$
  locate y%, x%
  if lcase$(a$) = "u" then if popup(1) then end
  reg 1, &HC001 : reg 4,252
  a$ = ""
  popup sleep
wend
sub DateConvert (dat$) static
   'date format = 05-23-1995
   restore
   d = val(left$(date$, 2))
   for i = 1 to 12
   read month$
   if i = d then
      dat$ = month$ + " " + mid$(date$,4,2) + ", " + mid$(date$,7,4)
      if val(mid$(date$,4,1)) = 0 then
         dat$ = month$ + " " + mid$(date$,5,1) + ", " + mid$(date$,7,4)
      end if
   end if
   next i
   data January,February,March,April,May,June,July,August,September,Octc
end sub
sub TimeConvert (tim$) static
   'time format = 05:35:20.43
   if val(left$(time$,2)) > 12 then
      tim$ = str$(val(left$(time$,2)) - 12) + mid$(time$,3,3) + "pm"
   else
      tim$ = left$(time$, 5) + "am"
      if val(left$(time$,1)) < 1 then tim$ = mid$(time$,2,4) + "am"
      if val(left$(time$,2)) < 1 then tim$ = "  12" + mid$(time$,3,3) +
   end if
end sub
sub Center (lineNumber%, text$)
   row% = (80 - len(text$)) \ 2
   locate lineNumber%, row%
   print text$;
end sub
--- WILDMAIL!/WC v4.12 
---------------
* Origin: City Lights (1:282/108.0)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.