; ** DO.ASM ** ;A "DO-file" of executable programs, which may be ;individually brought to 0100h and run, using ;a choice made from a menu. This scheme ;saves disk space and directory entries, for ;computers which are short on both, like the ;Epson Geneva PX-8. This version of the program ;contains 3 useful utilities in 1kbyte, which is ;the minimum file size on the Geneva. ; ;Mike Yarus, 2231 16th Street, Boulder, CO 80302 ;Compuserve 73145,513 July, 1985 ; ;Equates which show the addresses of the programs ;Assemble DO to get a .COM file with space in the ;middle to accept the desired programs, then ;load .COM files at these addresses w/ DDT, then ;SAVE to get final executable DO.COM file ; startp equ 0104h ;start addr, pfk.com endp equ 0187h ;end addr for movbyte startb equ 0188h ;start addr of bat.com endb equ 0265h ;end addr startt equ 0266h ;start of td.com endt equ 035Bh ;end addr ; ;General equates ; bdos equ 0005h ;bdos jump wrtstr equ 09h ;write string fn rdconsl equ 0Ah ;read console buffer fn tpastrt equ 0100h ;tpa start lf equ 0Ah cr equ 0Dh tab equ 09h ; org tpastrt ;0100h tpa start ; jmp start ;go to DO, above the programs ; ;############# put programs here w/ DDT ############ ; ds 24Fh ;Space for the programs!!! ; ;############# space for programs above ############ ; ;go to menu -> get choice of prgm ; start mvi c,wrtstr;write string lxi d,menu ;load menu addr call bdos ;put up memu ; mvi c,rdconsl ;get prgm choice lxi d,buffsiz ;1 char allowed call bdos ;edit command ; mvi c,wrtstr ;clear the choice line lxi d,crlf call bdos ; lda choice+1 ;get letter choice back call ucase ;u/c choice ; ;--- a list of the programs, w/ load addresses --- ; bat cpi 'B' ;a B? jnz pfk ;no, try next choice lxi h,startb ;yes, load prgm B lxi d,endb+1 ;last byte + 1 lxi b,tpastrt ;load for run call movbyte ;ready to move B jmp tpastrt ;give control to B ; ;----- one of these paragraphs per program ----- ; pfk cpi 'P' ;a P? jnz td ;no, try next one lxi h,startp ;yes, load prgm p lxi d,endp+1 ;last byte + 1 lxi b,tpastrt ;load for run call movbyte ;ready to move P jmp tpastrt ;run it ; ;----- one of these paragraphs per program ----- ; td cpi 'T' ;a T? rnz ;no, LAST ONE, out of choices lxi h,startt ;yes, load prgm t lxi d,endt+1 ;last byte + 1 lxi b,tpastrt ;load for run call movbyte ;ready to move T jmp tpastrt ;run it ; ; ------------ end program list ------------ ; ;relocate the bytes beginning at hl ; bytes end + 1 at de ; to addr at bc ; movbyte mov a,m ;get a byte stax b ;put byte to bc inx b ;increment put addr inx h ;increment get addr ; mov a,h ;hi nibble, get addr cmp d ; = hi nibble, end? jnz movbyte ;no, move another byte ; mov a,l ;lo nibble, get addr cmp e ; = lo nibble, end? jnz movbyte ;no, move another byte ; ret ;done w/ move ; ;--- take char in a, do crude upper case test --- ; ucase cpi 60h ;if bigger, lcase rm ;already upper case sui 20h ;make upper case ret ; buffsiz db 1 ;the prgm buffer choice ds 2 ;act # char, then choice crlf db cr,lf,'$' ; menu db tab,'B = BAT.COM',lf,cr db '**>>DO P = PFK.COM',lf,cr db tab,'T = TD.COM',lf,cr db 'Choice: $' ; end ;DO, did, done ..CHSexe;|(