Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - jj2007

Pages: [1] 2 3 ... 11
1
Offtopic / Re: Stack Overflow Developer Survey 2019
« on: 22. April 2019, 13:50:35 »
Visual Basic is the most dreaded one (followed by Objective-C and Assembly)

Glad to see that my favourite language goes strong in at least one category :)

2
Community news and announcements / Re: MasmBasic
« on: 02. April 2019, 04:47:24 »


Source (67 lines of code) and data are attached; building requires MasmBasic version 2 April 2019 or later, plus the Masm32 SDK

3
Offtopic / Re: mini Linux distros
« on: 16. January 2019, 04:43:40 »
Linux is actually an interesting concept: You don't install an application as you would do in Windows. Instead, you download the source and compile it to install it. If the respective toolchain (C++?) for the 300+ Linux versions is compatible with all application sources, the concept could work just fine.

4
Offtopic / Re: M.C.
« on: 24. December 2018, 10:38:25 »
Happy Xmas, a Merry New Year and Basic Wishes to all of you ;-)

5
Community news and announcements / Re: MasmBasic
« on: 28. November 2018, 13:35:41 »
News from the MasmBasic subforum:



The source (requires the Masm32 SDK plus the MasmBasic library):

GuiParas equ "Plot sinus & cosinus curves", x600, y100, w600, h500, bRgbCol(192, 255, 255)
include \masm32\MasmBasic\Res\MbGui.asm
  Dim MySinus() As REAL4                       ; REAL4 precision is enough ...
  Dim MyCosinus() As REAL8                     ; ... but REAL8 is ok, too
  For_ ecx=0 To 359
        SetFloat MySinus(ecx)=Sinus(ecx)       ; fill an array
        SetFloat MyCosinus(ecx)=Cosinus(ecx)   ; you may use ArrayRead for reading data from a file
  Next
  MakeFont hHorzFont, Height:18, Weight:FW_SEMIBOLD, Italic:TRUE
  MakeFont hVertFont, Height:18, Weight:FW_SEMIBOLD, Escapement:900, Italic:FALSE
  MakePen hPenAxis, RgbCol(255, 0, 0)
  MakePen hPenGrid, RgbCol(255, 255, 222), width 2
  SetAxisX "degrees", s 0, d 15.0/3, grid 1, penx hPenAxis, peng hPenGrid, font hHorzFont, format "%i" ; s=start value, d=difference between gridlines
  SetAxisY "sinus & cosinus", s -1, d 0.2/5, grid 2, font hVertFont, format "%2f"
  $Data "Plotting an array of points is very easy: All you need is the array itself, plus a Paint event that draws it."
  $Data "The axes can be set using SetAxisX and SetAxisY, taking arguments as shown in the source. Now resize this window to see how it behaves"
  Read desc$()                          ; read a string array from $Data
  Event Paint
  ArrayPlot MySinus(), RgbCol(255, 222, 160), 2, 00000110h, 0, -1, 1    ; red sinus, 2px wide; use margins left top right bottom, min0, max-1, filled=1 ArrayPlot MyCosinus(), RgbCol(0, 0, 255)             ; plot the cosinus array in blue, same margins as previous plot
  ArrayPlot exit, 0150006028# "Sinus & Cosinus"        ; finish with a title; optional: xxxxyyyyFF#: x, y pos, font size
  GuiTextBox 12, 100.0-80, 440, 66, Join$(desc$(), " "), bcol RgbCol(192, 255, 192)
  GuiEnd


Project attached. To build it, open the *.asc file in \Masm32\MasmBasic\RichMasm.exe and hit F6.

6
Community news and announcements / Re: X11 to Droid
« on: 28. October 2018, 09:47:57 »
I notice that programming on an Android phone is still very cumbersome.

9 Best Bluetooth keyboards you can currently buy

7
Offtopic / Re: compilers101
« on: 22. October 2018, 03:56:36 »
why your richmasm is not standalone ?

RichMasm is a standalone editor :)

8
Offtopic / Re: compilers101
« on: 20. October 2018, 19:51:29 »
you know with that amount of code I expect totally new assembler/compiler/linker

The totally new assembler is here. RichMasm is an editor, and a very special one. If you deal with a 30,000+ lines source, RichMasm offers some great functionality. Inter alia, I use it also to build my BASIC, C and Pascal sources. I would never use one of those toy editors for a complex task ;)

9
Offtopic / Re: compilers101
« on: 20. October 2018, 03:36:26 »
how to build code editor in less than 1000lines

That's exaggerated, 26 lines should be enough:

GuiMenu equ @Files, &New..., &Open..., &Save, &Build, -, E&xit, @Edit, Cut, Copy, Paste, @Options, Settings, @Help, &About
GuiParas equ "Editor demo", x100, y50, w900, h600      ; menu and paras are optional, if omitted, title is filename
include \masm32\MasmBasic\Res\MbGui.asm         ; part of MasmBasic
GuiControl MyEdit, "RichEdit", wCL$(), font -16        ; use Unicode commandline and a big font (use MakeFont for special needs)
GuiControl MyStatus, "statusbar", "Ready, Готовы, 準備, ..."

