News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

Recent posts

#1
MasmBasic & the RichMasm IDE / Re: Silly question
Last post by daydreamer - May 20, 2024, 11:54:37 PM
I agree on annoying spaghetti code,gosub 2000 for example but compiled its might instead hidden on different call memory address 2000 instead
Small text has pre computer solution : reading glasses,but if you are lucky someone has scanned in all old computer magazines that had basic code as PDF
#2
MasmBasic & the RichMasm IDE / Re: Silly question
Last post by jj2007 - May 20, 2024, 11:14:30 PM
Quote from: FORTRANS on May 20, 2024, 10:27:06 PMWell, that book has seventy to eighty odd more of the same ilk.

It was actually a short period before structured BASIC arrived, but long enough to destroy BASIC's reputation forever.
#3
MasmBasic & the RichMasm IDE / Re: Silly question
Last post by FORTRANS - May 20, 2024, 10:27:06 PM
Hi Jochen,

Quote from: jj2007 on May 20, 2024, 08:18:43 AMI must say that the *.bas code is a really ugly example of spaghetti code - it hurts the eye.

   Well, that book has seventy to eighty odd more of the same ilk.
Not to mention using rather small text.  That hurts my eyes.

Cheers,

Steve
#4
16 bit DOS Programming / Re: Line Drawing
Last post by FORTRANS - May 20, 2024, 10:19:28 PM
Hi Tim,

Quote from: tda0626 on May 20, 2024, 07:18:05 AMIn any case, I think my next step is to treat each quadrant in its own routine and to get that working.

   The last time I tried coding a general purpose line drawing routine,
I wrote code for the four quadrants, horizontal lines, vertical lines,
and the two diagonal lines.  Those last four could be coded up rather
easily, and could be faster than a general purpose line drawing routine.

Regards,

Steve
#5
CoderStudio / Re: Listing the exports of a D...
Last post by greenozon - May 20, 2024, 06:12:54 PM
 hMod = LoadLibrary("kernel32.dll");


this statement might return NULL
so not checking for this might hard hit the app...
just in case :)

PS I know the chance of getting NULL is 0.0001% but who knows
#6
MasmBasic & the RichMasm IDE / BASIC: ON someval GOTO line100...
Last post by jj2007 - May 20, 2024, 09:58:56 AM
Just for fun, and inspired by Steve's GW-BASIC thread, I made two new macros mimicking BASIC's ON someval GOTO 100, 200, 300 command (ecx is the index):

.code
p0:
  deb 4, "P0", eax
  retn
p1:
  deb 4, "P1", eax
  retn
...
g0:
  deb 4, "G0", eax
  jmp @back
g1:
  deb 4, "G1", eax
  jmp @back
...

  For_ ecx=0 To 2
    lea eax, [ecx+100]        ; pass a value in eax
    OnIndexCall ecx, p0, p1, p2
  Next
  For_ ecx=0 To 2
    lea eax, [ecx+1000]        ; pass a value in eax
    OnIndexGoto ecx, g0, g1, g2
    @back:
  Next

Output:
P0      eax             100
P1      eax             101
P2      eax             102
G0      eax             1000
G1      eax             1001
G2      eax             1002

Source attached. ON ... GOTO ... is not the most beautiful command, but it can actually be handy.
#7
The Campus / Re: GLOBAL Structure
Last post by sudoku - May 20, 2024, 09:55:00 AM
#8
The Campus / Re: GLOBAL Structure
Last post by Davis - May 20, 2024, 09:54:30 AM
thnx 4 the help
#9
16 bit DOS Programming / Re: Line Drawing
Last post by NoCforMe - May 20, 2024, 09:20:36 AM
Quote from: tda0626 on May 20, 2024, 07:18:05 AMIt might be a case of inverting the the y by subtracting the y given from the y max value but don't know if I want to go that far. We will see.
If you do, the formula would be really simple:
Yactual = -YCartesian + Ymax

#10
The Campus / Re: GLOBAL Structure
Last post by NoCforMe - May 20, 2024, 09:13:45 AM
Sudoku said it right.
Since you're asking about local vs. global, here's a convention I follow so I can immediately tell from looking at one of my variables whether it's global or local:
; Define a global structure (WC), partially initialized:
WC WNDCLASSEX < SIZEOF WNDCLASSEX, \
CS_HREDRAW or CS_VREDRAW or CS_BYTEALIGNWINDOW or CS_DBLCLKS, \
NULL, \ ;lpfnWndProc
NULL, \ ;cbClsExtra
NULL, \ ;cbWndExtra
NULL, \ ;hInstance
NULL, \ ;hIcon
NULL, \ ;hCursor
NULL, \ ;hbrBackground
NULL, \ ;lpszMenuName
NULL, \ ;lpszClassName
NULL > ;hIconSm

; Now define a local structure (wc) in a subroutine:
SomeProc PROC
LOCAL wc:WNDCLASSEX

I start all LOCAL vars. with lowercase letters and all globals with Uppercase letters.
Works well for me; I recommend it.