home *** CD-ROM | disk | FTP | other *** search
- page 132,63,3,3
- opt rc
- ;
- ; LOAD.ASM -- Memory Image Loader
- ;
- ; Copyright (C) 1990, 1991 by Alef Null. All rights reserved.
- ; Author(s): Jarkko Vuori, OH2LNS
- ; Modification(s):
- ;
-
- ; after HF0 is set, host must send commandword as
- ; 0 - end of loading
- ; 1 - next block to P memory
- ; 2 - next block to X memory
- ; 3 - next block to Y memory
-
-
- nolist
- include 'intequlc.asm'
- include 'ioequlc.asm'
- list
-
-
- ; Reset vector
- org p:i_reset
-
- ; mask interrupts
- ori #$03,mr
-
- ; copy loader code to upper memory
- clr b #<codesrc,r0
- move #codedest,r1
- do #codelen,endcopy
- move p:(r0)+,x0
- move x0,p:(r1)+
- endcopy
- jmp codedest
-
-
- ; actually in the load image, loader code resides here
- codesrc
-
-
- ; and it must be copied to here
- org p:$11e0
- codedest
-
-
- ; check host flag
- loop jclr #m_hf0,x:m_hsr,cont
-
- ; host flag set, check what the host wants to do
- jclr #m_hrdf,x:m_hsr,* ; wait for cmd word
- movep x:m_hrx,a ; read it
- tst a #0,r0
- jeq boot
- jmp loop
-
- ; read and store given databyte
- cont jclr #m_hrdf,x:m_hsr,loop ; wait for cmd word
- move #1,b1 ; check what to do for it
- cmp b,a #2,b1
- jeq toP
- cmp b,a
- jeq toX
- movep x:m_hrx,y:(r0)+
- jmp loop
- toX movep x:m_hrx,x:(r0)+
- jmp loop
- toP movep x:m_hrx,p:(r0)+
- jmp loop
-
- ; exit from the loader
- boot movec #2,omr ; set operating mode to 2
- andi #$0,ccr ; clear SR as if RESET
- jmp i_reset ; start fetching from P:$0000
-
- codelen equ *-codedest
-
-
- end
-