[comp.sys.amiga] A tiny program to install CMI's "kickram"

phillip@cbmvax.cbm.UUCP (Phillip Lindsay CATS) (03/10/87)

"getkickram" is a tiny little program (156 bytes) that will check for
CMI's kickram and if present add it to the free memory pool. The
the source and binary are in the following  shar file...
-phil (Phillip Lindsay - Commodore-Amiga Technical Support)

**** use your finest blade here sire...
#! /bin/sh
# This is a shell archive, meaning:
# 1. Remove everything above the #! /bin/sh line.
# 2. Save the resulting text in a file.
# 3. Execute the file with /bin/sh (not csh) to create the files:
#	getkickram.asm
#	getkickram.uue
# This archive created: Tue Mar 10 12:19:54 1987
export PATH; PATH=/bin:$PATH
echo shar: extracting "'getkickram.asm'" '(2200 characters)'
if test -f 'getkickram.asm'
then
	echo shar: will not over-write existing file "'getkickram.asm'"
else
sed 's/^	X//' << \SHAR_EOF > 'getkickram.asm'
	X******************************************************************************
	X* getkickram.asm - install CMI's write control store memory.					
	X*
	X* manx : as -C -D getkickram.asm / ln getkickram.asm -lcl32.lib 
	X*
	X*  [ I haven't tried the following, but it should work (poof) ]  
	X* MCC assem: assem from getkickram.asm -o getkickram.o
	X*            alink from getkickram.o to getkickram lib amiga.lib  
	X*
	X* Phillip Lindsay (c) 1987 Commodore-Amiga Inc.
	X*  This code may be used freely as long as the copyright notice is
	X*  left intact.
	X*
	X******************************************************************************
	X
	X	INCLUDE "exec/types.i"
	X	INCLUDE "exec/execbase.i"
	X	INCLUDE "exec/libraries.i"
	X	INCLUDE "exec/memory.i"
	X
	X
	XVER1_2  	EQU	33			; 1.2 Version number
	XMEM_BASE	EQU	$f80000			; base address of CMI ram
	XMEM_END 	EQU	$fbffff			; end address
	XMEM_SIZE	EQU	(MEM_END-MEM_BASE)	; size in bytes
	XMEM_ATTR	EQU	(MEMF_FAST!MEMF_PUBLIC)	; memory type attributes
	XMEM_PRI 	EQU	0			; priority (normally 0)
	XMEM_NAME	EQU	0			; null name			
	XMEM_PAT 	EQU	$f5f5AfAf		; funky test pattern
	XNMEM_PAT	EQU	~MEM_PAT		; complement of pattern
	X
	X;******* external references
	X
	X		XREF	_AbsExecBase
	X		XREF	_LVOAddMemList
	X
	X;******* external definitions
	X
	X		XDEF	_main	
	X
	X;******* start  
	X
	X_main:
	X		movem.l a6/a1/a0/d1/d2,-(sp)	; parinoid
	X		move.l  _AbsExecBase,a6 	; get ExecBase pointer
	X		cmp.w	#VER1_2,LIB_VERSION(a6) ; make sure we atleast 1.2
	X		blt.s	nomemory		; no 1.2 we gone...		
	X		move.l	#MEM_BASE,a0		; get memory space base addr
	X		move.l  (a0),d0			; save previous value for test
	X		move.l 	#MEM_PAT,(a0)		; write test pattern
	X		cmp.l	#MEM_PAT,(a0)		; valid?	 
	X		bne.s	nomemory		;	 			
	X		not.l	(a0)			; complement test pattern in memory
	X		cmp.l	#NMEM_PAT,(a0)		; test with complement test pattern
	X		bne.s	nomemory		; no go?
	X		move.l 	d0,(a0)			; restore previous value
	X		move.l	#MEM_SIZE,d0		; size of memory block
	X		move.l	#MEM_ATTR,d1		; memory attributes
	X		move.l	#MEM_PRI,d2		; memory priority
	X		move.l	#MEM_NAME,a1		; get memory name (NULL)				
	X		jsr	_LVOAddMemList(a6)	; add memory to system		
	X
	Xnomemory:
	X		sub.l	d0,d0			; clear d0 and leave
	X		movem.l (sp)+,a6/a1/a0/d1/d2	; relieved
	X		rts
	X		end
	X
	X;********** EOF
SHAR_EOF
if test 2200 -ne "`wc -c < 'getkickram.asm'`"
then
	echo shar: error transmitting "'getkickram.asm'" '(should have been 2200 characters)'
fi
fi # end of overwriting check
echo shar: extracting "'getkickram.uue'" '(243 characters)'
if test -f 'getkickram.uue'
then
	echo shar: will not over-write existing file "'getkickram.uue'"
else
sed 's/^	X//' << \SHAR_EOF > 'getkickram.uue'
	Xbegin 640 getkickram
	XM   #\P         #          (    4              /I    %$CG8,(L
	XM>0    0,;@ A !1M-B!\ /@  " 0(+SU]:^O#)#U]:^O9B!&D R0"@I04&86
	XM(( @/  #__]R!70 (GP     3J[]EI" 3-]#!DYU   #[         /R   #
	X5Z@        /R   #ZP        /R
	X 
	Xend
SHAR_EOF
if test 243 -ne "`wc -c < 'getkickram.uue'`"
then
	echo shar: error transmitting "'getkickram.uue'" '(should have been 243 characters)'
fi
fi # end of overwriting check
#	End of shell archive
exit 0
-- 
==============================================================================
  Phillip Lindsay - Commodore Business Machines - Amiga Technical Support
  UUCP: {ihnp4|seismo|caip}!cbmvax!phillip      - Phone: (215) 431-9180
  No warranty is implied or otherwise given in the form of suggestion or 
  example. Any opinions found here are of my making. 	/* eof */