home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / CPM / RCPM / MESSAGE.ASM < prev    next >
Assembly Source File  |  2000-06-30  |  3KB  |  88 lines

  1. ;
  2. ; MESSAGE.ASM - ASCII message typing program for CP/M.
  3. ;
  4. ; Written 7/24/84 by Al Jewer and released in the public domain.
  5. ;
  6. ; Copyright (c) 1984 Al Jewer.
  7. ;
  8. ; THIS PROGRAM MUST NOT BE SOLD !!!!!!!!!!
  9. ;
  10. ; This file is intended to be used on CP/M systems to generate
  11. ; messages in response to typed commands. That is, suppose you
  12. ; run an RCPM system, and would like people to know that they
  13. ; can use TYPE instead of TYPESQ. This file can be edited to 
  14. ; contain a message such as: 
  15. ;      TYPESQ no longer needed.... use TYPE instead.
  16. ;
  17. ; The unique thing about this file is that it contains ONLY ASCII
  18. ; characters... that is, the assembled .COM file can be copied
  19. ; with, say, WORDSTAR in non-document mode, and the new message
  20. ; inserted starting on the second line, and terminated with a 
  21. ; dollar-sign character. The resultant file can then be run 
  22. ; directly, WITHOUT assembly or loading! 
  23. ; You only need a text editor to create a message file!
  24. ; This is probably the wildest code I've ever written - if you
  25. ; can't follow it, don't worry! 
  26. ; Trust me, it works.
  27. ;
  28. ; Keep in mind that you really don't need the source code, just 
  29. ; the .COM file in order to create MESSAGE files.
  30. ;
  31.     ORG    100H        ; CP/M STARTING ADDRESS
  32. ;
  33. START:    DAD H            ;GET 0 IN THE L REGISTER
  34.     DAD H
  35.     DAD H
  36.     DAD H
  37.     DAD H    
  38.     DAD H
  39.     DAD H
  40.     DAD H
  41.     MOV H,L            ;ZERO THE HI BYTE OF HL PAIR
  42.     MOV D,L            ;ZERO HI BYTE OF DE PAIR
  43.     INR L            ;GET A 1
  44.     DAD H            ;SHIFT LEFT 2
  45.     DAD H
  46.     INR L            ;SHIFT IN ANOTHER 1
  47.     DAD H
  48.     INR L            ;AND ANOTHER
  49.     DAD H            ;FINAL SHIFT GIVES US 16H IN L
  50.     MOV A,L            ;GET VALUE TO A
  51.     CMA            ;THIS GIVES US 0E9H IN A REGISTER 
  52.                 ; (THIS IS A PCHL INSTRUCTION)
  53.     MOV L,H            ;RE-ZERO THE HL PAIR
  54.     INR L            ;GET A 1
  55.     MOV B,L            ;SAVE THE 1 IN THE B REGISTER
  56.     DAD H            ;GET A 5
  57.     DAD H
  58.     INR L
  59.     MOV E,L            ;SAVE THE 5 IN THE E REGISTER
  60.     DCR L            ;GET A 9
  61.     DAD H
  62.     INR L
  63.     MOV C,L            ;GET FUNCTION CODE (9) TO C REGISTER
  64.     MOV H,B            ;GET HI BYTE OF MESSAGE ADDRESS TO H
  65.     MVI L,(ADDRESS AND 0FFH) ;POINT TO OUR PCHL ADDRESS (THIS WILL
  66.                 ;BE AN OFFSET LARGER THAN 20H AND SMALLER
  67.                 ;THAN 7FH, THEREFORE AN ASCII CODE
  68.     MOV M,A            ;MOVE PCHL INSTRUCTION TO RAM
  69.     INR L            ;POINT PAST PCHL TO START OF MESSAGE
  70.     INR L            ;ALSO PAST INITIAL CRLF
  71.     INR L
  72.     MOV A,L            ;SWAP HL & DE (DE MUST POINT TO MESSAGE,
  73.                 ;HL MUST POINT TO LOCATION 5)
  74.     MOV B,H
  75.     MOV L,E
  76.     MOV H,D
  77.     MOV D,B    
  78.     MOV E,A
  79. ADDRESS: DB 'X'            ;THIS WILL BE CHANGED TO A PCHL
  80.     DB 0DH, 0AH        ;INITIAL CRLF
  81.     DB 'This is where the message goes', 0DH, 0AH
  82.     DB 'Make sure you end the message with a dollar-sign!', 0DH, 0AH
  83.     DB '$'            ;MESSAGE TERMINATOR
  84.     DB 'Z'-40H        ;ASCII END OF FILE
  85. ;
  86.     END    START
  87.