\ MD11DNLD - Load Screen 06DEC84MCSempty decimal 1 7 +thru 256 here cp/m save md11dnld.com forth cr .( System Saved as MD11DNLD.COM) cr exit This set of screens creates a .COM file which may be used on an MD11 to download a .CMD file to a Pivot-2. The downloading system communicates with the L function of the Pivot's monitor rom. The system downloaded will usually be TARGET.CMD, another Forth system. \ MD11 Aux Port Equates 06DEC84MCShex 70 constant s3data \ SIO D ata 71 constant s3stat \ SIO status 60 constant s1data \ Console Data 61 constant s1stat \ Console Status 53 constant baudset \ CTC Baud Set 50 constant baud2 \ For Serial Port 3 decimal exit \ Initialize the Aux Port 06DEC84MCShex create Init-String 18 c, 10 c, 04 c, 04 c, 03 c, 0c1 c, 05 c, 0ea c, 10 c, 01 c, 00 c, 001A constant B9600 : Aux-Init ( -- ) Init-String 0b bounds do i c@ s3stat p! loop 3e baudset p! B9600 dup baud2 p! flip baud2 p! ; decimal \ Target Reset and Send-Break 06DEC84MCShex : Send-Break ( -- ) 5 s3stat p! ( Select wr5 ) 0fa s3stat p! ( Set Break ) 5 s3stat p! ( Select wr5 ) 0ea s3stat p! ; ( Clear Break ) : Reset-Target ( -- ) cr cr ." Reseting Target" 5 s3stat p! ( Select wr5 ) 06a s3stat p! ( Drop DTR ) 5 s3stat p! ( Select wr5 ) 0ea s3stat p! ; ( Assert DTR ) decimal exit \ Aux I/O Words 24Mar85mcs : (aux-emit) ( c -- ) begin s3stat p@ 4 and until s3data p! ; : (aux-key?) ( -- f ) s3stat p@ 1 and ; : (aux-key) ( -- c ) begin s3stat p@ 1 and until s3data p@ ; \ Xfer-File 06DEC84MCS 128 constant buf : ?read-error ( f -- ) If ( error ) ' (emit) is emit cr cr ." File Read Error" cr cr 0 go then ; : xfer-file ( -- ) [ cp/m ] file-size 0 ?do buf 26 bdos drop read ?read-error buf 128 bounds do i c@ emit loop i 7 and 7 = if bl (emit) then key? ?leave loop ; exit \ Download to monitor 06DEC84MCShex : dnld ( -- ) Aux-Init Reset-Target cr cr ." Downloading - Hit any key to abort" cr cr file-size 8 / 0 ?do ascii * emit loop 0d emit ['] (Aux-Emit) is emit ." L0000:0400" 0D emit 1 ms xfer-file Send-Break ['] (emit) is emit beep cr cr ; decimal \ Create System for DNLD 206DEC84MCS : down-load ( -- ) dark ." Down Load From MD11 to Pivot-2" cr cr ." Using L Command of Pivot-2 Monitor Rom" cr cr ." By Michael Stolowitz Version 3/24/85" cr cr empty-buffers only forth also definitions default ." Source File Name = " file? cr cr dnld ." Type J0040:0100 on Target" cr cr 0 go ; ' down-load is boot exit \ Echo 06DEC84MCS: Echo ( -- ) begin false s3stat p@ 1 and if ( DAV ) s3data p@ ( Fetch data ) begin s1stat p@ 4 and until s1data p! then s1stat p@ 1 and if ( DAV ) s1data p@ ( Fetch data ) dup 27 = if drop false else begin s3stat p@ 4 and until s3data p! then then until ; \ Echo 06DEC84MCScode echo ( -- ) begin s3stat in 1 # ana 0= not if ( DAV ) s3data in a b mov ( Fetch Data ) begin s1stat in 4 # ana 0= not until ( Wait TBE ) b a mov s1data out then s1stat in 1 # ana 0= not if ( DAV ) s1data in a b mov ( Fetch Data ) 27 # cmp 0= if next then begin s3stat in 4 # ana 0= not until ( Wait TBE ) b a mov s3data out then again ;