# HG changeset patch # User David Ladd # Date 1513807280 21600 # Node ID 00dc1ef6a7aac4f9d1f226224bfee58c0962072d # Parent aa01cfa1126718a2fe959dc8dfb0a828bc52b228 Pushing update to KRNP3 on behalf of Curtis Boyle. Curtis Boyle updated KRNP3 to reduce module footprint(size). diff -r aa01cfa11267 -r 00dc1ef6a7aa level2/modules/krnp3_perr.asm --- a/level2/modules/krnp3_perr.asm Wed Dec 20 15:26:30 2017 -0600 +++ b/level2/modules/krnp3_perr.asm Wed Dec 20 16:01:20 2017 -0600 @@ -19,6 +19,7 @@ * the community, is prohibited without the consent of the author. * Please share any extensions or modifications with the author, who * would be interested in hearing about them. +* Small optimizations for size by L. Curtis Boyle 11/26/2017 * * NOTE * Quick poll... how does the above sound as a copyright notice? Clearly, @@ -52,6 +53,8 @@ * ------------------------------------------------------------------ * 1 1987/06/23 Peter E. Durham * First release. +* 2 2017/11/26 L. Curtis Boyle +* nam krnp3 ttl Printerr functionality for Level 2 @@ -60,38 +63,40 @@ use defsfile endc -type set Systm ;System module, 6809 object code -revs set 0 ; -edition set 1 +Type set Systm ;System module, 6809 object code +atrv set ReEnt+rev +rev set 1 ; +edition set 2 - mod eom,name,type,ReEnt+revs,entry,256 + mod eom,name,Type,atrv,Entry,256 name fcs "KrnP3" fcb edition +SvcTbl fcb F$PErr ;System call number + fdb PErr-*-2 ;Offset to code + fcb $80 ;End of table + +P4Name fcc "krnp4" + fcb C$CR + *+ * Initialization routine and table *- Entry equ * - leay SvcTbl,pcr ;Get address of table + leay SvcTbl,pc ;Get address of table os9 F$SSvc ;Install services in table lda #Type ;Get system module type for KrnP4 - leax P4Name,pcr ;Get name for KrnP4 + leax P4Name,pc ;Get name for KrnP4 os9 F$Link ;Try to link to it - bcs Exit ;If not found, exit - jsr ,y ;Go execute it! -Exit rts ;Return to KrnP2 - -SvcTbl equ * - fcb F$PErr ;System call number - fdb PErr-*-2 ;Offset to code - fcb $80 ;End of table + bcs PErrBye ;If not found, exit + jmp ,y ;Execute it, return from there *+ * The new F$Perr service call *- *+ -* Data (in user space!) +* Data (in user space!) - reserved in users stack. 89 bytes *- BufLen equ 80 Buf rmb BufLen @@ -100,6 +105,13 @@ OneDig equ Buf+9 DataMem equ . +ErrMsg fcc "Error #000" +ErrLen equ *-ErrMsg + +FilNam fcc "/dd/sys/errmsg" + fcb C$CR +FilLen equ *-FilNam + *+ * FUNCTION PErr * PURPOSE Top level routine @@ -110,45 +122,48 @@ * X = Pointer to strings *- PErr equ * - bsr Setup ;Go set up registers - leax ErrMsg,pcr ;Get pointer to "Error #000" + ldb R$B,u ;Get error code + ldy D.Proc ;Get user's process descriptor + ldu P$SP,y ;Get user's stack pointer + leau -DataMem,u ;Reserve a little space (89 bytes) to build string + leax