$CONTROL MAP,CODE,USLINIT                                               00010000
<<iocdrd0 - module 20>>                                                 00015000
<< hp32002c mpe source c.00.00 >>                                       00020000
<< COPYRIGHT     "(C) COPYRIGHT HEWLETT-PACKARD CO. 1980.           >>  00025000
<<     this program may be used with one computer system at a       >>  00030000
<<     time and shall not otherwise be recorded, transmitted or     >>  00035000
<<     stored in a retrieval system.  copying or other reproduction >>  00040000
<<     of this program except for archival purposes is prohibited   >>  00045000
<<     without the prior written consent of hewlett-packard company.>>  00050000
<< **** note - dollar copyright cannot be used with this module *** >>  00055000
$title "DEC 26,1975   CARD READER DRIVER  -  IOCDRD0(20)"               00060000
$control privileged,uncallable,main=iocdrd0                             00065000
$thirty                                                                 00070000
                                                                        00075000
  <<                                                                    00080000
     card reader  request codes -                                       00085000
                                                                        00090000
  operation         func         parameters                             00095000
                                                                        00100000
    read             0    p1 - end of file specification                00105000
                                                                        00110000
                          p2.(11:2) - data mode                         00115000
                                                                        00120000
                                0 - packed ascii                        00125000
                                     count truncated to 80 bytes max    00130000
                                1 - column binary                       00135000
                                     count truncated to 80 words max    00140000
                                                                        00145000
  all odd byte counts are rounded up to an even number                  00150000
                                                                        00155000
                                                                        00160000
                                                                        00165000
  file  open         2    no operation                                  00170000
  file  close        3    no operation                                  00175000
  device close       4    clear eof status in lpdt                      00180000
                                                                        00185000
                                                                        00190000
    status  returns -                                                   00195000
                                                                        00200000
       01  - normal completion                                          00205000
                                                                        00210000
       33  - request aborted externally                                 00215000
       63  - request aborted because of power failue                    00220000
                                                                        00225000
       04  - invalid request, function or parameter                     00230000
       44  - start sio failure                                          00235000
      124  - no message link buffers available                          00240000
  >>                                                                    00245000
                                                                        00250000
                                                                        00255000
                                                                        00260000
                                                                        00265000
begin                                                                   00270000
$page                                                                   00275000
                                                                        00280000
  equate                                                                00285000
    bankn     = 3,         << bank number in sio program >>             00290000
    bufadr    = 5,         << buffer address in sio program >>          00295000
    bufbase   =%1010,      << offset to address aux read buffer >>      00300000
    dwcnt     = 8,         << holds requested word count >>             00305000
    crditsize = 10,        << card reader dit size >>          <<01340>>00310000
    crsiosize = 48,        << includes auxillary read buffer >>         00315000
    crsiosized2 = crsiosize/2,  << siosize/2 for initial >>    <<01300>>00320000
    opconsole = 0,         << output message to operator >>             00325000
    aborted   =%33,        << request aborted return status >>          00330000
    cntrl     =%40000,     << sio control order >>                      00335000
    dclose    = 4,         << device close function code >>             00340000
    ddp       = 9,         << dit driver dependent word >>     <<01383>>00345000
    dldev     = 3,         << logical device and unit numbers >>        00350000
    dlogerror =  9,        << error log status >>              <<01340>>00355000
    dserr     = 7,         << hardware i/o error status in dit >>       00360000
    dstat     = 6,         << last hardware interrupt status >>         00365000
    fopen     = 2,         << fopen function code >>                    00370000
    goodio    = 1,         << successful i/o status return >>           00375000
    intrptwait=%13,        << wait for completion driver return >>      00380000
    invalidop = 4,         << invalid operation requested >>            00385000
    notrdymsg = 11,        << not ready message number to mess proc >>  00390000
    notready  = 7,         << not ready driver return code >>           00395000
    pfabort   =%63,        << request aborted because of powerfail >>   00400000
    qfunc     = 6,         << function  >>                              00405000
    qmisc     = 3,         << miscellaneous storage >>                  00410000
    qpar2     = 9,         << read stop char; write prespace flag >>    00415000
    qwbct     = 7,         << word (+) or byte (-) count >>             00420000
    qstat     =10,         << request status and pcb number >>          00425000
    rdchkmsg  = 17,        <<read check msg. no.>>             <<00430>>00430000
    readorder = 4,         << read order in sio program >>              00435000
    requestdone= 5,        << request completed driver return code >>   00440000
    setbank   =%14000,     << sio set bank order >>                     00445000
    siofail   =%44,        << start sio failure >>                      00450000
    sioendi   =%34000,     << sio end order with interrupt >>           00455000
    sioread1  =%77777,     << sio read of one word >>                   00460000
    syserror  =%124,       << system error request status return code >>00465000
    syslpdt   =%10,        << logical physical device table >>          00470000
    ufailmsg  = 208,       <<unit failure msg. no.>>           <<00430>>00475000
  endeq       = 0;                                                      00480000
                                                                        00485000
                                                                        00490000
  define                                                                00495000
    asmb      = assemble#,                                              00500000
    ascii     =not logical(datamode)#, << ascii read mode requested >>  00505000
    badhollerith=(11:1)#,  << invaild hollerith status >>               00510000
    dldevn    =(8:8)#,     << logical device number of dit >>           00515000
    eofbit    =( 8:1)#,    << end of file status bit >>                 00520000
    eof       =( 7:3)#,    << eof state in lpdt >>                      00525000
    func      =( 8:8)#,    << qfunc, function code >>                   00530000
    hesf     =(10:1)#,    <<hopper empty or stacker full>>     <<00523>>00535000
    iostat    =( 8:8)#,    << total request status returned >>          00540000
    loadmemory=assemble( lsea )#,                                       00545000
    nrdy     =(15:1)#,    <<not ready or offline>>             <<00523>>00550000
    nrmessage = (9:1)#,<< dit0.(9:1) not ready message issued ><<01383>>00555000
    pfail     =(11:1)#,    << abort set because of power fail >>        00560000
    rdchk     =(4:1)#,     <<light/dark check status bit>>     <<00430>>00565000
    readdone  =( 9:1)#,    << aux buf holds card after eof returned >>  00570000
    sfail     =(10:1)#,    << failure on delayed start sio >>           00575000
    subtype   =(12:4)#,                                        <<00877>>00580000
    trouble   =(14:1)#,   <<timing,light,compare,hopper,hollerith,pick>>00585000
    enddef    = 0#;                                                     00590000
$page                                                                   00595000
                                                                        00600000
    logical ls0 = s-0,  lx = x;                                         00605000
    integer s0 = s-0, s1 = s-1, x = x;                                  00610000
    double array lpdtd(@) = db + syslpdt;                               00615000
                                                                        00620000
                                                                        00625000
                                                                        00630000
                                                                        00635000
     << dit definition and driver linkage area  >>                      00640000
                                                                        00645000
byte array  dlt(0:7) = db :=                                            00650000
 crditsize, 1, 0, 0, 0, 0, crsiosized2, 0; << type 1 monitor >><<01300>>00655000
                                                                        00660000
array dit( 1:crditsize) = db :=                                         00665000
  0, 0, 0, 0, 0, 0, 0, 0, 0,                                   <<01340>>00670000
  0;   <<dlogerror>>                                           <<01340>>00675000
                                                                        00680000
array sioa(1:crsiosize) = db :=                                         00685000
  cntrl,     0, setbank,0,    << set data mode and buffer bank >>       00690000
  sioread1,  0,    << main block read >>                                00695000
  sioendi,   0;                                                         00700000
                                                                        00705000
                                                                        00710000
    <<------------ external procedure declarations -------------->>     00715000
                                                                        00720000
procedure eofcheck(ioqp,bufr,count,blank);                              00725000
  value ioqp, bufr, count, blank;   pointer ioqp;                       00730000
  integer count;  logical blank;                                        00735000
  double  bufr;      option external;                                   00740000
                                                                        00745000
