Author Topic: MasmBasic  (Read 3408 times)

Mike Lobanovsky

  • Full Member
  • ***
  • Posts: 162
    • View Profile
    • Freestyle BASIC Script Language
Re: MasmBasic
« Reply #15 on: 09. November 2016, 03:35:02 »
Jochen,

I'm greatful for the invitation and also for choosing my avatar for your experimentation (I wish I could do the same in return on the FBSL forum) but I won't run your exe pack on my machines for the reasons I've stated earlier regarding the validity of executable file names and the uncertainty of the outcome of such experimentation from the file system integrity perspective.

I am sorry but that's the point I'm going to stand by, paranoia or schizophrenia, whatever. :)
Mike
____________________________________________________________________________________________
(3.6GHz i5-3470, 16GB RAM / 2 x nVidia GTX 650Ti SLI-bridged, 2GB VRAM / x64 Win 7, x86 elementaryOS Luna)

jj2007

  • Full Member
  • ***
  • Posts: 124
  • MasmBasic rocks
    • View Profile
    • MasmBasic - faster than C
Re: MasmBasic
« Reply #16 on: 09. November 2016, 11:17:58 »
validity of executable file names and the uncertainty of the outcome of such experimentation from the file system integrity perspective.

Mike,

These are absolutely valid Unicode file names. Microsoft takes pride in that, and if a Billion Chinese users had the same fear as you, it would be bad for their business.

At least on my Italian OS, none of these exes had any problems *)

You might check your views on locales. Afaik Windows Explorer doesn't care for locales, it just uses Unicode under the hood, even if it can't display the font. Do you see them in Explorer, actually? I see all file names properly, and I doubt that all these fonts are installed by default.

It is a problem, though, for non-Unicode file managers like my old FreeCommander version. When I double-click the ? ? ? ? ? ? ? ?.exe, nothing happens. However, even then, file integrity problems should be a phenomenon of the very very early days of Windows.

P.S.: I've had a look at MSDN, who confirm what I wrote on the use of Unicode above. There is one notable exception: The use of the Yen symbol in applications that work on FAT filesystems:
Quote
For security reasons, your applications should not typically allow the character U+00A5 in a Unicode string that might be converted for use as a FAT file name.

*) I just tested the PlayingWithUnicode.zip attached above also on a FAT32 USB stick. Everything works like a charm, including saving rotated images in Hindi, Chinese, Russian etc; I did a scandisk afterwards, no problems found.
« Last Edit: 09. November 2016, 13:23:51 by jj2007 »

Mike Lobanovsky

  • Full Member
  • ***
  • Posts: 162
    • View Profile
    • Freestyle BASIC Script Language
Re: MasmBasic
« Reply #17 on: 09. November 2016, 22:03:40 »
This is a "clean" (of all localization packs; LCID=1033) installation of Win 7 Pro Sp1 I'm using for C/C++ development:
Mike
____________________________________________________________________________________________
(3.6GHz i5-3470, 16GB RAM / 2 x nVidia GTX 650Ti SLI-bridged, 2GB VRAM / x64 Win 7, x86 elementaryOS Luna)

jj2007

  • Full Member
  • ***
  • Posts: 124
  • MasmBasic rocks
    • View Profile
    • MasmBasic - faster than C
Re: MasmBasic
« Reply #18 on: 10. November 2016, 02:44:43 »
This is a "clean" (of all localization packs; LCID=1033) installation of Win 7 Pro Sp1 I'm using for C/C++ development:

Thanks, Mike. Weird that Explorer can handle Unicode filenames (the images are loaded etc) but can't display them, while the message boxes have a bad caption but Chinese text is displayed properly. Mysteries of Windows 8)

Mike Lobanovsky

  • Full Member
  • ***
  • Posts: 162
    • View Profile
    • Freestyle BASIC Script Language
Re: MasmBasic
« Reply #19 on: 10. November 2016, 08:42:42 »
Mysteries of Windows 8)

Yeah, there's also absolutely no problem with net browsing either. Prolly all major browsers have their own locale support utils to cover most if not all of the browser page text requests. I wish I knew how to handle those to be able to use them too on the installations that don't support those CPs and fonts officially. ;)
Mike
____________________________________________________________________________________________
(3.6GHz i5-3470, 16GB RAM / 2 x nVidia GTX 650Ti SLI-bridged, 2GB VRAM / x64 Win 7, x86 elementaryOS Luna)

jj2007

  • Full Member
  • ***
  • Posts: 124
  • MasmBasic rocks
    • View Profile
    • MasmBasic - faster than C
Displaying animated GIF images
« Reply #20 on: 26. November 2016, 10:43:56 »
Download update 26 Nov 16:

Inter alia, GuiImage handles now animated GIFs automatically; search \Masm32\MasmBasic\MbGuide.rtf for .MbGui

Example (a complete Windows GUI application with a sizeable window):
Code: [Select]
include \masm32\MasmBasic\Res\MbGui.asm
Event Paint
  GuiImage "http://retrogamecoding.org/board/index.php?action=dlattach;attach=1045;type=avatar", fit
GuiEnd

The more elaborate attached demo displays (provided MasmBasic is installed)
- a static background car.jpg
- an avatar (members only, sorry :biggrin:)
- a smiley (the car needed a little decoration)
- and an animated GIF from the resources

jj2007

  • Full Member
  • ***
  • Posts: 124
  • MasmBasic rocks
    • View Profile
    • MasmBasic - faster than C
Re: MasmBasic
« Reply #21 on: 02. December 2016, 10:14:24 »
MasmBasic update 2 December got several new features (see here for some examples), inter alia the StringToArray function can now be fed with files from disk, from the internet, and with a text file embedded in the resouce section:

include \masm32\MasmBasic\MasmBasic.inc Init
  StringToArray 123, my$()            ; 123 is the resource ID
  For_ ct=0 To Min(39, eax)            ; loop max 40 times
      PrintLine Str$("Line %i\t", ct), my$(ct)
  Next
  Inkey "--- hit any key ---"
EndOfCode

Rsrc            ; when hitting F6, RichMasm exports this section to [filename].rc
123 RCDATA "\\Masm32\\MasmBasic\\MasmBasic.inc"
Rsrc

jj2007

  • Full Member
  • ***
  • Posts: 124
  • MasmBasic rocks
    • View Profile
    • MasmBasic - faster than C
MasmBasic hits the 400 commands mark
« Reply #22 on: 09. November 2017, 09:38:41 »
Version 8 November 2017 is ready to be installed. Changes:

- updated help file, with now 400+ macros documented (also online - use Ctrl F to find commands; but remember the best help option is to use RichMasm, hover over a keyword like Open, then right-click on the word and copy the line that fits your case)

- fDate$() and fTime$() can now take a third parameter to force any language:

include \masm32\MasmBasic\MasmBasic.inc
  Init
  Print "Right now, ", fDate$(0, "dddd dd MMMM yyyy "), fTime$(0, "HH:mm:ss"), Str$(", we are in ISO week %i\n", IsoWeek())
  Print fDate$(0, "dddd dd MMMM yyyy ", russian), fTime$(0, "HH:mm"), Str$(", мы находимся в ИСО неделе %i", IsoWeek())
  wMsgBox 0, wCat$(wfDate$(0, "dddd dd MMMM yyyy ", hindi)+wfTime$(0)), "This is Unicode:", MB_OK
EndOfCode

Output:
Right now, Wednesday 08 November 2017 04:55:26, we are in ISO week 45
среда 08 ноября 2017 04:55, мы находимся в ИСО неделе 45


- SetInt can now move the content of ST(0) to xmm0:
  fldpi
  Print Str$("PI=\t%Jf\n", ST(0))
  fmul FP4(100.0)
  SetInt ecx
  Print Str$("100*PI=\t %i\n", ecx)
  fldpi
  fmul FP8(10.0e16)
  SetInt xmm0
  Print Str$("100*PI=\t %i\n", xmm0)


Code: [Select]
Output:
PI=     3.141592653589793238
100*PI=  314
10e16*PI=314159265358979324

- finally, the ternary operator If? can now also take the Zero? and Carry? flags as input (testbed attached):

  xor ecx, ecx
  Print Str$("zero flag set: %i\txor ecx, ecx\n", If?(zero?, 111, 222))         ; prints first number, 111
  or ecx, -1
  Print Str$("zero flag set: %i\tor ecx, -1\n", If?(zero?, 111, 222))   ; prints second number, 222
  stc
  Print Str$("carry set: %i\tstc\n", If?(Carry?, 111, 222))     ; carry is set, prints 111
  clc
  Print Str$("carry set: %i\tclc\n", If?(Carry?, 111, 222))     ; carry clear, prints 222

B+

  • Sr. Member
  • ****
  • Posts: 436
    • View Profile
Re: MasmBasic
« Reply #23 on: 09. November 2017, 19:19:37 »
Hi JJ,

Congratulations! How do you count it when macro name is same but has optional parameter, one or two?

jj2007

  • Full Member
  • ***
  • Posts: 124
  • MasmBasic rocks
    • View Profile
    • MasmBasic - faster than C
Re: MasmBasic
« Reply #24 on: 10. November 2017, 00:48:57 »
Then it's normally one macro only. However, the wide versions (wOpen, wPrint, ...) count as separate macros.