Event Menu
  Switch_ MenuID
  Case_ 0: SetWin$ hMyEdit=0    ; pass a nullpointer to clear the control
  Case_ 1
        .if wFileOpen$("Unicode text=*.txu|Plain text=*.txt|Rich text=*.as?;*.rtf|All files=*.*", "Select a file", "Добро_пожаловать.txu")
               SetWin$ hMyEdit=wFileRead$(wFileOpen$())        ; do not use wSetWin$
        .endif
  Case_ 2
        .if FileSave$("Plain text=*.txt|Rich text=*.as?;*.rtf|All files=*.*")
                .if MbOfn.nFilterIndex==2
                                FileWrite FileSave$(), stream:hMyEdit   ; rich text
                .else
                                FileWrite FileSave$(), Win$(hMyEdit)    ; normal text
                .endif
        .endif
  Case_ 3
        FileWrite "tmpBuild.asm", Win$(hMyEdit)
        Launch Cat$("build.bat tmpBuild.asm"
  Case_ 4 .. 9
        MsgBox 0, Str$("Menu #%i not yet implemented", MenuID), "Hi", MB_OK
  Endsw_
GuiEnd


It depends a bit on your needs, of course: RichMasm is a bit over 20,000 lines now ;)

10
Code and examples / Re: Floyd's Triangle
« on: 18. October 2018, 05:57:22 »
It wasn't about speed, readability was the last thing I was concerned about and I didn't really care about the beauty of the output. ... but it was fun.

You should add it to the Rosetta code Ruby example. Your coding style is certainly different from mine, but when I saw your one-liner, my first thought was WOW!  ;)

@Mike: No, that was no waste of time. Tomaaz impressed you and me, and he had fun.

11
Code and examples / Re: Floyd's Triangle
« on: 17. October 2018, 22:41:34 »
Version 1, a smooth triangle (but not exactly what the Rosetta specs ask for):

include \masm32\MasmBasic\MasmBasic.inc         ; download
  SetGlobals rows, columns, ct
  Init
  For_ rows=0 To 19
        For_ columns=0 To rows
                inc ct
                Print Str$("%__i ", ct)
        Next
        Print
  Next
  Inkey
EndOfCode


Code: [Select]
  1
  2   3
  4   5   6
  7   8   9  10
 11  12  13  14  15
 16  17  18  19  20  21
 22  23  24  25  26  27  28
 29  30  31  32  33  34  35  36
 37  38  39  40  41  42  43  44  45
 46  47  48  49  50  51  52  53  54  55
 56  57  58  59  60  61  62  63  64  65  66
 67  68  69  70  71  72  73  74  75  76  77  78
 79  80  81  82  83  84  85  86  87  88  89  90  91
 92  93  94  95  96  97  98  99 100 101 102 103 104 105
106 107 108 109 110 111 112 113 114 115 116 117 118 119 120
121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136
137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153
154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171
172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190
191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210

Version 2, strictly following the spacing specs:

include \masm32\MasmBasic\MasmBasic.inc         ; download
  SetGlobals rows, columns, ct
  Init
  round=0
  repeat 2
        Clr ct
        For_ rows=0 To 4+9*round
                For_ columns=0 To rows
                                inc ct
                                Print Str$("%__i", ct)
                                .if columns>6
                                        Print " "
                                .endif
                Next
                Print
        Next
        Print
        round=round+1
  endm
  Inkey
EndOfCode


Code: [Select]
  1
  2  3
  4  5  6
  7  8  9 10
 11 12 13 14 15

  1
  2  3
  4  5  6
  7  8  9 10
 11 12 13 14 15
 16 17 18 19 20 21
 22 23 24 25 26 27 28
 29 30 31 32 33 34 35 36
 37 38 39 40 41 42 43 44  45
 46 47 48 49 50 51 52 53  54  55
 56 57 58 59 60 61 62 63  64  65  66
 67 68 69 70 71 72 73 74  75  76  77  78
 79 80 81 82 83 84 85 86  87  88  89  90  91
 92 93 94 95 96 97 98 99 100 101 102 103 104 105

12
General questions and discussions / Re: Yabasic
« on: 15. October 2018, 01:38:14 »
So the same goes for required typing of variables by suffix or DIM

Over the years I find that the ThisIsText$ suffix is really helpful for the readability of code. The C/C++ gang find it unprofessional, and produce lots of buggy code, he he >:(

Dim is OK for arrays, but I find it annoying to dim a simple integer. OTOH it can help to avoid bugs that creep in with typos, like confusing MyVar with My_Var etc.; the old defunct GfaBasic had an excellent solution for this problem: If you typed MyVar=123, it asked if you wanted to create that variable. Sure, I want that. And if some pages further down you typed My_Var=456, it asked you again ... oops! Almost foolproof, and no Dim required.

13
General questions and discussions / Re: Yabasic
« on: 13. October 2018, 09:49:30 »
I suspect it's popular because it's beginner-friendly...

14
Here are the specs. Lachie Dazdarian from Croatia has launched that competition. Aurel, do you know him?

15
Community news and announcements / Re: X11 to Droid
« on: 09. October 2018, 22:46:54 »
Maybe you want to have a look into the GFA-BASIC 32 for Windows

I have programmed for over a decade with the 16-bit Windows version, a great dialect - unfortunately its author was not interested in porting it to 32-bit. I vaguely remember that Hamstra's product is horribly bloated and slow, and not at all compatible with the 16-bit version. That's why I develop MasmBasic ;)

P.S.: I've given Gfa32 a chance. The interpreter runs fine, the compiler compiles, but the exe complains that it can't find GfaWin23.Ocx, a one MByte runtime which happens to be hidden away in gb32\Bin\GfaWin23.Ocx. And no, the name is not a typo of mine, it's really GfaWin23 8)

253 sample files, and none of them contains the term string array. GfaBasic 16's most useful command, Recall, is implemented but no example available; ok, the manual has one, and it works if you know beforehand how many strings the text file has. MasmBasic Recall has dynamic arrays, and is over a factor 7 faster than Gfa32.

Pages: [1] 2 3 ... 11