home *** CD-ROM | disk | FTP | other *** search
/ Vectronix 2 / VECTRONIX2.iso / FILES_01 / HISOFT.LZH / HISOFT_B.MSA / EXAMPLES / LINK / GETCH.S < prev    next >
Text File  |  1991-07-24  |  444b  |  28 lines

  1. * Assembler linking example
  2.  
  3.     opt    lattice
  4.  
  5. global    equr    a5
  6. eofch    equ    -1
  7.  
  8. * The BASIC routines that we use
  9.     xref    dcr_dest
  10.     xref    _SXL,_SOURCES,_CHI
  11.  
  12. * The routine that we are defining
  13.     xdef    _getch
  14.  
  15.  
  16. _getch
  17.     lea    _SOURCES(global),a0
  18.     bsr    dcr_dest    
  19.     move.l    _SXL(global),d0
  20.     cmp.l    d4,d0
  21.     bcc.s    getch_eof
  22.     move.b    -1(a1,d0.l),_CHI+1(global)
  23.     addq.l    #1,d0
  24.     move.l    d0,_SXL(global)
  25.     rts
  26. getch_eof    move.w    #eofch,_CHI(global)
  27.     rts
  28.