X-Git-Url: http://cloudbase.mooo.com/gitweb/z180-stamp-cpm3.git/blobdiff_plain/d12d8b38ea365a5878a5c9d74bf76de0a87dce33..f4471ef90f63448efdf36c4e3a5406641e2353bd:/cbios/bioskrnl.180 diff --git a/cbios/bioskrnl.180 b/cbios/bioskrnl.180 index 4338ef0..993e60e 100644 --- a/cbios/bioskrnl.180 +++ b/cbios/bioskrnl.180 @@ -232,7 +232,7 @@ set$jumps: ret - ds 64 + ds bs$stack$size bs$stack equ $ @@ -576,87 +576,33 @@ prd_1: ret - if 0 - ;------------------------------------------------------------------------------- -; print 16 bit number from HL +; print decimal 16 bit number from HL ; +; HL: unsigned binary number to print +; C: minimum print field width +; number is prined right-aligned +; B: pad character, typically ' ' or '0' pr.dec: - ex de,hl - ld hl,0 - ;fall thru - -pr.decl: - push ix - ld ix,1 ; count chars on stack - push bc - exx - ex (sp),hl -; push de -; push bc - exx - - xor a - push af ; string terminator - inc sp -prd_divloop: - ld bc,10 - call div32_16 ; get a digit - ld a,c - add a,'0' ; make it printable - push af - inc sp - inc ix - - ld a,h - or l - or d - or e - jr nz,prd_divloop - exx - push hl - exx - pop bc ;b=filler, c=field width - inc c - push ix + push de + ld de,0 + call pr.decl pop de -prd_filloop: - ld a,e - cp c - jr nc,prd_out - push bc - inc sp - inc de - jr prd_filloop -prd_out: - ld hl,0 - add hl,sp ;ptr to beginning of number string (hl==0 here) - call ?pmsg - ex de,hl - add hl,sp - ld sp,hl - exx - pop hl - exx - pop ix ret - endif - ;------------------------------------------------------------------------------- -; print 16 bit number from HL +; print decimal 32 bit number from DEHL ; - -pr.dec: - ex de,hl - ld hl,0 - ;fall thru +; DEHL: unsigned binary number to print +; C: minimum print field width +; number is prined right-aligned +; B: pad character, typically ' ' or '0' pr.decl: push bc ;save width and fillchar push bc - exx + exx ;(alt) ex (sp),hl ;save hl', get width and fill push de ;save de'