*---------------------------------------------------------------* * man.aii * * ProLine manual displayer utilities * * * * Copyright 1985-1992 Morgan Davis Group * * * * When Who Version Description * * ------- --- -------- --------------------------------------- * * 24feb92 mwd 1.0b1 Created from old ORCA source * 3jun92 mwd 1.0 Official release * machine M65C02 case on include 'handy.mac' include 'mega2.equ' include 'omm.equ' include 'ommids.equ' prmtbl equ $e0 retvar equ $1d L equ $06 ptr equ $07 ptr2 equ $09 *------------------------------* * Manual Segment Header * *------------------------------* mn PROC hVERS DC.W $0000 ;W: driver loader version hID DC.W 'mn' ;W: driver's two-byte signature hSIZE DC.W END-START ;W: size of driver (not including header) hORG DC.W START ;W: org of driver pc phase hAMPC DC.W AMPERCT ;W: ampersand command lookup table address hKIND DC.W $0000 ;W: driver kind hRSRV1 DC.W $0000 ;W: reserved 1 hRSRV2 DC.W $0000 ;W: reserved 2 START cmp #MSG_AMPR ;user service call? beq doampr ;yes cmp #MSG_INIT beq doinit cmp #MSG_DIED ;someone dying? beq dodeath cmp #MSG_BORN beq dobirth cmp #MSG_INFO ;get info string? bne startrts ;no move word,a_info,a1 startrts rts doinit dodeath dobirth ldrs a,y,#ModemWorks_ID ;ModemWorks ID strs a,y,a1 ldx #OMM_ID ;ask the loader to locate one ldy #OMM_GETID jsr OMMVEC stx mwindex ;assume it is there rts *------------------------------* * Amper Command Dispatcher * *------------------------------* doampr jsr chkopn move word,a_man,a1 ldy #OMM_PUTWORD ldx #OMM_ID jsr OMMVEC jmp chkcls *------------------------------* * Man String Printer * *------------------------------* ; CALL 768, PM, OF, ASC(UC$), WD, CP, SP, A$, WF, CP, SP, A$ man ldy #0 ;gather variables up to the string (A$) _mopts phy jsr combyte txa ply sta vars,y iny cpy #6 bcc _mopts jsr chkcom ;skip comma after call address ldy #OMM_GETSTR ;parse string ldx #OMM_ID jsr OMMVEC ldy #2 ;copy the descriptor _aadesc lda lowtr,y sta L,y dey bpl _aadesc stz WF loop jsr spc ;strip spaces txa beq return ;if string is null, return jsr findspc ;find first section to print bcs return ;branch if we need to wrap jsr print ;print it bra loop return lda WF jsr comnum ;skip comma, put number lda CP jsr comnum lda SP jsr comnum jsr chrget ;skip comma putstr ldy #3-1 _accopy lda L,y sta lowtr,y dey bpl _accopy ldy #OMM_PUTSTR callomm ldx #OMM_ID jmp OMMVEC comnum sta a1 stz a1+1 jsr chrget ldy #OMM_PUTWORD bra callomm print ldx SP ;print spaces beq _adloop txa clc adc CP sta CP jsr prbl2 _adloop lda (ptr) incw ptr dec L cmp UC ;underline character? bne _adno ldx OF ;output redirecting to file? bne _adnxt ;yes, skip all this underline stuff lda PM ;printer output (underlining)? bne _adpmon ;yes lda #25 ;assume underling (inverse) video bit ulmode ;if it's off (means it will be on) bpl _adchvid ;change video inc a ;26 (no underline) normal video _adchvid jsr doioctl ;change it _adpmon not byte,ulmode ;flip ulmode bra _adnxt _adno bit ulmode ;underlining? bpl _adnope ldx PM ;print mode? beq _adnope ;no, so don't do this underlining shit tax lda #'_'+$80 ;yes jsr cout lda #$88 ;backspace jsr cout txa _adnope ora #$80 jsr cout inc CP _adnxt dec segsiz bne _adloop ldx #1 cmp #'.'+$80 beq _adpunct cmp #'?'+$80 beq _adpunct cmp #'!'+$80 bne _adret _adpunct inx _adret stx SP rts findspc ldx L ;assume length of string ldy #0 _aeloop lda (ptr),y cmp #$20 beq _aefnd iny dex bne _aeloop _aefnd sty segsiz clc tya ;add new segment size to adc CP ; cursor position adc SP ; plus spaces cmp WD ;and compare to width bcc _aeret inc WF _aeret rts spc ldx L beq _afret txa ;copy length to Y tay _afloop dey lda (ptr),y ;work right <-- to left _afspc1 cmp #$20 ;space? bne _affront ;no, so get outta here dex ;yes, so len = len - 1 bne _afloop beq _afdone _affront ldy #0 ;start looking for non-spaces from left _afloop2 lda (ptr),y _afspc2 cmp #$20 ;space? bne _afdone ;no incw ptr dex bne _afloop2 _afdone stx L _afret rts doioctl sta prmtbl move byte,#$ff,prmtbl+3 ;don't clear --More-- counter phy ldy #0 ;the only MW user function (for now) ldx mwindex jsr OMMVEC ply rts *------------------------------* * Immediate Mode Addresses * *------------------------------* DC.B 0 ;flag start of data section a_info DC.W info a_man dc.w man DC.W $0000 *------------------------------* * Data Section * *------------------------------* msb on info cstr '&SYSDATE Man 3.0' msb off mwindex ds.b 1 AMPERCT cstr 'MAN' ;MAN(addrvar) dc.b -1 segsiz DS.B 1 ulmode DS.B 1 vars PM DS.B 1 OF DS.B 1 UC DS.B 1 WD DS.B 1 CP DS.B 1 SP DS.B 1 WF DS.B 1 END ENDP END