Author Topic: Miscellaneous snippets  (Read 39173 times)

jj2007

  • Moderator
  • Member
  • *****
  • Posts: 11040
  • Assembler is fun ;-)
    • MasmBasic
Re: Miscellaneous snippets
« Reply #165 on: January 05, 2021, 10:52:02 PM »
I wish to establish whether or not FreeBASIC DOS version can work with in-line assembly (prefer DOS version at this stage but will also consider windows version which I have used a bit).

Would you be able to supply a very simple FreeBASIC program that uses in-line assembly

Richard,

That is a question for the FreeBasic forum. I have never touched FB for DOS, so I cannot give you advice on that, sorry...

jj2007

  • Moderator
  • Member
  • *****
  • Posts: 11040
  • Assembler is fun ;-)
    • MasmBasic
A 14 lines editor
« Reply #166 on: January 15, 2021, 12:34:06 PM »
Note this is the bare minimum - just a demo. No checks, no bells and whistles. Use at your own risk.
Code: [Select]
GuiParas equ "A full-fledged raw Win32 GUI", icon Ball, b Turquoise ; title, icon, background
GuiMenu equ @File, &Open, &Save, -, E&xit, @Edit, Undo, Copy, Paste ; define a menu (only Open & Save are implemented)
include \masm32\MasmBasic\Res\MbGui.asm
  GuiControl RichEdit, "richedit", CL$() ; load what you find in the commandline
  GuiControl Status, "statusbar"
Event Menu
  Switch_ MenuID
  Case_ 0 ; Open (menu entries start with 0)
  If_ FileOpen$("FB sources=*.bas|Includes=*.bi;*.inc|Resources=*.rc|All files=*.*") Then SetWin$ hRichEdit=FileRead$(FileOpen$())
  Case_ 1 ; Save
  FileWrite CL$(), stream:hRichEdit ; save contents of the RichEdit control
  SetWin$ hStatus=CL$()+" was saved"
  Endsw_
GuiEnd
OPT_Arg1 ?:\Masm32\MasmBasic\AscUser\OpenSaveFB.asc ; for testing with RichMasm