home *** CD-ROM | disk | FTP | other *** search
/ ticalc.org / ticalc_org_rev_b.iso / archives / 83 / asm / source / routines / gninput.asm < prev    next >
Encoding:
Assembly Source File  |  2001-07-01  |  822 b   |  27 lines

  1. Getting Numeric Input
  2. ==============================================================
  3.                                               by Linus Akesson
  4.  
  5. This is done in about the same way. Start by putting the
  6. prompt at 821ch:
  7.  
  8.         ld      de,821ch                ;put the prompt here
  9.         ld      hl,prompt
  10.         ld      bc,prompt_len           ;length of prompt, max = 16
  11.         ldir
  12.  
  13. Then call PGMIO_EXEC, but with a different command in ASM_IND_CALL:
  14.  
  15.         ld      a,1                     ;code for NUMERIC input
  16.         ld      (ASM_IND_CALL),a
  17.  
  18.         call    PGMIO_EXEC
  19.  
  20. The input is automatically parsed as an expression, and the result is placed
  21. in OP1.
  22.  
  23.         call    _formDisp               ;display it
  24.         ret
  25.  
  26. prompt:         .db "Inp:",0
  27. prompt_len      =   $-prompt