 .assume ADL=1
 .org $D1A881-2
 .db $EF,$7B

 call $020828 ;_homeup
 call $020810 ;_ClrScrnFull
 call $020848 ;_RunIndicOff - no busy icon
	ld   a,mb
	push af
	push iy
	Call GetCurrentMB
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;	
	
	
	;call monitor
	
	
	;ld   a,$d1
	;ld   mb,a
	;ld.sis   sp,$987e
	
	ld bc,$FFFFFF
	ld de,$EEEEEE
	ld hl,$DDDDDD
	ld ix,$CCCCCC
	
	ld.lis bc,$1234	;L__=24 bit register  _IS=Load 16 bit val (zero's BCU)
	ld.sis de,$1234	;S__=16 bit register  _IS=Load 16 bit val (zero's BCU)
	
	ld.sil hl,$123456	;S__=16 bit reg  _IL=Load 24 bit val  (zero's BCU)
	ld.lil ix,$123456	;L__=24 bit reg  _IL=Load 24 bit val 
	
	;call monitor
	Call.lil MonitorL	;Only works if Monitor ends RET.L
	call NewLine
	
	ld bc,$FFFFFF
	ld de,$EEEEEE
	ld hl,$DDDDDD
	ld ix,$CCCCCC
	
	;call.is Test8Bit & $ffff ;8 bit mode
	call.is Test8Bit_Outs & $ffff ;8 bit mode
	
	
	;call.is   Test8Bit & $ffff
	
	;di
	;ld   a,$d1
	;ld   mb,a
	
	;ld.sis   sp,$a845
	;call.is   Test8Bit & $ffff
	 
	  
	
	ld hl,$D10002
	ld de,$1234
	ld.sil (hl),de		;Write 16 bits 
	ld hl,$D10000
	ld de,$1234
	ld.sil (hl),de
	
	
	ld bc,32
	call.lil Monitor_MemDumpL
	  
	jp finish
	
	
.assume ADL=0
Test8bit:

	ld.lis bc,$1234	;L__=24 bit register  _IS=Load 16 bit val (zero's BCU)
	ld.sis de,$1234	;S__=16 bit register  _IS=Load 16 bit val (unk in z80 mode)
	
	ld.sil hl,$123456	;S__=16 bit reg  _IL=Load 24 bit val  (unk in z80 mode)
	ld.lil ix,$123456	;L__=24 bit reg  _IL=Load 24 bit val 
	
	call.sil MonitorL
	
	
	
	ret.l
	
Test8Bit_Outs:
	ld bc,$45ED
	ld ($0066),bc

	ld hl,$0060
	ld bc,32
	call.sil Monitor_MemDumpL
	
	ld bc,$B024	;Backlight
	ld a,255
	out (bc),a
	
	
	ld bc,$0001	;CPU speed 
	in a,(bc)
	call.sil MonitorL
	ld a,0		;6 mhz :-(
	out (bc),a
	
	
	
	
	ret.l
	
.assume ADL=1	


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;	
Finish:
	pop iy
	pop af
	ld mb,a
 call $020D8C ;_GetKey
 call $020810 ;_ClrScrnFull
 res 5,(iy+0) ;donePrgm , doneFlags
 
 ret
 
	
#include "\SrcAll\Functions.asm"
#include "\SrcAll\Monitor.asm"
	
Font:
#import "\ResAll\Font96.FNT"

Xpos: .db 0,0,0
Ypos: .db 0,0,0

GetCurrentMB:
	di
	ld ix,0
	add ix,sp
	ld a,(ix+2)
	ld mb,a			;Get current block
	ld.sis sp,StackZ80 & $FFFF	;Safe Stack
	ret
;Stack for Classic Z80
	.dw 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
	.dw 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
StackZ80: 
  
