home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 308.lha / Use_A000 / use_a000.asm < prev    next >
Encoding:
Assembly Source File  |  1992-09-01  |  1.8 KB  |  67 lines

  1. CSEG    SEGMENT
  2.     ASSUME DS:CSEG, SS:CSEG, CS:CSEG, ES:CSEG
  3.  
  4. ;**********************************************************************
  5. ;*        Janus Handler (ROM Extension) Initialization Trigger        *
  6. ;*                                                                    *
  7. ;*       Fully Public Domain by Jeff Rush - September 7th, 1989       *
  8. ;*                                                                    *
  9. ;*       BIX: jrush         BBS: (214) 231-1372 Rising Star Opus      *
  10. ;**********************************************************************
  11.     ORG    100H
  12. BEGIN:
  13.     MOV    AX,0A000H
  14.     MOV    ES,AX        ; Pickup Segment of Expected ROM Extension
  15.  
  16.     CMP    WORD PTR ES:[0],0AA55H
  17.     JNE    NOT_HERE
  18.  
  19.     CALL    CS:FARPTR        ; Invoke ROM via Far Call to Init Entry
  20.  
  21.     LEA    SI,ERR_MSG
  22.     CALL    PRTSTR        ; Print Success Message
  23.  
  24.     MOV    AX,4C00H
  25.     INT    21H        ; Terminate with an Exit Code of 0 (ok)
  26. NOT_HERE:
  27.     LEA    SI,ERR_MSG
  28.     CALL    PRTSTR        ; Print Error Message
  29.  
  30.     MOV    AX,4C01H
  31.     INT    21H        ; Terminate with an Exit Code of 1 (error)
  32.  
  33. FARPTR    DD    0A0000003H
  34.  
  35. OK_MSG:    DB    'Janus Rom Extension Initialized.',0DH,0AH,0
  36. ERR_MSG:    DB    'No Rom Extension Found at Segment A000!',0DH,0AH,0
  37.  
  38. ;**********************************************************************
  39. ;*                           Subroutine                               *
  40. ;*           Print Zero-Terminated String Pointed To By SI            *
  41. ;**********************************************************************
  42. PRTSTR    PROC    NEAR
  43.     PUSH    AX
  44. PRTSTR_LOOP:
  45.     LODSB
  46.     OR    AL,AL
  47.     JZ    PRTSTR_EXIT
  48.     MOV    AH,0EH
  49.  
  50.     PUSH    SI
  51.     INT    10H
  52.     POP    SI
  53.  
  54.     JMP    PRTSTR_LOOP
  55.  
  56. PRTSTR_EXIT:
  57.     POP    AX
  58.     RET
  59. PRTSTR    ENDP
  60.  
  61. CSEG    ENDS
  62. ;**********************************************************************
  63. ;*                                                                    *
  64. ;**********************************************************************
  65.     END    BEGIN
  66.  
  67.