/*
 * Imm_Addr.asm
 *
 *  Modified: 21 May 2024
 *  Authors: Dr. Schwartz, Ivan Bukreyev
 *
 *	Immediate addressing mode
 */ 

.include "ATxmega128A1Udef.inc"	;ATxmega128A1U definitions file

.equ CAT = 7
.set DOG = 9

.dseg				;SRAM range 0x2000-0x3FFF
.org 0x2000

.cseg
.org 0x0000
	jmp Main

.org 0x200	
Main:
	ldi r16, 22			;Load 22(0x16) into register r16
	ldi r17, 0x34		;Load 0x34 into register r17
	subi r16, 0b1011	;Subtract 0b1011(0x0B) from register r16 without carry

	ldi XL, CAT			;Load 7 into low byte of X
	ldi XH, DOG			;Load 9 into high byte of X 
	ldi YL, 0x34		;Load 0x34 into low byte of Y
	ldi YH, 0x12		;Load 0x12 into high byte of Y
	ldi ZL, low(Main<<1)	;Load ZL with low address of Main
	ldi ZH, high(Main<<1)	;Load ZH with high address of Main

HERE:
	rjmp HERE
