home *** CD-ROM | disk | FTP | other *** search
/ ftp.whtech.com / ftp.whtech.com.tar / ftp.whtech.com / club100 / ref / romhd.asm < prev    next >
Assembly Source File  |  2006-10-19  |  3KB  |  198 lines

  1. ;----------------------------------------------------------
  2. ;Option ROM Header must be ORGed at 0 by the assembler
  3. ;or linked at 0 by the linker.
  4. ;----------------------------------------------------------
  5.  
  6. ;Routine to turn on the Option ROM
  7.  
  8. OPON:    EQU    0FAA4H
  9.  
  10. ;Globals on the Telcom Back Page to temporarily hold HL and
  11. ;DE registers during a CALL to Standard ROM, or during an
  12. ;Interrupt.
  13.  
  14. HOLDH:    EQU    0FCC0H
  15. HOLDD:    EQU    0FCC2H
  16. INTH:    EQU    0FCC4H
  17. INTD:    EQU    0FCC6H
  18.  
  19.  
  20. ;Entry point arrived at by CALL 63012
  21.  
  22. RST0?:
  23. ;Optional for linking versions
  24. ;    EXTRN    PROGRAM
  25.     INX    SP
  26.     INX    SP
  27.     JMP    PROGRAM
  28.     DB    0,0,0
  29.  
  30. RST1?:                ;Not used
  31.     RET
  32.     DB    0,0,0,0,0,0,0
  33.  
  34. RST2?:                ;Not used
  35.     RET
  36.     DB    0,0,0,0,0,0,0
  37.  
  38. RST3?:                ;Not Used
  39.     RET
  40.     DB    0,0,0,0,0,0,0
  41.  
  42. RST4?:                ;Not Used
  43.     RET
  44.     DB    0,0,0
  45.  
  46. TRAP?:
  47.     DI
  48.     JMP    INTRAP
  49.  
  50. RST5?:                ;Not Used
  51.     RET
  52.     DB    0,0,0
  53.  
  54. RST55?:
  55.     DI
  56.     JMP    INT55
  57.  
  58. ;RST 6 used as short call to a Standard ROM routine.
  59.  
  60. RST6?:
  61.     JMP    STDCALL
  62.     DB    0
  63.  
  64. ;Replaces the 6.5 interrupt and sets up a call to 6.5 in
  65. ;Standard ROM
  66.  
  67. RST65?:
  68.     DI
  69.     JMP    INT65
  70.  
  71. RST7?:                ;Not Used
  72.     RET
  73.     DB    0,0,0
  74.  
  75. ;Replaces the 7.5 interrupt and sets up a call to 7.5 in
  76. ;Standard ROM
  77.  
  78. RST75?:
  79.     DI
  80.     JMP    INT75
  81.  
  82. ;An image of the OPON routine copied to FAA4H by the
  83. ;Model 100 power up logic.
  84.  
  85. OPONIMG:
  86.     PUSH    PSW
  87.     MVI    A,1
  88.     OUT    0E0H
  89.     POP    PSW
  90.     RET
  91.     DB    0
  92.  
  93. ;---------------------------------------------------------
  94. ;The STDCALL routine allows a program running in the
  95. ;the Option ROM to call and return to an address in the
  96. ;Option ROM.
  97. ;Syntax is to use a RST 6 plus the address to be called.
  98. ;
  99. ;    RST    6
  100. ;    DW    04B44H
  101. ;---------------------------------------------------------
  102.  
  103. STDCALL:
  104.     DI
  105.     SHLD    HOLDH        ;Caller's HL
  106.     XCHG
  107.     SHLD    HOLDD        ;Caller's DE
  108.     POP    H        ;(HL)=Routine to Call
  109.     MOV    E,M
  110.     INX    H
  111.     MOV    D,M        ;DE=Routine to Call
  112.     INX    H        ;HL=Return Address
  113.     PUSH    H
  114.     LXI    H,OPON        ;return through OPON
  115.     PUSH    H
  116.     PUSH    D        ;Return Address
  117.     LHLD    HOLDD        ;Caller's DE
  118.     XCHG
  119.     LHLD    HOLDH        ;Caller's HL
  120.     EI
  121.     JMP    STDON
  122.  
  123.  
  124. ;Routines for each of the hardware traps.
  125. INTRAP:
  126.     CALL    INTCALL
  127.     DW    0024H
  128.     RET
  129.  
  130. INT55:
  131.     CALL    INTCALL
  132.     DW    002CH
  133.     RET
  134.  
  135. INT65:
  136.     CALL    INTCALL
  137.     DW    0034H
  138.     RET
  139.  
  140. INT75:
  141.     CALL    INTCALL
  142.     DW    003CH
  143.     RET
  144.  
  145. OPX:
  146. ;Turns off the Option ROM (or turns on Standard ROM)
  147. ;Depending on your viewpoint.
  148. ;This routine must be ORGed at 85H. Ensure the the previous
  149. ;Code does not overlap into 85H
  150.  
  151.     ORG    85H
  152. ;Optional for linking versions
  153. ;    PUBLIC    STDON
  154. STDON:
  155.     PUSH    PSW
  156.     PUSH    H
  157.     LXI    H,26C8H
  158.     XTHL
  159.     XRA    A
  160. OPEXIT:
  161.     OUT    0E0H
  162.     RET
  163.  
  164. ;---------------------------------------------------------
  165. ;The INTCALL routine allows a program running in the Option
  166. ;ROM to call an interrupt routine.
  167. ;Syntax: CALL INTCALL plus the address to be called.
  168. ;
  169. ;    CALL    INTCALL
  170. ;    DW    24H
  171. ;---------------------------------------------------------
  172. INTCALL:
  173.     SHLD    INTH        ;Caller's HL
  174.     XCHG
  175.     SHLD    INTD        ;Caller's DE
  176.     POP    H        ;(HL)=Routine to Call
  177.     MOV    E,M
  178.     INX    H
  179.     MOV    D,M        ;DE=Routine to Call
  180.     INX    H        ;HL=Return Address
  181.     PUSH    H
  182.     LXI    H,OPON        ;return through OPON
  183.     PUSH    H
  184.     PUSH    D        ;Return Address
  185.     LHLD    INTD        ;Caller's DE
  186.     XCHG
  187.     LHLD    INTH        ;Caller's HL
  188.     JMP    STDON
  189.  
  190. ;For Non linking versions your Code begins here
  191. ;For linking versions delete the label below, and
  192. ;use it for the entry point to your program after
  193. ;declaring it PUBLIC.
  194.  
  195. PROGRAM:
  196.  
  197.     END
  198.