home *** CD-ROM | disk | FTP | other *** search
- title 'MAKE Utility for CP/M Plus'
-
- ; Purpose : emulate a Microsoft-type MAKE for CP/M Plus
- ; Author : Wolfgang Muees, Hagenring 22, D-3300 Braunschweig
- ; Version : July 13, 1989
-
- BDOS equ 5 ; link to BDOS
- REMOVE$OFFSET equ 8 ; remove flag - start of RSX
- NAME$OFFSET equ 10 ; start of name - start of RSX
- VERBOSE$OFFSET equ 21 ; verbose flag - start of RSX
- NCOM1$OFFSET equ 24 ; next command - start of RSX
- NCOM2$OFFSET equ 28 ; next com.page - start of RSX
- PARSE$OFFSET equ 29 ; parse mkfile - start of RSX
- OPEN$OFFSET equ 32 ; open makefile - start of RSX
-
- WBOOT equ 0 ; return to CCP
- PRINTS equ 9 ; print string
- RETVER equ 12 ; return version number
- GSSCB equ 49 ; get/set system control block
- SETPRC equ 108 ; set program return code
- COMLINE equ 80H ; byte count of command line
-
- FALSE equ 0
- TRUE equ not FALSE ; boolean constants
-
- cseg
- TPA: jmp start
- db 'CP/M Plus MAKE utility by W.Muees '
- db 'Version 890713'
-
- start: mvi c,RETVER ; test for CP/M Plus
- call BDOS
- mvi a,2FH ; must be >= 30H
- cmp l
- jnc wrong$version
-
- lda COMLINE ; call without parameter ?
- ora a
- jz give$help
-
- lhld BDOS+1 ; get address of RSX
- lxi d,NAME$OFFSET
- dad d ; HL -> name field of RSX
- lxi d,test$name
- mvi b,8 ; test name field
- test$loop: ldax d
- cmp m
- jnz wrong$rsx
- inx d
- inx h
- dcr b
- jnz test$loop
-
- test$verbose: lxi h,COMLINE ; here is byte count of command tail
- mov e,m ; DE := length of command tail
- mvi d,0
- dad d ; HL points to last char of command tail
-
- verbose$skip: mov a,m ; trailing spaces/tabs?
- cpi ' '+1
- jnc verbose$test
- dcx h ; test preceeding char
- dcr e ; character count
- jnz verbose$skip
- jmp give$help ; missing file name
-
- verbose$test: cpi 'V' ; /v option ?
- jnz parse$name
- dcx h
- mov a,m
- cpi '/'
- jnz parse$name
-
- verbose$set: mvi m,0 ; delete /v from command tail
-
- lhld BDOS+1 ; set verbose flag in RSX
- lxi d,VERBOSE$OFFSET
- dad d
- mvi m,TRUE
-
- parse$name: call parse$make ; parse file name of make file
- ora a ; error ?
- jnz open$error
-
- call open$make ; open make file
- ora a ; error ?
- jnz open$error
-
- lock$rsx: lhld BDOS+1 ; install MAKERSX RSX permanent
- lxi d,REMOVE$OFFSET
- dad d
- mvi m,0
-
- lxi d,pb$get1 ; get address of next command waiting
- mvi c,GSSCB
- call BDOS
- push h
-
- lhld BDOS+1 ; store address into rsx
- lxi d,NCOM1$OFFSET
- dad d
- pop d
- mov m,e
- inx h
- mov m,d
-
- lxi d,pb$get2 ; and page of command RSX
- mvi c,GSSCB
- call BDOS
-
- lhld BDOS+1 ; store page into rsx
- lxi d,NCOM2$OFFSET
- dad d
- mov m,a
-
- lxi d,pb$set1 ; clear SCB variables for multiple commands
- mvi c,GSSCB
- call BDOS
- lxi d,pb$set2
- mvi c,GSSCB
- call BDOS
-
- exit: mvi c,WBOOT ; exit to CCP
- jmp BDOS
-
- open$error: mvi c,PRINTS ; print error string
- lxi d,open$msg
- call BDOS
-
- error$exit: mvi c,SETPRC ; set program return code = failed
- lxi d,0FF00H
- call BDOS
- jmp exit
-
- wrong$rsx: mvi c,PRINTS ; print error string
- lxi d,wrong$msg
- call BDOS
- jmp error$exit
-
- wrong$version: mvi c,PRINTS ; print error string
- lxi d,version$msg
- call BDOS
- jmp error$exit
-
- give$help: mvi c,PRINTS ; print help string
- lxi d,help$msg
- call BDOS
- jmp error$exit
-
- cseg
- parse$make: lhld BDOS+1 ; call parse routine in RSX
- lxi d,PARSE$OFFSET
- dad d
- pchl
-
- cseg
- open$make: lhld BDOS+1 ; call open routine in RSX
- lxi d,OPEN$OFFSET
- dad d
- pchl
-
- dseg
- pb$get1: db 15h ; address of next command waiting
- db 0
-
- pb$get2: db 12h ; page of command RSX
- db 0
-
- pb$set1: db 15h ; set this address to 0
- db 0FEh
- dw 0
-
- pb$set2: db 12h ; dito with page
- db 0FFh
- db 0
-
- dseg
- wrong$msg: db 'RSX '
- test$name: db 'MAKERSX ' ; name of make RSX
- db ' not found',13,10,7,'$'
- open$msg: db 'failed to open make file',13,10,7,'$'
- version$msg: db 'MAKE requires CP/M 3.0 or later',13,10,'$'
-
- help$msg: db 'MAKE maintenance utility for CP/M Plus,'
- db ' (c) Wolfgang Muees 890713',13,10
- db 'This program uses update/create date&time'
- db ' stamping to conditionaly',13,10
- db 'execute CCP command lines. USAGE : MAKE <filename>{/v}',13,10
- db 'The /v (verbose) option lists the contents of <filename> while',13,10
- db 'executing. All <filename>s may contain'
- db ' user numbers and passwords.',13,10
- db 13,10
- db 'Format of make (text)file entry:',13,10
- db '<object> : <list of source files>',13,10
- db ' <indent> <command 1>',13,10
- db ' <indent> <command 2>...',13,10
- db '<0 or more empty lines until next entry>',13,10
- db 13,10
- db 'Split <list of source files> with ''\'' on multiple lines',13,10
- db 'Use comment lines (with leading '';'') freely.',13,10
- db 13,10
- db 'MAKE executes <list of commands> if it didn''t find <object>',13,10
- db 'or if any <source file> is younger than <object>.',13,10
- db 'If MAKE didn''t find a <source file>,'
- db ' search is continued through',13,10
- db 'the CP/M Plus Drive Search Chain.'
- db ' So you can split your project',13,10
- db 'over four drives.',13,10,'$'
-
- end TPA
-