; MOVE OS TO RAM

	ORG $8000

START	LDA #0
	STA $022F	;TURN OFF ANTIC
	STA $D40E
	STA $D20E	;DISABLE INTRPTS
	SEI		;MAKE SURE NO
	LDA #$C0	;INTERRUPTS
	STA $C1		;SET UP BANK AREA
	LDY #0
	STY $C0
L3	LDA ($C0),Y	;GET ROM BYTE
	TAX 
	LDA #$FE
	AND $D301	;CLR BIT 0 TO
	STA $D301	;BANK TO OS RAM
	TXA 
	STA ($C0),Y	;STORE BYTE
	LDA #$01
	ORA $D301
	STA $D301	;BACK TO ROM
	INY		;GET READY NEXT
	CPY #0
	BNE L3		;256 TIMES
NOK	INC $C1
	CLC		;DON'T UNDRSTND
	LDA $C1		;THIS CNTRL LOOP
	CMP #$D0
	BCC T1		;FROM $C0-$FF
	CMP #$D8	;SKIP $D0-$D7
	BCC NOK
T1	CMP #$00
	BNE L3

	CLC 
	LDA #$FF
	STA $D40E
	LDA #$F7
	STA $D20E	;TURN ON NMI,IRQ
	LDA #$22
	STA $022F
	CLI

	LDA #$FE
	STA $D301
	RTS 
