;
; ABC80680.ASM
;
; Detta program kopplar in HR minne |ver basic tolken
; och kopierar |ver ABC80 tolken till detta
;
MPORT    EQU      52            ; Minnestabellport
SADR     EQU      0C000H        ; Startadress denna rutin
;  
         ORG      SADR
START    DI
         LD       HL,0
         LD       DE,8000H
         LD       BC,4000H
         LDIR                   ; Flytta 0-16 k till 32-48k arean
;
; Koppla in RAM p} 0 - 16k
;
         LD       A,0
         LD       B,0*16
         CALL     BL_IN         ; 0-4k
         LD       A,1
         LD       B,1*16
         CALL     BL_IN         ; 4-8k
         LD       A,2
         LD       B,2*16
         CALL     BL_IN         ; 8-12k
         LD       A,3
         LD       B,3*16
         CALL     BL_IN         ; 12-16k
         LD       HL,8000H   
         LD       DE,0
         LD       BC,4000H
         LDIR                   ; Nu {r 0-16 flyttade
         LD       HL,4000H
         LD       DE,8000H
         LD       BC,4000H
         LDIR                   ; Flytta upp 16-32k till 32-48k arean
         LD       A,4
         LD       B,4*16
         CALL     BL_IN         ; 16-20k
         LD       A,5
         LD       B,5*16
         CALL     BL_IN         ; 20-24k
         LD       A,6 
         LD       B,6*16
         CALL     BL_IN         ; 24-28k
         LD       DE,4000H
         LD       HL,8000H
         LD       BC,4000H
         LDIR                   ; Flytta ner 32-48k till 16-32k arean
         EI
         RET       
;
BL_IN    SET      7,A
         LD       C,MPORT
         OUT      (C),A
         RET
;        
         END      START
