;;; test9.asm
;;; 
;;; STAX, LDAX, STA, LDA,
;;; SHLD, LHLD, XTHL, XCHG, PCHL, SPHL
;;; MOV REG, M, MOV M, REG, INC M, DCR M

	
	CPU	8080
	org 0000H		;RST0
START:
	LXI SP, 0F00H
	LXI H, 345H
	LXI B, 456H
	LXI D, 567H

	MVI A, 0BCH
	STAX B
	MVI A, 0DEH
	STAX D
	
	XRA A
	LDAX B
	LDAX D

	MVI A, 88H
	STA 345H

	MVI M, 77H
	LDA 345H

	LXI B, 0E00H
	LXI D, 0E01H

	LXI H, 1234H
	SHLD 0E00H

	LXI H, 0000H
	LHLD 0E00H

	LXI B, 5678H
	PUSH B
	
	XTHL	;HL(L,H)<=>(SP,SP+1)

	LXI H, 0ABCDH
	LXI D, 1234H
	XCHG	; HL<=>DE

	SPHL	;SP=HL

	LXI H, 0789H
	PCHL	;PC=HL
	
	org 789H
	LXI H, 0000H
	PCHL
ERR:
	HLT

	END
