Author Topic: .FOR built in JWasm  (Read 32692 times)

habran

  • Member
  • *****
  • Posts: 1107
    • uasm
Re: .FOR built in JWasm
« Reply #105 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"
or "MbCopy   PROTO :DWORD, :DWORD, :DWORD" ? ;)
Cod-Father

habran

  • Member
  • *****
  • Posts: 1107
    • uasm
Re: .FOR built in JWasm
« Reply #106 on: February 09, 2013, 11:45:07 PM »
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)
« Last Edit: February 10, 2013, 05:39:42 AM by habran »
Cod-Father

jj2007

  • Member
  • *****
  • Posts: 7558
  • Assembler is fun ;-)
    • MasmBasic
Re: .FOR built in JWasm
« Reply #107 on: February 10, 2013, 04:24:55 AM »
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

  • Member
  • *****
  • Posts: 1107
    • uasm
Re: .FOR built in JWasm
« Reply #108 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 ;)
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

  • Member
  • *****
  • Posts: 7558
  • Assembler is fun ;-)
    • MasmBasic
Re: .FOR built in JWasm
« Reply #109 on: February 10, 2013, 06:28:52 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

  • Member
  • *****
  • Posts: 1107
    • uasm
Re: .FOR built in JWasm
« Reply #110 on: February 10, 2013, 09:05:17 AM »
That's what I pointed out
How can we admire your beautiful masm when all we see is BASIC($&@/!?%#¥€£~^*) :dazzled:
Cod-Father

jj2007

  • Member
  • *****
  • Posts: 7558
  • Assembler is fun ;-)
    • MasmBasic
Re: .FOR built in JWasm
« Reply #111 on: February 10, 2013, 10:34:23 AM »
 :biggrin:

habran

  • Member
  • *****
  • Posts: 1107
    • uasm
Re: .FOR built in JWasm
« Reply #112 on: February 10, 2013, 01:27:21 PM »
 8) :bgrin: :t :biggrin:
Cod-Father

habran

  • Member
  • *****
  • Posts: 1107
    • uasm
Re: .FOR built in JWasm
« Reply #113 on: February 17, 2013, 06:44:31 PM »
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:
Code: [Select]
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:
Code: [Select]
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
« Last Edit: February 18, 2013, 04:56:48 PM by habran »
Cod-Father

habran

  • Member
  • *****
  • Posts: 1107
    • uasm
Re: .FOR built in JWasm
« Reply #114 on: February 18, 2013, 08:22:44 AM »
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:
« Last Edit: February 18, 2013, 04:51:30 PM by habran »
Cod-Father

habran

  • Member
  • *****
  • Posts: 1107
    • uasm
Re: .FOR built in JWasm
« Reply #115 on: March 03, 2013, 03:15:02 PM »
small bug fixed and uploaded new version 8)
hll.c added line 1394:
Code: [Select]
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

  • Member
  • *****
  • Posts: 1107
    • uasm
Re: .FOR built in JWasm
« Reply #116 on: April 21, 2013, 06:14:03 AM »
Jwasm210 uploaded at the top of this trad
Cod-Father