;6502SDK sample file
;
;You can define macros to perform common operations:
;remember that macros are NOT subroutines, as their code
;is expanded at every call.
;
;Macro declarations:

;***********************************************
;addition on 16 bit: a_plus_b = par_a+par_b
;
#macro www [par_a, par_b, a_plus_b]
	clc
	lda par_a
	adc par_b
	sta a_plus_b
	lda par_a+1
	adc par_b+1
	sta a_plus_b+1
#endm

;************************************************
;fill from "start" to "start+$10" with "value"

#macro fill[start, value]

	lda #value
	ldx #$10
loop:	sta start, x
	dex
	bne loop

#endm

;********Here begins the code***********
org $1000

www[var1, var2, result]

fill [$2000, $ff]
fill [$2100, $ff]

brk

;*********Variables**************
var1:	dw $789A
var2:	dw $6666
result: dw $0000