procedure  gip;   option external;                                      00750000
                                                                        00755000
procedure help;   option external;                                      00760000
                                                                        00765000
logical procedure iomessage(setno,msgno,mask,p1,p2,p3,p4,p5,   <<0u.eb>>00770000
   dest,reply,offset,ditp,iotype);                             <<0u.eb>>00775000
value setno,msgno,mask,p1,p2,p3,p4,p5,dest,reply,offset,ditp,  <<0u.eb>>00780000
   iotype;                                                     <<0u.eb>>00785000
integer setno,msgno,mask,p1,p2,p3,p4,p5,dest,reply,offset,     <<0u.eb>>00790000
   iotype;                                                     <<0u.eb>>00795000
integer pointer ditp;                                          <<0u.eb>>00800000
option variable,external;                                      <<0u.eb>>00805000
                                                                        00810000
procedure masterclear(ditp);                                            00815000
  array ditp;  option external;                                         00820000
                                                                        00825000
procedure siodm(ditp,flags);                                            00830000
  value ditp, flags;   logical flags;                                   00835000
  pointer ditp;    option  external;                                    00840000
                                                                        00845000
procedure startio(ditp,siop,qflag);                                     00850000
  value  ditp, siop, qflag;     logical qflag;                          00855000
  pointer ditp, siop;    option external;                               00860000
$page  "CARD READER DRIVER PROCEDURE - CRDRVR"                          00865000
                                                                        00870000
