home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / lambda / soundpot / p / z80mr.lbr / PHASE1.ZZZ / PHASE1.AZM
Encoding:
Text File  |  1993-10-25  |  1.3 KB  |  53 lines

  1.     ORG    100h
  2.  
  3. OLD    EQU    0
  4.  
  5.     IF    OLD
  6. SYSPRT    EQU    1CH        ; old kaypro 2's and fours
  7.     ELSE
  8. SYSPRT    EQU    14H        ; tens, 4-84's, 2-84's
  9.     ENDIF
  10.  
  11. OFFSET    EQU    8000h        ; offset for calculating high addresses
  12.  
  13.     LD    DE,HISTRT    ; the destination of the High memory code
  14.     LD    HL,LODEND+1    ; the source code is just beyond this loader
  15.     LD    BC,HIEND-HISTRT    ; the number of bytes to move (end - start)
  16.     LDIR            ; move it up there
  17.     JP    HISTRT        ; jump to it
  18. LODEND:    NOP            ; to calculate end of loader/start of high
  19.                 ; memory code segment
  20.  
  21. HISTRT    EQU    $+OFFSET    ; BEGIN USING OFFSET    
  22.  
  23.     IN    A,(SYSPRT)    ; get present sysport data
  24.     SET    7,A        ; bank select bit
  25.     OUT    (SYSPRT),A
  26.     CALL    MOVIT        ; move the code routine
  27.     IN    A,(SYSPRT)
  28.     RES    7,A        ; back to ram bank
  29.     OUT    (SYSPRT),A
  30.     CALL    TPAMOV        ; now move to 100H for save
  31.     JP    0        ; back to CP/M
  32.  
  33. MOVIT    EQU    $+OFFSET
  34.  
  35.     LD    HL,0        ; Source is at 0 (in ROM )
  36.     LD    DE,OFFSET+1000H    ; Load above us
  37.     LD    BC,1000h    ; pick up 4K (2732)
  38.     LDIR
  39.     RET
  40.  
  41. TPAMOV    EQU    $+OFFSET
  42.  
  43.     LD    HL,OFFSET+1000H    ; destination becomes source
  44.     LD    DE,100H        ; move to TPA start
  45.     LD    BC,1000H    ; 4K bytes to move
  46.     LDIR
  47.     RET
  48.  
  49. HIEND    EQU    $+OFFSET
  50.     
  51.     END
  52.  
  53.