home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / cpm / utils / asmutl / hello.lbr / HELLO.ASM next >
Assembly Source File  |  1988-03-05  |  1KB  |  35 lines

  1. ;************************************************************************
  2. ;*                                    *
  3. ;*    HELLO.ASM:  This program prints "Hello." to the screen.  Big    *
  4. ;*    deal, huh?  Point is, when the resultant .COM program is run,    *
  5. ;*    it does the SAME thing under CP/M-80 or MS-DOS|  Maybe some of    *
  6. ;*    those small, but handy utility routines can now use this so    *
  7. ;*    the programs run under both systems|  This example is coded    *
  8. ;*    in 8080 code, although the same thing could be worked out with    *
  9. ;*    8088 code.  Now if we could get this program to also work with    *
  10. ;*    an Apple ][ and a MAC,    then we'd have something|  Who says    *
  11. ;*    that machine independant assembly language can't be done?    *
  12. ;*    Written by Mark D. Pickerill 24 Feb. 1988.  (SYSOP of "Hacker    *
  13. ;*    Heaven" RCP/M at (408) 375-5455.)                *
  14. ;*                                    *
  15. ;************************************************************************
  16.                 ;
  17. RIM:    EQU    20H        ; Rim opcode
  18.                 ;
  19.     ORG    0100H        ; Start of tpa
  20.     XCHG            ; Jmp short
  21.     INX    D        ; To just past the string
  22.     MVI    C,09H        ; Print string function
  23.     LXI    D,MESSAGE    ; Point
  24.     CALL    0005H        ; Call bdos
  25.     RET            ; To cp/m
  26. MESSAGE:DB    0DH,0AH,'Hello.$'
  27.     NOP            ; Space filler
  28.     MVI    C,1FH        ; Push cs,pop ds
  29.     CMP    D        ; Mov dx,
  30.     DCX    B        ; 0b
  31.     LXI    B,09B4H        ; 01: mov ah,09h
  32.     CALL    0CD21H        ; Int 21, int
  33.     DB    RIM        ; 20  ;terminate program
  34.     END
  35.