home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / games / speech2.zip / SAY.ASM < prev    next >
Assembly Source File  |  1985-09-17  |  2KB  |  56 lines

  1. TITLE Supplement to SPEECH.COM by Douglas Sisco      09-04-1985
  2. PAGE    55,132
  3.  
  4. CODE    SEGMENT 'CODE'
  5.         ASSUME CS:CODE,DS:CODE
  6.         ORG     100H
  7.  
  8.  
  9. BEGIN:  JMP     START
  10.  
  11. ; Put my name in .COM file - can be viewed with TYPE command.
  12.         DB      8,8,8,'Program by Douglas Sisco 9-4-85',13,10,26 
  13.  
  14. ; Here is a fake string descriptor  - BASIC Manual C-8
  15. ; SPEECH expects a pointer to this on the stack when it is called
  16. STRLEN  DB      ?
  17. STROFS  DW      82H
  18.  
  19. SPEECH   DW      0972                    ;DWORD Pointer to Speech
  20.          DW      0000                    ;This is where it is put 0000:03CCH
  21. NOSPEECH DB      'Speech Program not loaded - run SPEECH.COM and try again',13,10,'$'
  22.  
  23. START:  XOR     AX,AX
  24.         MOV     DS,AX
  25.         MOV     AL,DS:[3CCH]            ;See if SPEECH.COM is in memory
  26.         CMP     AL,0CDH
  27.         JZ      OK
  28.  
  29.         MOV     AH,9
  30.         PUSH    CS
  31.         POP     DS
  32.         MOV     DX,OFFSET NOSPEECH      ;Print message if not
  33.         INT     21H
  34.         INT     20H                     ;Return to DOS
  35. OK:   
  36.         PUSH    CS
  37.         POP     DS
  38.  
  39.         CMP     BYTE PTR DS:[80H],0     ;Is there something to say ?
  40.         JZ      OUT
  41.  
  42.         DEC     BYTE PTR DS:[80H]       ;Don't count leading space
  43.         MOV     AL,DS:[80H]             ;Byte that contains len of cmd line
  44.         
  45.         MOV     STRLEN,AL
  46.         MOV     AX,OFFSET STRLEN
  47.  
  48.         PUSH    AX                      ;Pass data location to speech program
  49.         CALL    DWORD PTR SPEECH        ;Say it
  50. OUT:
  51.         INT     20H                     ;Exit to DOS
  52.  
  53. CODE    ENDS
  54.         END     BEGIN
  55.