Commit 58627558 authored by John Spikowski's avatar John Spikowski

OXSC190115 Update

parent f28c232d
del c.exe
del co2???.exe
del oxygen32.dll
del oxygen64.dll
......@@ -8,7 +8,7 @@
'Charles E V Pegge
$filename "finded.exe"
uses rtl64
'uses rtl64
uses searchutil
'string cfgs="tools\FindEd.cfg"
string cfgs="FindEd.cfg"
......
copy oxygen.dll ..\..\oxygen.dll
pause
\ No newline at end of file
......@@ -20,11 +20,13 @@ itr 16:07 16/11/2018 Rework rtl321 and rtl641 cats. expose char count. (catbufpr
rollbacks:
'11:16 24/12/2018 Support pre and post '++' '--' macro operators (++/--)
'17:08 19/12/2018 Support macro op 'make' (creating var)
'12:51 19/12/2018 Support macro ops: 'not' 'neg'
'11:10 18/12/2018 Prepare ert (o2_errno) for renumbering
15:48 14/01/2019 Fix qword literals: imul qword [rbx+4096] (assm.inc qword operand)
08:39 08/01/2019 Support macro ops: 'not' 'neg'
22:13 07/01/2019 Support Macromember functions (himac wt)
22:12 07/01/2019 Fix scoped #ending brc (epgi[brc])
12:20 05/01/2019 Support specified alignment in UDT union groups: + 8 (decl.inc if a=43)
18:01 29/12/2018 Fix UDT array with indirect member
13:48 29/12/2018 Fix UDT padding, including UDT arrays (mps)
13:47 29/12/2018 Fix trailing sub-UDT alignment (roundupc)
......@@ -76,7 +78,7 @@ rollbacks:
10:04 21/11/2018 Fix overshoot with default assignment a={} (subsas ascw=12)
21:39 20/11/2018 Remove appendm, using appe instead (proclist etc)
18:37 20/11/2018 Restore UTF-16 appending string literals (enco.bas utfs)
18:18 20/11/2018 Allow dumping of returned floats and strings (tan.bas dumping)
18:18 20/11/2018 Allow dumping of returned floats and strings (tran.inc dumping)
11:51 18/11/2018 Fix dword division '/' conversion (typb=0x48)
11:28 18/11/2018 Fix byte shifts (expl.bas numop excluding shifts)
22:13 12/11/2018 Implement 'midstr' for optimised concat (midstr)
......
copy oxygen1.dll ..\..\oxygen.dll
pause
\ No newline at end of file
copy oxygen0.dll ..\..\oxygen.dll
pause
\ No newline at end of file
......@@ -2050,6 +2050,7 @@ function Assemble(string*s) as string
'
a=dic(" qword 8, dword 4, word 2, byte 1, ",wd)
if a then ptf=1
if a=8 then rex or=8 'qword operand
'
elseif flt>1
'
......
......@@ -899,6 +899,7 @@ sub vars(string*s)
if not arwd then arwd="1"
if findop(it,"init",w2)
hiex+=w2+"("+w3+cm+arwd+")"+cr
rps=1
end if
end if
if (ind=0)and(hasd<>0)
......@@ -907,7 +908,7 @@ sub vars(string*s)
w1=dstr+"("+w3+cm+arwd+")"+cr
if lclv
if asce=-1
appe(epgs[nst],epgi[nst],w1) 'no param vars
appe(epgs[brc],epgi[brc],w1) 'no param vars
endif
else
if instr(wr,"bx")
......@@ -1389,10 +1390,15 @@ sub types(int unip,vtp,*ttc,*tuc)
'
elseif a=43 '+' DEMARKATE UNION GROUPS
'
mid(wm,swd)=" " 'WIPE CODE
if isn(ascn)
wr=tword(wm,k)
wmx=val(wr) 'SET OFFSET
midspace(wm,swd,k)
endif
if w>wmx then wmx=w 'SET UNION MAX SIZE
wmn=wmx 'NEW BASE OFFSET
w=wmn 'NEW OFFSET
mid(wm,swd)=" " 'WIPE CODE
continue do
'
endif 'UNIONS AND INNER STRUCTURES
......
......@@ -533,9 +533,8 @@ function oper(int qp,tp, string*wk) as string
'
if c=127 then wv=pesp
'
'----------------------
'QUAD(64mode) LONG SHORT & BYTE
'----------------------
'QUAD(64bit mode) LONG SHORT & BYTE
'----------------------------------
'
if l=0 then l=cpuw
'
......
......@@ -1042,7 +1042,7 @@ function compatsig(string*p1,*p2, int pb) as int
if findop(n,"conv",w1)
'deferred object creation
paj(pa)=n
mpfx+=w1+"(#obj#,("+pex(pa)+")"+cr
mpfx+=w1+"(#obj#,("+pex(pa)+cm+pat(pa)+")"+cr
pas(pa)="lea "+qeax+cm+"#obj#"+cr
pav(pa)=callcnvi(c,qeax,e)
k=2
......
......@@ -76,7 +76,7 @@
==================================================
'
int a,b,c,d,e,f,m,r,n,v,typa,typc,typi,opo,cp,tp,clbr,cbj,qp,pid,ctop
int nsl,ofpu,noto,fxsq,ocp,omp,ojn,uex,usx,ixnd,ixnt,pargl
int nsl,ofpu,noto,noth,negh,fxsq,ocp,omp,ojn,uex,usx,ixnd,ixnt,pargl
int xmode,xoffs,opcn,lazn,tya1
string w1,w2,w3,w4,w5,w6,wr,wrp,wt,wp,laz,lazt
string ixns,wpfxa,wpfxi,wra,wri,memba,xcalc
......@@ -145,6 +145,17 @@
skiplspace(s,i)
ret
opocall: 'subroutine
====================
'MACRO OP
newcleanvar(w5,waco,m)
hlex+=w2+"("+w5+cm+wacc+cm+owa+")"+cr
wacc=w5
rps=1
skiplspace(s,i)
ret
operationsh: 'subroutine
========================
'
......@@ -155,10 +166,15 @@
endif
m=typ
if findop(typ,opsh,w2)
'if op<2
' newcleanvar(wacc,waco,m)
'endif
'gosub opcall
if op<2
newcleanvar(wacc,waco,m)
endif
gosub opcall
wacc=owa
else
gosub opocall
end if
typ=m
typa=m
typc=m
......@@ -171,10 +187,11 @@
'
converterh: 'subroutine
=======================
if findop(m,"conv",w2)
m=typc
m=typc
if findop(m,w1,w2)
w4=owa
newcleanvar(owa,wr,m) 'new owa and wr
hlex+=w2+"("+owa+cm+w4")"+cr
hlex+=w2+"("+owa+cm+w4+cm+str(typ)+")"+cr
w1=""
rps=1
endif
......@@ -358,7 +375,18 @@
'
'
'HIGHER ACCUM
if typc>=typh
if (typc>=typh)and(typi=0)
'
'UNARY
if ascw=45
negh=1
goto oploop
endif
if wr="not"
noth=1
goto oploop
endif
'
'NESTED EXPRESSION
if ascw=lbr
a=i
......@@ -381,7 +409,15 @@
'
'TYPE CONVERSION REQUIRED
if typa<>typc
gosub converterh
typ=typa : w1="conv" : gosub converterh
endif
if noth
w1="not" : gosub converterh
noth=0
endif
if negh
w1="neg" : gosub converterh
negh=0
endif
endif
'
......@@ -674,8 +710,7 @@
'
'TYPE CONVERSION REQUIRED
if typ<>typc
w4=owa
gosub converterh
w1="conv" : gosub converterh
endif
hiex+=storecode(wp) 'preprocess
gosub operationsh
......@@ -3549,14 +3584,6 @@ function subsas(string*s, int*i, string*ur,*v, int igb) as int
coret=0
parx--
'
'ACCESS MEMBER FOLLOWING A LOCATOR CALL
if asc(s,i)=46 'dot member name
w4=NewTmpName()
vars(typename(typ)+"*"+w4)
inserts(s,w4,i)
w2+=operi(2,cpuw,mrcso(me-1,1))+express(s,i,0)
endif
'
return w1+paramcode+w3+w2
'
end function ' procedures
......@@ -18,7 +18,7 @@
uses TimeUtil
'
$ datetimestamp "2018-12-30T12:31:59"
$ datetimestamp "2019-01-15T06:08:44"
$ o2version chr(34)+"0.1.0 "+datetimestamp+chr(34)
'
'DEFINITIONS GROUP
......
/*
type xquad
dword lo
int hi
=
quad qu
end type
*/
/*
uses corewin
'extern
quad gtc64() at @GetTickCount64
'end extern
#show quad a=gtc64()
print hex a
*/
/*
macro hquad quad(a,b,c)
a=b*0x10000*0x10000+c
end macro
*/
/*
uses corewin
quad a
GetTickCount64
addr ecx,a
mov [ecx],eax
mov [ecx+4],edx
print hex a
*/
/*
$filename "t.exe"
uses rtl64
mov eax,0x7bcd0000
movsxd rax,eax
quad q=0x1000
#show imul [q]
print hex rax
*/
'/*
'QUAD INPUT
$filename "t.exe"
uses rtl64
quad qs=0x10000 : qs*=0x10000
#show quad a= qs*0x12345678+0x9abcdef0
#show quad a= 0x12345678*qs+0x9abcdef0
'quad b=qs*0x1D4A9EB+0xC4E94E60
print hex a
'*/
/*
$filename "t.exe"
'uses rtl64
type tquad
dword lo
int hi
end type
macro mquad quad (q,h,l, pq)
tquad pq at @q
pq.hi=h
pq.lo=l
end macro
'
quad a=mquad(0x12345678,0x9abcdef0)
print hex a
print a
*/
/*
'13:55 07/01/2019
'
'ARRAY SYSTEM
class ArrayObj '1D 2D 3D
========================
sys bu 'member buffer
sys pd 'member destructor
int sn,sx,sy,sz 'sizes
'
function constructor(sys p, int n=4,x=1,y=1,z=1)
pd=p : sn=n : sx=x*n : sy=y*sx : sz=z*sy
bu=getmemory n*x*y*z
end function
'
function destructor()
if pd
int i
sys d=pd
sys p=bu
sys n=sn
for i=1 to sx*sy*sz
call d(p) 'destructor for each
p+=n
next
endif
freememory bu : bu=0
end function
'
function io(int x) as sys
return bu+(x*sn)
end function
'
function io(int x,y) as sys
return bu+(x*sn)+(y*sx)
end function
'
function io(int x,y,z) as sys
'print "io " x "," y "," z
return bu+(x*sn)+(y*sx)+(z*sy)
end function
'
end class
'
'
def CreateArray '1D 2D 3D
=========================
'%1 type
'%2 var name
'%3 array dimensions
'
ArrayObj %2_obj
sys %2_dstr
#ifdef %1.destructor
%2_dstr=@%1.destructor()
#endif
%2_obj.constructor(%2_dstr,sizeof(%1),%3)
macro %2 %1* (a,%3) { @a=%2_obj.io(%3) }
#ending {%2_obj.destructor()}
end def
'
'ArrayObj v_obj
'v_obj.constructor(sizeof(vector),x,y,z)
'macro v vector* (a,x,y,z) { @a=v_obj.io(x,y,z) }
'TESTS
'=====
'
type vector float x,y,z
CreateArray vector v(2,4,6)
v(1,2,3).y=2.5
v(1,2,3).z=4.5
v(1,2,3)={10,20,30}
print v(1,2,3).y
v(2,3,4)=v(1,2,3)
print v(2,3,4).y
*/
/*
'oleaut
'https://docs.microsoft.com/en-us/windows/desktop/api/oleauto/nf-oleauto-variantinit
uses corewin
uses variantutil
def sh print "%1 %2,%3"
macro variant_op
================
'
macro .init(a,b)
'sh init a b
VariantInit(a)
end macro
'
macro .free(a,b)
'sh free a b
VariantClear(a)
end macro
'
macro .move(a,b)
sh move a b
VariantCopy(a,b)
end macro
'
macro .+ (a,b,c)
sh + b c
VariantClear(a)
VarAdd(b,c,a)
end macro
'
macro .conv(a,b,t)
sh conv a b
VariantClear(a)
a.vt=VT_R8
a.dblval=b
end macro
'
macro .neg(a,b)
sh conv a b
VariantClear(a)
VarNeg(b,a)
end macro
'
macro .not(a,b)
sh conv a b
VariantClear(a)
VarNot(b,a)
end macro
'
end macro
#RECORDOF VARIANT
variant x
variant y
variant z
'x.vt=VT_R8 : x.dblval=2.5
'x=y
'x=y+z
x=2.5
variantcopy y,x
print y.vt " " y.dblval
'print "ok"
*/
/*
void VariantInit(
VARIANTARG *pvarg
);
HRESULT VarR8FromI4(
LONG lIn,
DOUBLE *pdblOut
);
HRESULT VariantChangeType(
VARIANTARG *pvargDest,
const VARIANTARG *pvarSrc,
USHORT wFlags,
VARTYPE vt
);
HRESULT VarMul(
LPVARIANT pvarLeft,
LPVARIANT pvarRight,
LPVARIANT pvarResult
);
HRESULT VarSub(
LPVARIANT pvarLeft,
LPVARIANT pvarRight,
LPVARIANT pvarResult
);
HRESULT VarNeg(
LPVARIANT pvarIn,
LPVARIANT pvarResult
);
HRESULT VarUI8FromR4(
FLOAT fltIn,
ULONG64 *pi64Out
);
HRESULT VariantClear(
VARIANTARG *pvarg
);
HRESULT VariantCopy(
VARIANTARG *pvargDest,
const VARIANTARG *pvargSrc
);
HRESULT VarNeg(
LPVARIANT pvarIn,
LPVARIANT pvarResult
);
HRESULT VarNot(
LPVARIANT pvarIn,
LPVARIANT pvarResult
);
HRESULT VariantChangeType(
VARIANTARG *pvargDest,
const VARIANTARG *pvarSrc,
USHORT wFlags,
VARTYPE vt
);
HRESULT VarR4FromStr(
LPCOLESTR strIn,
LCID lcid,
ULONG dwFlags,
FLOAT *pfltOut
);
HRESULT VarCat(
LPVARIANT pvarLeft,
LPVARIANT pvarRight,
LPVARIANT pvarResult
);
*/
/*
'14:52 29/12/2018
'indirect member in udt array
......@@ -18,6 +309,8 @@ print *a
*/
/*
'14:15 29/12/2018
'udt size alignment
......@@ -943,8 +1236,9 @@ UseMultidim vector
#recordof MultidimVector
Multidim vector v(7,3,1)
'#show sys p=v.locator(int{2,2,1})
v.locator(int{2,2,1}).y=23
print 1+v.locator(int{2,2,1}).y+4
''v.locator(int{2,2,1}).y=23
''print 1+v.locator(int{2,2,1}).y+4
'MyClassObject.functionthatreturnsaUDT
'(dimension1, dimension2, dimension3).
......
File added
File added
......@@ -346,27 +346,9 @@ function identypes(int tp) as string
'
end function
sub MacroMemberType(string*s, int *i,*tp)
=========================================
string wt
tp=0
do
nextinstruct(s,i)
if isb(ascn)
exit do
else
wt=aword(s,i)
tp=identype(wt) 'TYPE CODE IS STORED IN TYP
endif
loop
typ=tp 'GLOBAL
end sub
function MacroMember(string*s,*wm,*wp) as int
=============================================
int a,t
function MacroMember(string *s,*wp,*wt) as int
==============================================
int a,b,t
string w2
w2=mid(ow,dtf+1)
if asc(w2)=34
......@@ -384,14 +366,19 @@ function MacroMember(string*s,*wm,*wp) as int
if asc(s,a)>0x40
goto rsrch 'part of another name
endif
macromembertype(s,a,t)
wp=captureblock(s,a,wm) 'MEMBER MACRO PROTOTYPE OR MEMBER DEF BLOCK
ow="("+wm+" member) "+ow
nextinstruct(s,a)
b=instr(a,s,"(")
if b
wt=mid(s,a,b-a)
a=b
endif
wp=captureblock(s,a,"macro") 'MEMBER MACRO PROTOTYPE OR MEMBER DEF BLOCK
ow="(macro member) "+ow
dtf=0
return a
endif
ert=2001
ers="Unable to find "+wm+" member"
ers="Unable to find macro member"
return 0
end function
......@@ -420,36 +407,33 @@ function HiMac(int mm, string*s, int*i) as string
endif
endif
'
'EXPLICIT TYPE OF MACRO
'
wt=rtrim(wt)
'
if wt
w2=newtmpname()
if nisxn
w2+=cm
endif
inserts(s,w2,i)
endif
'
'IDENTIFY MACRO MEMBER
'
if (dtf<>0)and(md=109)
a=MacroMember(w1,"macro",w3) 'CAPTURE PROTOTYPE IN W3
a=MacroMember(w1,w3,wt) 'CAPTURE PROTOTYPE IN W3
if a=0
exit function
endif
w1=CaptureBlock(w1,a,"macro") 'CAPTURE BODY
w1=CaptureBlock(w1,a,"macro") 'CAPTURE
skiplspace(s,i)
if typ
wt=typename(typ) 'RETURNTYPE
endif
endif
'
if w3=""
goto nhimac 'NO PARAMS TO REPLACE
endif
'
'EXPLICIT TYPE OF MACRO
'
wt=rtrim(wt)
'
if wt
w2=newtmpname()
if nisxn
w2+=cm
endif
inserts(s,w2,i)
endif
'
if instr(w3,"=") 'DEFAULT VALUES
w4="(,"+w3+",)"
a=subsas(s,i,w4,w3,igb)
......@@ -1559,16 +1543,6 @@ function macres(int p, string*s, int*i) as string
goto nmacres
endif
'
'IDENTIFY MACRO MEMBER
'
if dtf
a=MacroMember(wk,"def",wk)
if a=0
exit function
endif
skiplspace(s,i)
endif
'
'FIND HIGHEST PARAMETER
'
a=1 : b=48
......@@ -2504,7 +2478,7 @@ function mword(string*s, int*i ) as string
if ert
exit function
endif
if ascn=46
if ascn=46 'DOT MEMBER
inserts(s,wk,i) : goto rmword
endif
goto insertw
......
No preview for this file type
......@@ -879,9 +879,9 @@ end function
'
case 41 ' )
'
if epgi[nst]
inserts(s,left(epgs[nst],epgi[nst]),i)
epgi[nst]=0
if epgi[brc]
inserts(s,left(epgs[brc],epgi[brc])+ep,i)
epgi[brc]=0
goto mainloop
endif
unnest()
......@@ -1478,20 +1478,22 @@ end function
'================
'
'CHECK FOR EPILOGS TO INSERT
if epgi[nst]
if epgi[brc]
'
'dual platform code
w1="
jmp fwd _end_proc
push rax
push rdx
_epilogs:
"+left(epgs[nst],epgi[nst])+"
"+left(epgs[brc],epgi[brc])+"
pop rdx
pop rax
ret
end function
"
inserts(s,w1,i)
epgi(brc)=0
epif=1
goto mainloop
endif
......@@ -2914,7 +2916,7 @@ end function
'
case 60 '#ENDING
'
appe(epgs[nst],epgi[nst],captureblock(s,i,""))
appe(epgs[brc],epgi[brc],captureblock(s,i,"")+cr)
goto mainloop
'
end select
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment