News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

.FOR built in JWasm

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

Previous topic - Next topic

habran

thank you jj2007
QuotePrint Str$(ecx), " "   ; MasmBasic preserves ecx
does it mean it does this?:

                push ecx
print str$(ecx)," "
                pop ecx
Cod-Father

jj2007

Quote from: habran on November 06, 2012, 06:41:24 PM
does it mean it does this?:

                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

#32
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:
Cod-Father

jj2007

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

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

Quote from: habran on November 07, 2012, 06:14:36 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

Hi jj,
QuoteWin-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

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

I have done what nidud was asking for
now it is possible to call C functions like


    .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

added possibility to use 'a'  characters like:

  .for (al = 'h'¦al < 's'¦al++)


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

habran

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

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

There was a bug in the code "ForInitAndNext()" :icon_redface:
it is fixed now 8)

Cod-Father

habran

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

this time I used the MORTEIN :badgrin:
no more bugs!!!
Cod-Father