integer procedure crdrvr(ioqp,ditp,bank,bufaddr,siop,drtnumb);          00875000
  <<                                                                    00880000
     this procedure initiates and completes i/o for card readers        00885000
                                                                        00890000
    mode returns in crdrvr -                                            00895000
                                                                        00900000
        5  - request completed                                          00905000
        7  - not ready wait                                             00910000
      %13  - interrupt wait or wait for completion                      00915000
  >>                                                                    00920000
                                                                        00925000
  value  drtnumb, bank, bufaddr;                                        00930000
  integer  bank, bufaddr, drtnumb;                                      00935000
  integer  array ioqp, ditp, siop;                                      00940000
  option privileged, uncallable;                                        00945000
  begin                                                                 00950000
    integer ldev      = q+1;  << logical device number >>               00955000
    integer datamode  = ldev+1;  << holds data read mode >>             00960000
    double auxbufaddr = datamode+1;  << card saving buf address >>      00965000
    integer wcnt      = auxbufaddr+2;  << word cnt for conv. >><<00877>>00970000
         integer mode = crdrvr;  << current request state >>            00975000
                                                                        00980000
                                                                        00985000
    double pointer siopd = q-5;                                         00990000
                                                                        00995000
    logical array                                                       01000000
      ditpl(*)           = ditp,                                        01005000
      ioqpl(*)           = ioqp;                                        01010000
                                                                        01015000
    double bufaddrd      = q- 7;  << bank and offset >>                 01020000
                                                                        01025000
    array maxcount(0:1) = pb := 40,80;  << max transfer allowed >>      01030000
    array controlword(0:1) =pb := %12,5; << ascii/col binary cntrl >>   01035000
                                                                        01040000
    integer array kardin(0:255)= pb :=                         <<00877>>01045000
      << kard to jis8 conversion table >>                      <<00877>>01050000
      %000,%001,%002,%003,%004,%005,%006,%007,                 <<00877>>01055000
      %010,%011,%012,%013,%014,%015,%016,%017,                 <<00877>>01060000
      %020,%021,%022,%023,%024,%025,%026,%027,                 <<00877>>01065000
      %030,%031,%032,%033,%034,%035,%036,%037,                 <<00877>>01070000
      %040,%041,%042,%043,%044,%045,%046,%047,                 <<00877>>01075000
      %050,%051,%052,%053,%054,%055,%056,%057,                 <<00877>>01080000
      %060,%061,%062,%063,%064,%065,%066,%067,                 <<00877>>01085000
      %070,%071,%072,%073,%074,%075,%076,%077,                 <<00877>>01090000
      %100,%101,%102,%103,%104,%105,%106,%107,                 <<00877>>01095000
      %110,%111,%112,%113,%114,%115,%116,%117,                 <<00877>>01100000
      %120,%121,%122,%123,%124,%125,%126,%127,                 <<00877>>01105000
      %130,%131,%132,%133,%134,%135,%136,%137,                 <<00877>>01110000
      %140,%261,%262,%263,%264,%265,%266,%267,                 <<00877>>01115000
      %270,%271,%300,%301,%302,%303,%304,%305,                 <<00877>>01120000
      %306,%307,%310,%315,%316,%317,%320,%321,                 <<00877>>01125000
      %322,%323,%324,%173,%174,%175,%176,%177,                 <<00877>>01130000
      %200,%201,%202,%203,%204,%205,%206,%207,                 <<00877>>01135000
      %210,%211,%212,%213,%214,%215,%216,%217,                 <<00877>>01140000
      %220,%221,%222,%223,%224,%225,%226,%227,                 <<00877>>01145000
      %230,%231,%232,%233,%234,%235,%236,%237,                 <<00877>>01150000
      %241,%242,%243,%244,%245,%246,%247,%250,                 <<00907>>01155000
      %251,%252,%253,%254,%255,%256,%257,%240,                 <<00907>>01160000
      %260,%141,%142,%143,%144,%145,%146,%147,                 <<00877>>01165000
      %150,%151,%156,%160,%161,%162,%165,%164,                 <<00877>>01170000
      %152,%153,%154,%155,%272,%157,%273,%274,                 <<00877>>01175000
      %275,%276,%277,%311,%166,%163,%312,%313,                 <<00877>>01180000
      %314,%167,%325,%171,%326,%327,%330,%331,                 <<00877>>01185000
      %172,%170,%342,%343,%344,%345,%346,%347,                 <<00877>>01190000
      %340,%341,%332,%333,%334,%335,%336,%337,                 <<00877>>01195000
      %350,%351,%352,%353,%354,%355,%356,%357,                 <<00877>>01200000
      %360,%361,%362,%363,%364,%365,%366,%367,                 <<00877>>01205000
      %370,%371,%372,%373,%374,%375,%376,%377;                 <<00877>>01210000
                                                               <<00877>>01215000
                                                                        01220000
                                                                        01225000
   <<------------ begin card reader driver -------------->>             01230000
                                                                        01235000
    tos := ditp(dldev).dldevn;   << set ldev >>                         01240000
    tos := ioqp(qpar2).(11:2);   << set data mode >>                    01245000
    tos := double(@siop+bufbase);   << set auxbufaddr >>                01250000
    tos := 0;                        << set word counter >>    <<00877>>01255000
                                                                        01260000
    tos := ioqp;    << get qflags >>                                    01265000
    if < then   << request aborted >>                                   01270000
      begin                                                             01275000
        masterclear(ditp);                                              01280000
                                                                        01285000
        tos := if ioqpl.pfail then pfabort else aborted;                01290000
        goto clearcount;                                                01295000
        help;   << for linkage ******************************>>         01300000
      end;                                                              01305000
                                                                        01310000
    if ditpl.nrmessage and not ditpl(dstat) then                        01315000
      ditp.nrmessage := 0;   << card reader ready >>                    01320000
                                                                        01325000
    if mode<>2 then goto completor;                                     01330000
                                                                        01335000
    x := ioqp(qfunc).func;                                              01340000
    if <> then  << not a read request >>                                01345000
      begin                                                             01350000
        if not(fopen<=x<=dclose) then goto badcall; << bad function >>  01355000
        x := x - dclose;                                                01360000
        if = then   << dclose, clear eof state >>                       01365000
          begin                                                         01370000
            tos := lpdtd(ldev);                                         01375000
            tos.eof := 0;                                               01380000
            lpdtd( x ) := tos;                                          01385000
          end;                                                          01390000
        goto gooddone;                                                  01395000
      end;                                                              01400000
                                                                        01405000
    if ditpl(dstat).eofbit then  << hardware eof >>                     01410000
      begin                                                             01415000
        tos := lpdtd(ldev);                                             01420000
        tos.eof := 1;                                                   01425000
        lpdtd( x ) := tos;                                              01430000
      end;                                                              01435000
                                                                        01440000
    eofcheck(ioqp, 0d, 0, 0);                                           01445000
    if <> then goto iodone;   << end of file >>                         01450000
                                                                        01455000
    if datamode>1 then   << invalid mode specification >>               01460000
      begin                                                             01465000
