Author Topic: MasmBasic  (Read 398576 times)

jj2007

  • Moderator
  • Member
  • *****
  • Posts: 12684
  • Assembler is fun ;-)
    • MasmBasic
Re: MasmBasic
« Reply #555 on: May 20, 2022, 10:12:02 AM »
MasmBasic version 20 May 2022 is online. Significant changes:

- RichMasm handles better the case that you "forgot" an active program, e.g. by not answering to an Inkey ("hit any key"); it will present a MessageBox asking if you want to kill the current instance before building the new version.

- improved cycle count macros:

  include \masm32\MasmBasic\MasmBasic.inc
  Init
  CyCtInit
  CyCtStart
        fldpi
        fmul FP8(100.0)
        fdiv FP4(10.0)
        fstp st
  CyCtEnd PI*100/10             ; describe what the code does
  EndOfCode


- output is e.g. 17 Cycles for PI*100/10
- without description after CyCtEnd, 1,000 individual cycle counts are accessible through the CyCt() DWORD array
- using CyInit store, the counts are saved to the CyCt$() array (see Store for saving the array to disk)

jj2007

  • Moderator
  • Member
  • *****
  • Posts: 12684
  • Assembler is fun ;-)
    • MasmBasic
Re: MasmBasic
« Reply #556 on: May 31, 2022, 06:23:13 PM »
Version 30 May 2022 is online, with several minor improvements, inter alia of NoTag$():

include \masm32\MasmBasic\MasmBasic.inc         ; download
  Init
  FileWrite "test.tab", NoTag$(Clip$())         ; get html from the clipboard, convert to plain text
  ShEx "test.tab"                               ; launch the application associated with *.tab (often Excel)
EndOfCode


Source & exe attached. To test it,
- go to a site that has tables, e.g. https://www.tiobe.com/tiobe-index/ or http://masm32.com/board/index.php?action=stats
- press Ctrl U to see the html source
- press Ctrl A, Ctrl C to copy the source
- launch the attached executable

The output file test.tab will open e.g. in Excel. On my machine, it will look like this:



As you can see, row #5 is slightly off - sometimes the tab files may require some editing. Another example, exported from https://www.stackscale.com/blog/popular-programming-languages-2021/ and imported into M$ Excel:



I attach a sample tab file extracted from WorldoMeters. Most Wikipedia tables should work, too - please inform me if you find one that doesn't. Note it will not work on sites that use scripts to generate tables, such as this World Bank page.

The ancient Internet Explorer used to have the option to export a table; no idea why they abolished it :cool: