home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.whtech.com
/
ftp.whtech.com.tar
/
ftp.whtech.com
/
Geneve
/
9640news
/
CAT23
/
GPLMEMRY.TXT
< prev
next >
Wrap
Text File
|
2006-10-19
|
2KB
|
100 lines
?
TI RoundTable
Category 1, Topic 19
Message 1 Wed Mar 16, 1994
J.WHITE28 [Jeff White] at 23:50 EST
Here is something Geneve programmers might have fun trying. The following
test routine runs from GPL mode but calls MDOS XOP routines. In particular,
the test routine finds the total number of free pages in the system, the
number of free pages that are fast memory, and the total number of system
pages by calling MDOS memory management opcode 0.
Perhaps subsequent versions of MDOS and GPL will have a GPL hook into the MDOS
XOP library. This may be easier accomplished than you might think. Making
GPL an actual MDOS task rather than another environment could facilitate much
smoother transitions between the two modes of operation.
Jeff White
DEF START
*
* Test MDOS XOP's with a GPL program!
*
* by Jeffrey H. White
*
* Copyright 1994
*
MAPPER EQU >F110 MDOS memory mapper location
GRMRA EQU >9802 GROM read
GRMWA EQU >9C02 and write addresses
GPLDOS EQU >1EF4 GPL/MDOS mode select bit
*
*
SEVEN DATA 7
ERROR BSS 2
TOTFRE BSS 2
TOTZER BSS 2
TOTINS BSS 2
WS BSS 32
GROM BSS 2
PAGE0 BSS 1
EVEN
*
START BLWP @TSTXOP
RT
*
TSTXOP DATA WS WS location is limited by XOP called
DATA STTEST
*
* First save current GROM address
*
STTEST MOVB @GRMRA,@GROM
MOVB @GRMRA,@GROM+1
DEC @GROM
*
* Swap into MDOS mode
*
LI R12,GPLDOS
SBO 0
*
* Now save mapper register 0
*
LI R0,MAPPER
MOVB *R0,@PAGE0
*
* Page in physical page 0
*
SB *R0,*R0
*
* Now the XOP is tested
*
LI R0,0 free pages, free fast pages, total pages
XOP @SEVEN,0
MOV R0,R0
JEQ ITWORK
SETO @ERROR
JMP RESTOR
ITWORK CLR @ERROR
MOV R1,@TOTFRE
MOV R2,@TOTZER
MOV R3,@TOTINS
*
* XOP tested, restore mapper register
*
RESTOR MOVB @PAGE0,@MAPPER
*
* Re-enter GPL mode and restore GROM address
*
SBZ 0
MOVB @GROM,@GRMWA
MOVB @GROM+1,@GRMWA
RTWP
END
------------
Download complete. Turn off Capture File.