badcall:                                                                01470000
        tos := invalidop;                                               01475000
        goto clearcount;                                                01480000
      end;                                                              01485000
                                                                        01490000
formcount:                                                              01495000
    tos := maxcount(datamode);                                          01500000
    tos := ioqp(qwbct);                                                 01505000
    if < then tos := -(tos&asr(1));  << convert to words >>             01510000
                                                                        01515000
    asmb(ddup,cmp );                                                    01520000
    if < then  << maximum < requested >>                                01525000
      begin   << round down to maximum >>                               01530000
        tos := ioqp(x);  ddel;  << get sign of orginal count >>         01535000
        if < then tos := -tos&asl(1);  << form byte count >>            01540000
        ioqp(x) := tos;   << set updated count >>                       01545000
        goto formcount;    << go form word count >>                     01550000
      end;                                                              01555000
                                                                        01560000
    ditp(dwcnt) := s0;  << save requested word count >>                 01565000
                                                                        01570000
    ditp(ddp).readdone := 0;                                   <<01383>>01575000
    if <> then     << card already read & ascii requested >>            01580000
      begin                                                             01585000
        if logical(datamode) then   << binary and card read in ascii >> 01590000
          goto badcall;                                                 01595000
        tos := 1;   << to indicate aux buffer read >>                   01600000
        goto checkdata;   << move data to user from auxillary buffer >> 01605000
      end;                                                              01610000
                                                                        01615000
    tos := -tos;   << make word count negative >>                       01620000
    if s0>-40 then                                                      01625000
      begin   << read 40 words into auxillary for backup >>             01630000
        ioqp(qmisc) := 1;   << set auxillary buffer flag >>             01635000
        tos := -40;                                                     01640000
        tos := auxbufaddr;   << address of save buffer >>               01645000
      end                                                               01650000
    else tos := bufaddrd;                                               01655000
                                                                        01660000
    siop(bufadr) := tos;     << buffer address >>                       01665000
    siop(bankn) := tos;     << set main block bank number >>            01670000
                                                                        01675000
    tos.(0:1) := 0;     << form read order from neg word count >>       01680000
    siop(readorder) := tos;     << set main block read order >>         01685000
                                                                        01690000
    siop(1) := controlword(datamode);  << ascii/binary read >>          01695000
    startio(ditp,siop,true);                                            01700000
    if > then        << reader not ready? >>                            01705000
siofailure:                                                             01710000
      if ditpl(dstat) then goto notrdy else                             01715000
        begin  << sio failure >>                                        01720000
          tos := siofail;                                               01725000
          goto badio;                                          <<00.05>>01730000
        end;                                                            01735000
                                                                        01740000
    tos := intrptwait;                                                  01745000
    goto out;                                                           01750000
                                                                        01755000
                                                                        01760000
