home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / cobol / compiler / cobol650 / asmsrc / inkey.asm next >
Assembly Source File  |  1990-07-07  |  2KB  |  57 lines

  1.  
  2. ;.286  for use with the 286 lib
  3. .radix 16
  4. CSEG        SEGMENT   PARA PUBLIC 'CODE'
  5. CGROUP        GROUP     CSEG
  6. DGROUP        GROUP     DSEG,IDATA,SSEG,ZZMSEG
  7. EGROUP        GROUP     ESEG
  8.         PUBLIC    INKEY
  9.             ASSUME    CS:CGROUP,DS:DGROUP,ES:EGROUP,SS:DGROUP
  10. ;This is the inkey routine to replace the function key
  11. ;strobe. The Calling procedure is
  12. ;***************************************
  13. ;CALL INKEY USING CHARECTER
  14. ;***************************************
  15. ;SEE EXAMPLE IN LIB0001A.COB
  16. ;
  17. ;
  18.  
  19. INKEY       PROC        FAR         ;this is a far proc
  20.             PUSH    BP          ;lets save the base ptr            
  21.             MOV        BP,SP       ;and give it the new xfer area            
  22.             mov        ax,[bp+06]  ;get the address of the xfer area 
  23.         push    ax          ;save it
  24.             MOV     AH,0        ;tell the bios
  25.         INT        16H         ;that we want to poll the keyboard
  26. exit:       pop        bx          ;place the address of the var 
  27.         cmp     al,0        ;in the bx. See if the al is 0
  28.         je        rotate      ;yes it is so move it around
  29.         jmp        exit2       ;clean up the stack area
  30. rotate:        mov        al,ah       ;good data so set up for exit 
  31.             mov        ah,0        ;
  32.         mov        [bx],ax     ;place the data back in the right
  33. exit2:        pop        bp          ;address 
  34.         RET         2           ;clean up the stack and return   
  35. INKEY       ENDP                    ; 2 AS WE PASSED A CHAR
  36.  
  37.  
  38. CSEG    ENDS
  39.  
  40. OVERLAY_AREA    SEGMENT    PARA PUBLIC 'CODE'
  41. OVERLAY_AREA    ENDS
  42. DSEG    SEGMENT    PARA PUBLIC 'DATA'
  43. DSEG    ENDS
  44. IDATA    SEGMENT COMMON PARA 'DATA'
  45. IDATA    ENDS
  46. SSEG    SEGMENT     STACK PARA 'STACK'
  47. SSEG    ENDS
  48. ZZMSEG    SEGMENT MEMORY word 'MEMORY'
  49. ZZMSEG    ENDS
  50. ESEG    SEGMENT COMMON BYTE 'CCODE'
  51. ESEG    ENDS
  52.     END
  53.  
  54.  
  55.  
  56.  
  57.