home *** CD-ROM | disk | FTP | other *** search
/ Power Programming / powerprogramming1994.iso / progtool / microcrn / issue_39.arc / KAYPRO39.FIG < prev    next >
Text File  |  1987-12-01  |  2KB  |  74 lines

  1.         ;figure 1
  2.  
  3.         ;this routine (until RET) must be called during initialization
  4.         ;of the main program.  The whole thing must be loaded prior to
  5.         ;being called.
  6.         0008    XOR    A    ;make A = 0
  7.         0009    LD    I,A    ;hi byte of interrupt vector
  8.         000B    IM2        ;PIO set up to use IM2 only
  9.         000D    EI        ;enable them
  10.         000E    RET        
  11.         000F    DB    00    ;skip to make next hit even
  12.         0010    DW    0012H    ;vector to next word on interrupt
  13.         0012    EI        ;do nothing interrupt service
  14.         0013    RETI        ;go back where we were
  15.  
  16.  
  17.  
  18.  
  19.  
  20.         /* figure 2 */
  21.         outp(0X23,0X0F);  /* set port to output mode          */
  22.         outp(0X23,0X87);  /* enable interrupts                */
  23.  
  24.         outp(0X23,0X10);  /* set low byte of interrupt vector */
  25.         outp(0X21,0X4A);  /* initialize port                  */
  26.  
  27.         outp(0X0F,0x18);  /* i used the "normal" SIO initialization */
  28.         outp(0X0F,1);      /* rather than the one in st.com except   */
  29.         outp(0X0F,0);     /* for wr#5 there i used the one supplied */
  30.         outp(0X0F,3);
  31.         outp(0X0F,0xC1);
  32.         outp(0X0F,4);
  33.         outp(0X0F,0x44);
  34.         outp(0X0F,5);
  35.         outp(0X0F,0x68);  /* this is abnormal but from st.com       */
  36.         call(0x08,0,0,0,0); /* this calls the cpu initialization    */
  37.                     /* i didn't use it during trial runs    */
  38.                     /* an oversight on my part and it       */
  39.                     /* appeared to work without it but to   */
  40.                     /* on the safe side it should be        */
  41.                     /* included                             */
  42.  
  43.  
  44.  
  45.  
  46.  
  47.     /* figure 3 */
  48.     outp(0X21,0X0A); /* the following take the modem off-hook           */
  49.     sleep(1);        /* delays a bit                                    */
  50.     outp(0X21,0X1A); /* makes parallel port ready for modem work        */
  51.     outp(0X0F,0X05); /* selects wr#5                                    */
  52.     outp(0X0F,0X6A); /* selects modem in originate mode outp(0X0F,0XEA) */
  53.     term();         /* would make it answer mode and finally goes to   */
  54.              /* terminal mode of yam                            */
  55.  
  56.     outp(0X21,0X4A); /* is the code to go back on-hook (hangup)         */
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.     ;figure 4
  64.     LD    C,A        ;put it in C for later
  65.     IN    A,(021H)    ;get present value of port
  66.     AND    0F0H        ;strip low nibble
  67.     OR    C        ;put number to be dialed in proper place
  68.     RES    7,A        ;lower dial command
  69.     OUT    (021H),A    ;put it out
  70.     SET    7,A        ;raise dial command
  71.     OUT    (021H),A    ;put it out
  72.     RES    7,A        ;lower dial command
  73.     OUT    (021H),A    ;put it out
  74.