News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

.FOR built in JWasm

Started by habran, July 03, 2012, 11:38:29 PM

Previous topic - Next topic

habran

OK JJ2007,
LET$ me PUT$$$ the question in other words:
FOR$$$ example where is the source of LET%&%$#@ say "MbPrint   PROTO"
or "MbCopy   PROTO :DWORD, :DWORD, :DWORD" ? ;)
Cod-Father

habran

#106
thanks Frank
that's what are friends for :biggrin:
as you can see we can even tell a joke with a good programming :bgrin:
that is what I call a beautiful programming 8)
Cod-Father

jj2007

Quote from: habran on February 09, 2013, 11:36:42 PM
OK JJ2007,
LET$ me PUT$$$ the question in other words:
FOR$$$ example where is the source of LET%&%$#@ say "MbPrint PROTO"

You mean the one that allows strange things such as

        Let My$(1,ecx)="This is Masm32: "+FileRead$("http://www.masm32.com")+CrLf$+My$(ecx,1)
        FileWrite "test.txt", NoTag$(My$(ecx, ecx))

?? Caution, it's pure Masm :bgrin:

habran

No, I just made a point that you are hiding your "pure MASM" like a serpent its legs ;)
however, I am not interested to study any 32 bit source code, even if it is a BASIC(!@#$%^&*),
because I don't do any more 32 bit, I do only pure 64 bit :t
Cod-Father

jj2007

Quote from: habran on February 10, 2013, 06:07:43 AM
No, I just made a point that you are hiding your "pure MASM" like a serpent its legs ;)

The macros are open anyway - \Masm32\MasmBasic\MasmBasic.inc

And the superfast algos are closed source because I don't want to pass my time chasing my intellectual babies all over the place, especially not in some obscure C libraries :greensml:

Those who have contributed over time are properly credited, and if somebody who made a significant contribution asks me for the source, I will share it with that person. Privately :biggrin:

habran

That's what I pointed out
How can we admire your beautiful masm when all we see is BASIC($&@/!?%#¥€£~^*) :dazzled:
Cod-Father

jj2007


habran

Cod-Father

habran

#113
did you think that I was sleeping these few day :icon_eek:
if you did, you were wrong :eusa_naughty:
I have worked on optimization of this and look what I have got now:

option win64:0
OPTION PROLOGUE:NONE
OPTION EPILOGUE:NONE

xmemcpy PROC dest:QWORD,src :QWORD, count:UINT_PTR
  mov rax,rcx
  .if (rcx != rdx)
    .for (¦r8¦r9b=[rdx],[rcx]=r9b,rcx++,rdx++,r8--)
    .endfor
  .endif
  ret
xmemcpy ENDP
OPTION PROLOGUE:PrologueDef
OPTION EPILOGUE:EpilogueDef
xmemcpy:
0000000140034218  mov         rax,rcx
000000014003421B  cmp         rcx,rdx
000000014003421E  je          xmemcpy+1Eh (140034236h)
0000000140034220  and         r8,r8
0000000140034223  je          xmemcpy+1Eh (140034236h)
0000000140034225  mov         r9b,byte ptr [rdx]
0000000140034228  mov         byte ptr [rcx],r9b
000000014003422B  inc         rcx 
000000014003422E  inc         rdx 
0000000140034231  dec         r8   
0000000140034234  jne         xmemcpy+0Dh (140034225h)
0000000140034236  ret             

if you don't put r8-- last you get and r8,r8:

option win64:0
OPTION PROLOGUE:NONE
OPTION EPILOGUE:NONE

xmemcpy PROC dest:QWORD,src :QWORD, count:UINT_PTR
  mov rax,rcx
  .if (rcx != rdx)
    .for (¦r8¦r9b=[rdx],[rcx]=r9b,r8--,rcx++,rdx++)
    .endfor
  .endif
  ret
xmemcpy ENDP
OPTION PROLOGUE:PrologueDef
OPTION EPILOGUE:EpilogueDef

xmemcpy:
0000000140034218  mov         rax,rcx
000000014003421B  cmp         rcx,rdx
000000014003421E  je          xmemcpy+21h (140034239h)
0000000140034220  and         r8,r8
0000000140034223  je          xmemcpy+21h (140034239h)
0000000140034225  mov         r9b,byte ptr [rdx]
0000000140034228  mov         byte ptr [rcx],r9b
000000014003422B  dec         r8   
000000014003422E  inc         rcx 
0000000140034231  inc         rdx 
0000000140034234  and         r8,r8
0000000140034237  jne         xmemcpy+0Dh (140034225h)
0000000140034239  ret


I will test it a little bit more before I post it here
Cod-Father

habran

#114
I have uploaded the new version at the beginning of this topic
this new optimization is for counting down to zero
it can be written as single like this "¦ var ¦"  or this "¦ var > 0¦"

I have not changed only this but I changed the concept of whole routine
so that now behaves exactly as C "for" command  :eusa_dance:
Cod-Father

habran

small bug fixed and uploaded new version 8)
hll.c added line 1394:
else hll->codelines = NULLC;    //there is nothing after the second '¦'
the var hll->codelines was not cleared if there was nothing after second '¦'
Cod-Father

habran

Jwasm210 uploaded at the top of this trad
Cod-Father