title 'HOWBIG is the system (85/01/05)' ; This utility gives a quick report on CPM2.2 system size. ; Useful where RSX's, and other systems, have been installed. ; and also reports the effect of non-standard bios sizes. ; The sizes reported are those visible to an application ; program, which may not be the original configured size. ; ; by C.B. Falconer (85/Jan/05) ; bdosz equ 0e00h; CPM 2.2 allocation biosz equ 0600h; DRs standard allocation @bdos equ 5; standard DOS call link. ; cr equ 13 lf equ 10 ; ; Dos call values @CON equ 2; console output, one char. @MSG equ 9; string to console ; org 0100h; CPM standard ; ld hl,0 add hl,sp ld sp,stack push hl call howbig pop hl ld sp,hl ret ; ; Show system sizes howbig: ld de,msg1; info, TPA size=.. call tstr ld hl,(@bdos+1); Where is DOS? or a; clear any carry, cant be 64k call prtk; show TPA size in K ld de,msg2 call tstr; CPM size=.. ld de,bdosz+biosz ld hl,(@bdos+1) add hl,de; Carry if 64K or more ; " " ; Print (hl) as number of K, possible /n offset. Input carry ; is high order bit (for 64k and over). prtk: ld a,h rra and 07Eh; clear carry and low order bit rra call wrtdec ld a,h and 3; is there any excess? ret z; no ld a,'/' call couta ld a,h and 3 add '0' ; " " ; output (a) to console ; a,f couta: push de ld e,a ld a,@CON call dos pop de ret ; ; put string (de) to console, '$' terminator ; a,f tstr: ld a,@MSG ; " " ; DOS call (a), preserve registers ; a,f dos: push hl push de push bc ld c,a call @bdos pop bc pop de pop hl ret ; ; write (a) in decimal (2 digits max) to console ; a,f,c wrtdec: ld c,'0'-1 wdec1: inc c sub 10 jp nc,wdec1 add 10+'0'; make lo order ascii push af ld a,c call couta pop af jp couta ; msg1: db cr,lf,'Current effective sizes in K ' db '("/n" indicates n extra 256 byte pages)' db cr,lf,'TPA size = $' msg2: db ' CPM size = $' ; ds 64; minimum stack size stack: ds 0; top of stack end