title 'figure 5. channel level i/o example' * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * this program demonstrates ASSIST-V channel level I/O * * three actions occur: * * 1. write three records on each of the 4 tracks of cylinder 0 * * 2. move to cylinder 1 and write three records on each of the * * 4 tracks of cylinder 0 * * 3. return to cylinder 1 and search for and read the last * * record on track 2. This last search occurs in multitrack * * mode. * this program uses sio with channel commands, i/o pseudo- * * instructions XPRNT and XDUMP, and tracing via pseudo- * * instruction XOPC. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * figure5 start 0 using *,0 iplpsw dc x'ff040000',a(initial) begin simulation at "initial" ds 2d unused (ipl ccws) extold ds d external old psw svcold ds d supervisor old psw pgmold ds d program old psw machold ds d unused (machine check old psw) ioold ds d i/o old psw csw ds d channel status word caw ds x,al3 channel address word ds f unused timer dc f'-1' inhibit timer interrupts ds f unused extnew dc x'00060000',a(abend) should not occur svcnew dc x'00060000',a(abend) should not occur pgmnew dc x'00060000',a(abend) should not occur machnew ds d unused ionew dc x'00040000',a(ioint) i/o interrupt handler psw space 2 initial lm 0,1,=a(figure5,hicore) get address bounds for trace l 2,=x'00400000' trace all ccw's executed xopc 3 enable tracing b write1 transfer to initial write space 2 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * i/o interrupt handler * * take program out of wait state and * * transfer to next instruction * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * space 1 ioint ni ioold+1,b'11111101' turn off wait state bit in psw lpsw ioold resume execution where stopped ltorg , org figure5+x'800' place i/o program in 2nd 2k blk. eject * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * phases 1 & 2: preformat 4 tracks on cylinders 0 and 1 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * write1 mvc caw(4),=a(preform) show address of channel program lm 3,5,=f'0,1,1' limit on number of cylinders to + preformat space 1 * * * * * * * * preformat 4 tracks of current cylinder * * * * * * * * loop1 lm 7,9,=f'0,1,3' limit on tracks per cylinder loop2 stc 7,ccwr1+17 place track number in record oi ccwr1+17,x'f0' convert to ebcdic form stc 7,ccwr2+17 place track number in record oi ccwr2+17,x'f0' convert to ebcdic form space 1 * * * * * * * * place cyl/track number in records to be written * * * lm 11,13,=a(ccwr0,20,ccwr2) limit on ccws to change loop3 stc 3,1(11) store cylinder number in count stc 7,3(11) store track number in count stc 7,14(11) store track number in key bxle 11,12,loop3 loop to change all ccws stc 3,seek+3 store cylinder number in seek stc 7,seek+5 store track number in seek sio x'101' initiate disk i/o lpsw wait1 go into wait state restart bxle 7,8,loop2 loop for all tracks of cyl. xopc 4 turn off trace xprnt =cl37'0formatting of one cylinder completed',37 bxle 3,4,loop1 loop for all cylinders space 2 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * phase 3: in multitrack mode, search for record 2 of cylinder 2 * * when found, read data portion of record and stop * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * mvc caw(4),=a(find) begin multitrack search program xopc 3 turn trace back on xprnt =cl20'0beginning of search',20 sio x'101' begin search program lpsw wait2 wait for i/o completion space 2 * * * * * * * * record found: dump it and halt * * * * * * * * * * * * dump xprnt =cl17'0search completed',17 xdump ans,4 display record found xopc 24 terminate normally abend xopc 25 terminate with dump eject ds 0d align ccws space 1 * * * * * * * * channel program 1: position head and write 3 records * preform dc x'1f',al3(sfmask),x'4000',h'1' set file mask dc x'07',al3(seek),x'4000',h'6' seek cyl/head home dc x'39',al3(seek+2),x'4000',h'4' search home addr. dc x'08',al3(home),x'4000',h'0' loop on search dc x'15',al3(ccwr0),x'6000',h'8' write r0 dc x'1d',al3(ccwr1),x'6000',h'20' write record 1 dc x'1d',al3(ccwr2),x'2000',h'20' write record 2 space 1 * * * * * * * * channel program 2: search for and read record * * * * * find dc x'1f',al3(sfmask),x'4000',h'1' set file mask dc x'07',al3(seek0),x'4000',h'6' seek cyl/head home1 dc x'39',al3(seek0+2),x'4000',h'4' search home addr. dc x'08',al3(home1),x'4000',h'0' loop on search srch22 dc x'e9',al3(key22),x'6000',h'8' search key high/equal dc x'08',al3(srch22),x'4000',h'0' loop on search dc x'06',al3(ans),x'2000',h'4' read data space 1 wait1 dc x'ff060000',a(restart) wait on 1st i/o prog. wait2 dc x'ff060000',a(dump) wait on 2nd i/o prog. space 1 * * * * * * * * direct access records * * * * * * * * * * * * * * * * * * cyl,trk key len ------key value----- --data-- * * rec. no. data len value * ccwr0 dc h'0,0',al1(0,0),h'004',xl8'0000000000000000',xl4'0000' ccwr1 dc h'0,0',al1(1,8),h'160',xl8'0000000000000001',cl4'h r1' ccwr2 dc h'0,0',al1(2,8),h'160',xl8'0000000000000002',cl4'h r2' space 1 sfmask dc b'11000000' file mask: allow any seek, write seek dc xl6'000000000000' seek cyl 0, trk 0 seek0 dc xl6'000000000000' seek track 0, cyl 0 ans dc cl4' ' space for record sought key22 dc xl8'0000000000000202' search record 2, track 2 hicore equ * end