home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / sys / cbm / 3681 < prev    next >
Encoding:
Text File  |  1992-09-13  |  1.4 KB  |  60 lines

  1. Newsgroups: comp.sys.cbm
  2. Path: sparky!uunet!spool.mu.edu!umn.edu!csus.edu!netcom.com!fuzzy
  3. From: fuzzy@netcom.com (Fuzzy Fox)
  4. Subject: Re: Programming Question
  5. Message-ID: <0=yn1=m.fuzzy@netcom.com>
  6. Date: Mon, 14 Sep 92 06:35:31 GMT
  7. Organization: Foxes 'R' Us - Seven locations to serve you
  8. References: <1992Sep12.190730.17219@ultb.isc.rit.edu>
  9. Lines: 49
  10.  
  11. whd0675@ritvax.isc.rit.edu writes:
  12.  
  13. >What is the equivalent of this in assembler instead of BASIC:
  14.  
  15. >    500 input#15,en,em$,et,es
  16. >    510 if en>0 then print en,em$et,es:stop
  17. >    520 return
  18.  
  19. chkin    =    $ffc6
  20. clrchn    =    $ffcc
  21. chrin    =    $ffcf
  22. chrout    =    $ffd2
  23.  
  24. errbuff .byte   80              ; Buffer to store error message
  25.  
  26.         ldx     #15             ; Use #15 as standard input
  27.  
  28.     jsr    chkin
  29.  
  30.         ldy     #0
  31. loop1   jsr     chrin
  32.         sta     errbuff,y
  33.         iny
  34.         cmp     #$0d            ; Carriage return ends input
  35.         bne     loop1
  36.  
  37.         jsr     clrchn          ; Clear standard input.
  38.  
  39.         lda     errbuff         ; Check for "00"
  40.         cmp     #'0'
  41.         bne     error
  42.         cmp     errbuff+1
  43.     bne    error
  44.  
  45.     rts            ; All is okay, no error.
  46.  
  47. error    ldy    #0        ; Print error message
  48.     lda    errbuff,y
  49.     jsr    chrout
  50.     cmp    #$0d
  51.     bne    error
  52.  
  53.     rts
  54.  
  55. -- 
  56. #ifdef TRUE         | Fuzzy Fox                  fuzzy@netcom.com
  57. #define  TRUE   0   | a.k.a. David DeSimone      an207@cleveland.freenet.edu
  58. #define  FALSE  1   |
  59. #endif              |     How's my posting?  Call 1-800-ALT-FLAME
  60.