completor:                                                              01765000
    if tos.sfail then goto siofailure; << start sio fail elsewh<<00.05  01770000
                                                               <<00.05>>01775000
    if ditpl(dstat).trouble then                                        01780000
      begin                                                             01785000
        if ditpl(x).badhollerith then                                   01790000
          begin                                                         01795000
            tos := siop(bankn);                                         01800000
            tos := siop(bufadr);  << get bank and offset >>             01805000
                                                                        01810000
            x := 0;                                                     01815000
            while (x:=x+1)<=80 do                                       01820000
              begin                                                     01825000
                loadmemory;                                             01830000
                if lx then tos := tos&lsr(8)  << get left byte >>       01835000
                  else asmb(incb     );  << bump word address >>        01840000
                                                                        01845000
                if tos.(8:8)=%32 then  << invalid code found >>         01850000
                  if iomessage(1,12,%11000,ldev,x,,,,          <<0u.eb>>01855000
                     opconsole) then                           <<0u.eb>>01860000
                    goto nrwait << invalid hollerith message issued >>  01865000
                      else goto syserr;                                 01870000
              end;                                                      01875000
          end;                                                          01880000
                                                                        01885000
        tos := ditpl(x) land %14400; <<check timing,light/dark,compare>>01890000
        if <> then     <<error, set up message>>               <<00430>>01895000
          begin                                                         01900000
            ditp(dserr):= [8/1,8/dlogerror];                   <<01340>>01905000
            ditp(dlogerror):= ditp(dstat);  <<log error>>      <<01340>>01910000
            if tos.rdchk = 1   then  x := rdchkmsg             <<00430>>01915000
                               else  x := ufailmsg;            <<00430>>01920000
          end                                                           01925000
        else                                                            01930000
notrdy:                                                                 01935000
          x := notrdymsg;                                               01940000
                                                                        01945000
        ditp.nrmessage := 1;  << set message issued flag >>             01950000
        if <> or iomessage(1,x,%10000,ldev,,,,,opconsole) then <<0u.eb>>01955000
          begin  << issue message or already issued >>                  01960000
nrwait:                                                                 01965000
            tos := notready;                                            01970000
            goto out;                                                   01975000
          end;                                                          01980000
                                                                        01985000
syserr:                                                                 01990000
        tos := syserror;  << no message link buffers >>                 01995000
                                                                        02000000
badio:                                                         <<00.05>>02005000
       ditp(dserr):= [8/1,8/dlogerror];                        <<01340>>02010000
       ditp(dlogerror):= ditp(dstat);    << log error >>       <<01340>>02015000
        masterclear(ditp);                                     <<00.05>>02020000
                                                                        02025000
clearcount:                                                             02030000
        ioqp(qwbct) := 0;                                               02035000
        goto setstatus;                                                 02040000
      end;                                                              02045000
                                                                        02050000
      <<if hopper empty/stacker full and device ready>>        <<00523>>02055000
      <<then stacker full or hopper empty microswitch>>        <<00523>>02060000
      <<is sticking.  notify the operator.>>                   <<00523>>02065000
    if ditpl(dstat).hesf land not ditpl(dstat).nrdy  then      <<00523>>02070000
    begin                                                      <<00523>>02075000
      iomessage(1,209,%10000,ldev,,,,,opconsole);              <<00523>>02080000
       ditp(dserr):= [8/1,8/dlogerror];                        <<01340>>02085000
       ditp(dlogerror):= ditp(dstat);    << log error >>       <<01340>>02090000
    end;                                                       <<00523>>02095000
                                                               <<00523>>02100000
    tos := ioqp(qmisc);   << auxillary buffer flag >>                   02105000
                                                                        02110000
checkdata:                                                              02115000
    eofcheck(ioqp,if ls0 then auxbufaddr else bufaddrd,40,              02120000
                  if ascii then 1 else -1);                             02125000
                                                                        02130000
    if tos then     << read into auxillary buffer >>                    02135000
      begin                                                             02140000
        if = then  << no eof >>                                         02145000
          begin  << move data to users buffer >>                        02150000
            tos := bufaddrd;                                            02155000
            tos := auxbufaddr;                                          02160000
            tos := ditp(dwcnt);  << word count to move >>               02165000
            asmb( mabs );                                               02170000
            goto gooddone;                                              02175000
          end;                                                          02180000
                                                                        02185000
        if < then goto setreaddone;     << back up card >>              02190000
      end                                                               02195000
                                                                        02200000
    else if < then   << read to user buffer and back up >>              02205000
      begin  << back up, so save data in aux buffer >>                  02210000
        tos := auxbufaddr;                                              02215000
        tos := bufaddrd;                                                02220000
        tos := 40;                                                      02225000
        asmb( mabs 1 );  << leave source address on tos >>              02230000
                                                                        02235000
        x := ditp(dwcnt);                                               02240000
        do begin  << blank user's buffer >>                             02245000
             tos := tos-1;   tos := 0;                                  02250000
             asmb( ssea );                                              02255000
           end                                                          02260000
        until dxbz;                                                     02265000
                                                                        02270000
