I finished the preprocessor, will start testing it more seriously tomorrow.
With it you can have in GAS:


macro divide:result,x,y
cmp y,#1024
addge result,r15,#2048
addlt result,r15,y,lsl #1
ldrh result,[result,DivTable-@F]
@@:
mul result,result,x
endm

proc myProc:arg1,arg2
labels _ret,again
local var1,var2
again:
cmp arg2,#0
beq _ret
str arg1,var1
divide r3,arg1,arg2

%define left r7 ; temporary vars on register
%define right r8
%define my_shift 10

mov left,#14
mov right,#15
add left,left,right,lsl #my_shift

b again
_ret:
ret
endp


and there's some more , like a second set of @@ labels, named "??" :)
I thought about .if,.while, .repeat , but I'll implement them in a couple of days - I have an exam and my job to work on today and tomorrow :D
Posted on 2004-06-03 07:50:31 by Ultrano
I tested the app, fixed some bugs, and now I've got the perfect tool I need for coding the Palm :D
Also, I included a pseudo-instruction, "LEA", like in x86.
lea r0,@F
@@: db 'i','l','k',0
:grin:
Otherwise I'd have to write:
_curaddr: add r0,pc,#@F-_curaddr-8

Also some debugging functions+macros are ready :) Those tiny devices are HELL to debug, if not impossible.
Posted on 2004-06-07 20:52:32 by Ultrano