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

habran

  • Member
  • *****
  • Posts: 1116
    • uasm
Re: .FOR built in JWasm
« Reply #30 on: November 06, 2012, 06:41:24 PM »
thank you jj2007
Quote
Print Str$(ecx), " "   ; MasmBasic preserves ecx
does it mean it does this?:
Code: [Select]
                push ecx
print str$(ecx)," "
                pop ecx
Cod-Father

jj2007

  • Member
  • *****
  • Posts: 7756
  • Assembler is fun ;-)
    • MasmBasic
Re: .FOR built in JWasm
« Reply #31 on: November 06, 2012, 09:26:04 PM »
does it mean it does this?:
Code: [Select]
                push ecx
print str$(ecx)," "
                pop ecx

Print/Inkey and Str$() are more complex than their Masm32 counterparts. Inter alia, you can Print several Str$() in the same line (more):

include \masm32\MasmBasic\MasmBasic.inc   ; download
  Init
  fn SetCurrentDirectory, "\Masm32\include\"
  Inkey Str$("Size of Windows.inc=\t%i bytes", Lof("Windows.inc")), Str$("\nSize of WinExtra.inc=\t%4f MB", Lof("WinExtra.inc")/1024/1024)
  Exit
end start

Size of Windows.inc=    977412 bytes
Size of WinExtra.inc=   1.019 MB


You can even print Chinese and Arabic text to the console with MasmBasic Print, if the fonts are available on your machine.

habran

  • Member
  • *****
  • Posts: 1116
    • uasm
Re: .FOR built in JWasm
« Reply #32 on: November 06, 2012, 10:36:55 PM »
hey jj2007 :biggrin:
thank you for your info
I have looked through your macros and I appreciate your work :eusa_clap:
I know how much effort and knowledge and patience was needed to create it
However, I newer tested it because I don't do 32 bits any more, I don't want to go back to 4 registers and I despise BASIC sins C64
I love assembler
I love 64 bits and 7 nonvolatile registers, they make such a great advantage and ease in programming and, of course speed
I love new horizons, new technology
I enjoy remembering the past but I don't wont to go back

best regards :biggrin:
« Last Edit: December 01, 2012, 11:48:17 PM by habran »
Cod-Father

jj2007

  • Member
  • *****
  • Posts: 7756
  • Assembler is fun ;-)
    • MasmBasic
Re: .FOR built in JWasm
« Reply #33 on: November 07, 2012, 04:18:19 AM »
hi habran,

64-bit certainly is the future, but 32-bit will be around for a long while. I am still using 16-bit apps, even on a Win7-64 system in a VM.

As to speed, it still has to be proven that 64-bit apps are faster. You rarely run out of registers, especially in fast innermost loops that won't call slow Win APIs. And 64-bit code eats up cache, so on balance it's hard to prove that 64-bit code is "faster". Of course, there will be quite a number of applications that can be done faster, e.g. for videos or image processing.

But the transition 32->64 cannot be compared to the (still incomplete) 16->32 bit transition. When porting 16-bit code to 32 bits, you get a huge speedup, and the address space jumps from a tiny 65K to 4 gigs. To visualise that step: a typical 500*600 pixel JPG fits into 65k (so 16 bits of address space are indeed a little bit tight :(). The largest Hubble image so far is 15852*12392 pixel, that requires a 3x2.5 meter screen. To fill the 4 gigs of 3-bit mode address space, you need a 180x150 meter screen. I can afford my notebook, but I cannot afford a screen as large as two football camps...

Now try convincing me that two football camps are not enough ;-)

habran

  • Member
  • *****
  • Posts: 1116
    • uasm
Re: .FOR built in JWasm
« Reply #34 on: November 07, 2012, 06:14:36 AM »
Hey jj2007
Did I say that YOU should do this or that? :shock:
Why would I do that?
I have no desire to convince YOU to anything, you are grown up person
able  to make your own decision
have look what I wrote: I, I, I, I, I ...
I can not expect everyone to think as I do
this world would be boring that way
everyone has got right to live in they own delusion
Imagine this forum, you write a post like:
"Hey guys, I think that farting should be done loudly" ;)
and everyone writes:
"Way to go jj" :biggrin:

have a nice day jj2007 :biggrin: :biggrin:
Cod-Father

jj2007

  • Member
  • *****
  • Posts: 7756
  • Assembler is fun ;-)
    • MasmBasic
Re: .FOR built in JWasm
« Reply #35 on: November 07, 2012, 07:31:41 AM »
Hey jj2007
Did I say that YOU should do this or that? :shock:

