; Register bindings and other stuff V1.01 30/8/04
; Copyright 2008 Jeffrey Lee
; This file is part of WOUM.
; WOUM is free software: you can redistribute it and/or modify
; it under the terms of the GNU General Public License as published by
; the Free Software Foundation, either version 3 of the License, or
; (at your option) any later version.
; WOUM is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
; GNU General Public License for more details.
; You should have received a copy of the GNU General Public License
; along with WOUM.  If not, see <http://www.gnu.org/licenses/>.
r0	RN	0
R0	RN	0
r1	RN	1
R1	RN	1
r2	RN	2
R2	RN	2
r3	RN	3
R3	RN	3
r4	RN	4
R4	RN	4
r5	RN	5
R5	RN	5
r6	RN	6
R6	RN	6
r7	RN	7
R7	RN	7
r8	RN	8
R8	RN	8
r9	RN	9
R9	RN	9
r10	RN	10
R10	RN	10
r11	RN	11
R11	RN	11
r12	RN	12
R12	RN	12
r13	RN	13
R13	RN	13
r14	RN	14
R14	RN	14
r15	RN	15
R15	RN	15

sl	RN	10
SL	RN	10
fp	RN	11
FP	RN	11
ip	RN	12
IP	RN	12
sp	RN	13
SP	RN	13
lr	RN	14
LR	RN	14
pc	RN	15
PC	RN	15

f0	FN	0
F0	FN	0
f1	FN	1
F1	FN	1
f2	FN	2
F2	FN	2
f3	FN	3
F3	FN	3
f4	FN	4
F4	FN	4
f5	FN	5
F5	FN	5
f6	FN	6
F6	FN	6
f7	FN	7
F7	FN	7

POKENAME	EQU	1 ; Set to 1 if functions should have their name before them
POKEMOV		EQU	1 ; Set to 1 if functions should have a MOV R12,R13 before them

	MACRO
	FBEGIN $name,$mov
	; embed function name before a function
	[ POKENAME = 1
	DCB "$name",0
	ALIGN
	DCD &FF000000 + (:LEN: "$name"+3+1) :AND: &FFFFFFFC
	]
$name	[ $mov = 1 :LAND: POKEMOV = 1 :LAND: POKENAME = 1
	MOV R12,R13
	]
	MEND