setreaddone:                                                            02275000
        if ascii then ditp(ddp).readdone := 1;                 <<01383>>02280000
      end                                                               02285000
    else if = then   << no eof >>                                       02290000
      begin                                                             02295000
gooddone:                                                               02300000
        x := ioqp(qfunc).func;       << i/o request type >>    <<00877>>02305000
        if <> then goto convertdone; << not read request >>    <<00877>>02310000
        tos := lpdtd(ldev);          << get subtype >>         <<00877>>02315000
        delb;                        << stack erase >>         <<00877>>02320000
        if tos.subtype=1 and ascii then                        <<00877>>02325000
        begin                        << katakana char >>       <<00877>>02330000
           wcnt := 0;                << wcnt initialize >>     <<00877>>02335000
           while wcnt < integer (ditp(dwcnt)) do               <<00877>>02340000
           begin                     << start convert & move >><<00877>>02345000
              tos := bufaddrd;       << load bufaddrd >>       <<00877>>02350000
              tos := tos+wcnt;       << addr of convert data >><<00877>>02355000
              asmb(lsea);            << load data >>           <<00877>>02360000
              asmb(delb,delb);       << clear addr on stack >> <<00877>>02365000
              asmb(dup);                                       <<00877>>02370000
              asmb(andi 255);        << right byte >>          <<00877>>02375000
              x := tos;                                        <<00877>>02380000
              tos := kardin(x);      << convert to jis8 >>     <<00877>>02385000
              asmb(xch);             << next byte >>           <<00877>>02390000
              tos := tos & lsr(8);   << left byte >>           <<00877>>02395000
              x := tos;                                        <<00877>>02400000
              tos := kardin(x);      << convert to jis8 >>     <<00877>>02405000
              tos := tos & lsl(8);   << shift to left >>       <<00877>>02410000
              asmb(or);              << merge r. and l. byte >><<00877>>02415000
              tos := bufaddrd;                                 <<00877>>02420000
              tos := tos+wcnt;       << converted data adr >>  <<00877>>02425000
              asmb(cab;ssea;ddel);   << move and clear addr >> <<00877>>02430000
              wcnt := wcnt+1;        << update word counter >> <<00877>>02435000
           end;                                                <<00877>>02440000
        end;                                                   <<00877>>02445000
convertdone:                                                   <<00877>>02450000
                                                               <<00877>>02455000
                                                               <<00877>>02460000
        tos := goodio;                                                  02465000
                                                                        02470000
setstatus:                                                              02475000
        ioqp(qstat).iostat := tos;                                      02480000
      end;                                                              02485000
                                                                        02490000
iodone:                                                                 02495000
    tos := requestdone;                                                 02500000
                                                                        02505000
out:                                                                    02510000
    crdrvr := tos;                                                      02515000
                                                                        02520000
  end;      <<----  c r d r v r ------- >>                              02525000
                                                                        02530000
                                                                        02535000
                                                                        02540000
                                                                        02545000
  <<*************** driver linkage area ******************>>            02550000
                                                                        02555000
                                                                        02560000
asmb(                                                                   02565000
    pcal siodm;   << monitor   >>                                       02570000
    pcal crdrvr;  << initiator >>                                       02575000
    pcal crdrvr;  << and completor >>                                   02580000
                                                                        02585000
    con  0;       << no io process >>                                   02590000
                                                                        02595000
    con  0;       << no initialization >>                               02600000
                                                                        02605000
    con  1;       << one interrupt handler >>                           02610000
    pcal gip);    << interrupt handler >>                               02615000
                                                                        02620000
end.   << card reader driver - iocdrd0 >>                               02625000