Hey habran,
Did I say that YOU should go back to Win-32? :shock:

 ;)

Win-32 and Win-64 will peacefully co-exist for a long time, and so will their respective fans :biggrin:

have a nice day habran :icon14:

habran

  • Member
  • *****
  • Posts: 1116
    • uasm
Re: .FOR built in JWasm
« Reply #36 on: November 08, 2012, 06:28:43 AM »
Hi jj,
Quote
Win-32 and Win-64 will peacefully co-exist for a long time, and so will their respective fans
nicely said :t
If you really said that:
Quote
"Hey guys, I think that farting should be done loudly"
I would disagree with you and write:
It should be done Incognito, silent-violently to make people suffer  :icon_redface:
Suffering refines human souls  :badgrin:
 ;)

Cod-Father

habran

  • Member
  • *****
  • Posts: 1116
    • uasm
Re: .FOR built in JWasm
« Reply #37 on: November 16, 2012, 01:06:40 PM »
I have fixed some more bugs and refined the source 8)

I am planing some more improvements ;)

I know that you are looking backward to it so I will hurry up :greenclp:

I like to see disappointment in human eyes, that makes me a winner :badgrin:
and, of course, a greener :biggrin:
Cod-Father

habran

  • Member
  • *****
  • Posts: 1116
    • uasm
Re: .FOR built in JWasm
« Reply #38 on: November 21, 2012, 12:31:33 AM »
I have done what nidud was asking for
now it is possible to call C functions like

Code: [Select]
    .for (ebx = strlen(ADDR src)¦memcmp(ADDR src,ADDR dest,count)¦ebx-=2)
;or   
    .for (ebx = 24¦ebx >= strlen(ADDR src)¦ebx-=2)

and it is possible to use OFFSET or ADDR

thanks nidud for the idea :t

it would be possible to make it the same for .IF and .WHILE :eusa_dance:

and I think that it would be great to have all this available :icon_cool:

my mom always told me "To have more doesn't hurt if it is not a pain by itself"



Cod-Father

habran

  • Member
  • *****
  • Posts: 1116
    • uasm
Re: .FOR built in JWasm
« Reply #39 on: November 27, 2012, 06:02:19 PM »
added possibility to use 'a'  characters like:
Code: [Select]
  .for (al = 'h'¦al < 's'¦al++)

you can use any character except '¦'
Cod-Father

habran

  • Member
  • *****
  • Posts: 1116
    • uasm
Re: .FOR built in JWasm
« Reply #40 on: December 12, 2012, 11:35:54 PM »
changed to 209
fixed some issues with && and ||

this is the "final destination"
I will not do it any more :eusa_naughty:

if someone want to continue they can use the source and implement it  :eusa_boohoo:


 
Cod-Father

habran

  • Member
  • *****
  • Posts: 1116
    • uasm
Re: .FOR built in JWasm
« Reply #41 on: December 26, 2012, 09:10:20 PM »
OK, I lied! :icon_mrgreen:

I have improved and reduced the conditional branch totally so that it is now using "EvaluateHllExpression()"
instead of parsing it myself
now is the conditional branch working the same way as ".while" so you can use it exactly the same as it
it looks like that you write: .for (i=0¦.while i<20¦i++) but without .while like this: .for (i=0¦i<20¦i++)
initially, when I started this I wanted to do this but I was not familiar enough with JWasm to be able to do that

now you can not use it any more like this:
    .for (ebx = strlen(ADDR src)¦memcmp(ADDR src,ADDR dest,count)¦ebx-=2)
but like this:
    .for (ebx = strlen(ADDR src)¦ebx>=40¦ebx-=2)

 8)
Cod-Father

habran

  • Member
  • *****
  • Posts: 1116
    • uasm
Re: .FOR built in JWasm
« Reply #42 on: December 27, 2012, 07:33:42 PM »
There was a bug in the code "ForInitAndNext()" :icon_redface:
it is fixed now 8)

Cod-Father

habran

  • Member
  • *****
  • Posts: 1116
    • uasm
Re: .FOR built in JWasm
« Reply #43 on: December 28, 2012, 05:56:49 PM »
Actually,  there were two bugs  :icon_redface:
it was not my fault, the bug was hiding in the hole but I crushed it :badgrin:
now there is none (I hope so) :biggrin:
Cod-Father

habran

  • Member
  • *****
  • Posts: 1116
    • uasm
Re: .FOR built in JWasm
« Reply #44 on: January 09, 2013, 09:01:25 PM »
this time I used the MORTEIN :badgrin:
no more bugs!!!
Cod-Father