; TPA -- Display/Change TPA size ; ; This program returns the amount of free space in the TPA. This ; can be useful when running under FAST, DESPOOL, DDT, SID, etc. It ; will also lower the amount of TPA space available by specifying the ; new size (a two digit number in kilobytes) you want as the first ; parameter. This is useful for testing new programs to see if they ; function correctly at a lower TPA size. A warm boot resets the ; size to the maximum available for your system. ; ; ver equ 32 ; Current version number mo equ 03 ; Month last modified dy equ 09 ; Day yr equ 88 ; Year ; Version of 8/30/80 ; ; by Ron Fowler ; Westland, Mich. ; 8/24/80 ; ; Fixes and code optimization by ; Keith Petersen ; ; 03/09/88 Modified to allow changing the size of the TPA. ; Ver 3.2 Bill Duerr ; ; 11/20/87 Modified to display message if a resident system extension ; Ver 3.1 has been added to the system. ; Bill Duerr ; fcb equ 05ch org 100h ; base: lxi h,0 dad sp ; Get old stack in HL lxi sp,stack ; Get local stack push h ; Save old stack lxi d,msg0 ; Print signon message mvi c,9 ; Print message function call 5 ; Print it start: lhld 6 ; Get the top of memory push h ; Save it xchg ; Put it in DE lxi h,-100h ; Get the start of memory dad d ; Subtract it, answer left in HL call decout ; Print it lxi d,msg1 ; Print the rest of line mvi c,9 ; Print message function call 5 ; Print it ; mvi l,0 ; Round to next lowest page boundary lda 2 ; Get MSB of Cold boot routine sui 0eh ; Subtract the size of BDOS (3.5k) mov h,a ; Save it in lda 7 ; Get the MSB of the BDOS cmp h ; Has an RSX been put in the system lxi d,msg3 ; Get message to tell of RSX jnz cont ; Yes, tell operator pop h ; Get the top of memory again xchg ; Put it in DE lxi h,-(800h+100h) ; CCP size plus TPA dad d ; Subtract it, answer left in HL push h ; Save it call decout ; Print it lxi d,msg2 ; Print rest of line cont: mvi c,9 ; Print message function call 5 ; Print it pop d ; Get top of memory in DE ; ; Edit input for valid one or two digit number ; lxi h,fcb+1 ; Get address of any input parameters mov c,m ; Get a character from memory mvi b,'0' ; Make tens position a zero inx h ; Point to next character mov a,m ; Get it in A cmp b ; Check if number jc edit2 ; Not a number, must be units position mov b,c ; Move to tens position mov c,a ; Move to units position inx h ; Point to next character in input buffer edit2: mov a,b sui '0' ; Is it a valid number jc exit ; No, forget it cpi 9+1 jnc exit mov b,a ; Save the character add a ; Multiply by 10 add a add b add a mov b,a ; Save the value mov a,c sui '0' ; Is it a valid number jc exit ; No, forget it cpi 9+1 jnc exit add b ; Add in tens position cpi 64 ; Has too high value be specified jnc exit ; Yes, forget it add a ; Multiply input number by 1024 add a cmp d ; Compare to current top of memory jnc exit ; If greater, exit lhld 6 ; Get location of BDOS xchg ; Get in DE mov h,a mvi l,0 dcx h ; First available byte not protected mov m,d ; Move in BDOS address dcx h mov m,e dcx h mvi m,0c3h ; Move in jump instruction shld 6 ; Save new jump address in low memory lxi d,msg4 ; Print modified message mvi c,9 ; Print message function call 5 ; Print it mvi a,' ' ; Blank parameters sta fcb+1 jmp start ; And display modified TPA size exit: pop h ; Restore CCP stack sphl ret ; Back to the CCP ; ; Subroutines ; ; Console output routine ; Prints character in "A" register ; co: push h push d push b mov e,a ; Character to E for CP/M mvi c,2 ; Print console function call 5 ; Print character pop b pop d pop h ret ; ; Decimal output routine ; this routine has following entry and external parameters: ; ; Entry: HL=binary number to print in decimal ; External calls: CO routine ; ; ** Note... This routine is recursive, and uses 6 bytes of stack for ; each recursive call, in addition to any stack space used by the CO ; routine. ; decout: push b push d push h lxi b,-10 lxi d,-1 ; decou2: dad b inx d jc decou2 lxi b,10 dad b xchg mov a,h ora l cnz decout mov a,e adi '0' call co pop h pop d pop b ret newtpa: db 0 ; ; Messages ; msg0: db 'TPA Version ',ver / 10 + '0','.',ver mod 10 + '0',' -- ' db mo/10+'0',mo mod 10+'0','/' db dy/10+'0',dy mod 10+'0','/' db yr/10+'0',yr mod 10+'0',13,10,13,10,'$' msg1: db ' bytes total TPA space.',13,10,'$' msg2: db ' bytes before overlaying the CCP.',13,10,'$' msg3: db 'CCP protected by an RSX.',13,10,'$' msg4: db 13,10,'TPA size modified.',13,10,'$' ; stack equ $+80 ; 40 level stack ; end