Category : Utilities for DOS and Windows Machines
Archive   : CX486.ZIP
Filename : SLC.ASM

 
Output of file : SLC.ASM contained in archive : CX486.ZIP
; SLC.COM enables the internal cache of the Cyrix & Texas Instruments 486SLC.
; The default state of the 486SLC after a reboot has the first Non Cacheable
; Region starting at the absolute address 0H with a block size of 4gb thus
; disabling the cache for the whole range of memory. This program enables
; the cache by setting all the Non Cacheable Region registers to 0 and
; setting their block sizes to 0. It also sets the NC0, NC1, and BARB bits
; of the Configuration Control Register 0 (CCR0).
;
; NC0: When set this disables caching of the 64kb region above each 1mb
; boundry in Protected and Virtual 86 modes.
; NC1: When set this disables cahcing of the 640kb - 1mb region.
; BARB: When set this forces the internal cache to flush when the CPU is
; held (typicaly for a DMA transfer).
;
; An important thing to note is that some systems hold the CPU during a DRAM
; refresh which causes the internal cache to flush unnecessarily, however
; this can be avoided by enabling the hidden refresh option in the CMOS.
;
; This setup should work for most systems, but you may have to modify this
; program to exclude certain address ranges depending on your hardware. Also
; you may wish to try turning off the NC0 bit to improve performance.
;
; To assemble with Turbo Assembler: TASM SLC
; TLINK SLC /t

.486P
cseg SEGMENT
ORG 100h
start:

;Turn off interrupts
CLI ;mask off external interrupts

;Disable cache fills and flush cache
MOV EAX,CR0 ;store CR0 in EAX
DB 66H ;force 32bit operand
OR EAX,40000000H ;set CD bit to "1" to disable cache fills
MOV CR0,EAX ;disable cache fills
INVD ;flush cache

;Turn on NC0, NC1, and BARB
MOV AL,0C0H ;set up index for Configuration Control Register 0
OUT 22H,AL ;write index to out port 22H
MOV AL,000100011B ;setup NC0, NC1, and BARB enable
OUT 23H,AL ;enable NC0, NC1, and BARB

;Set Start Address equal to 0H and Block Size equal to "disabled" for NCR1
MOV AL,0C5H ;set up index for NCR1, starting address A23-A16
OUT 22H,AL ;write index to out port 22H
MOV AL,0H ;set up to write "0" to starting address A23-A16 of NCR1
OUT 23H,AL ;write "0" to starting address A23-A16 of NCR1

MOV AL,0C6H ;set up index for NCR1, starting address A15-A12 and block size
OUT 22H,AL ;write index to out port 22H
MOV AL,0H ;set up write "0" to starting address A15-A12 and set block size to "disabled"
OUT 23H,AL ;NCR1 starting address now set to "0" and block size now set to "disabled"

;Set Start Address equal to 0H and Block Size equal to "disabled" for NCR2 (NCR2 reset state)
MOV AL,0C8H ;setup index for NCR2, starting address A23-A16
OUT 22H,AL ;write index to out port 22H
MOV AL,0H ;set up to write "0" to starting address A23-A16 of NCR2
OUT 23H,AL ;write "0" to starting address A23-A16 of NCR2

MOV AL,0C9H ;set up index for NCR2, starting address A15-A12 and block size
OUT 22H,AL ;write index to out port 22H
MOV AL,0H ;set up to write "0" to starting address A15-A12 and set block size to "disabled"
OUT 23H,AL ;NCR2 starting address now set to "0" and block size now set to "disabled"

;Set Start Address equal to 0H and Block Size equal to "disabled" for NCR3 (NCR3 reset state)
MOV AL,0CBH ;set up index for NCR3, starting address A23-A16
OUT 22H,AL ;write index to out port 22H
MOV AL,0H ;set up to write "0" to starting address A23-A16 of NCR3
OUT 23H,AL ;write "0" to starting address A23-A16 of NCR3

MOV AL,0CCH ;set up index for NCR3, starting address A15-A12 and block size
OUT 22H,AL ;write index to out port 22H
MOV AL,0H ;set up to write "0" to starting address A15-A12 and set block size to "disabled"
OUT 23H,AL ;NC3 starting address now set to "0" and block size now set to "disabled"

;Set Start Address equal to 0H and Block Size equal to "disabled" for NCR4 (NCR4 reset state)
MOV AL,0CEH ;set up index for NCR4, starting address A23-A16
OUT 22H,AL ;write index to out port 22H
MOV AL,0H ;set up to write "0" to starting address A23-A16 of NCR4
OUT 23H,AL ;write "0" to starting address A23-A16 of NCR4

MOV AL,0CFH ;set up index for NCR4, starting address A15-A12 and block size
OUT 22H,AL ;write index to out port 22H
MOV AL,0H ;set up to write "0" to starting address A15-A12 and set block size to "disabled"
OUT 23H,AL ;NC4 starting address now set to "0" and block size now set to "disabled"

;Enable chace fills
MOV EBX,CR0 ;store CR0 in EBX
DB 66H ;force 32bit operand
AND EBX,9FFFFFFFH ;set CD bit of CR0 to "0" to enable cache fills
MOV CR0,EBX ;enable cache fills

;Enable interrupts
STI ;enable external interrupts

;Return to DOS
INT 20H
cseg ENDS

END start


  3 Responses to “Category : Utilities for DOS and Windows Machines
Archive   : CX486.ZIP
Filename : SLC.ASM

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/