News:

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

Main Menu

Hello from an absolute beginner

Started by brazer, January 15, 2023, 04:40:09 AM

Previous topic - Next topic

NoCforMe

Well, JJ, if I ever "migrate" to 64-bit (not bloody likely, but who knows?), I'll be sure to look at macros. Until then, thanks but no thanks.
Assembly language programming should be fun. That's why I do it.

NoCforMe

Quote from: brazer on January 21, 2023, 06:23:33 AM
Quote from: daydreamer on January 20, 2023, 11:18:26 PM
for example messagebox call with chr$,ustr$ in one long line is my preferred coding style vs in editor scroll up to write in .data section for strings+other variables,scrolll down to write in .code is * many times

I suppose an editor with a "split window" feature won't change your mind? :icon_idea:

You, my friend, have hit the nail squarely on the head. Yes, a split-screen editor would be just the ticket.

And if anyone scoffs, that's exactly what I used to have with MultiEdit, a windowed editor for DOS that was just spectacular. Split windows, vertical or horizontal; select vertical blocks of text as well as horizontal; powerful macro language (oops, macros) that made it fully extensible. Lots more stuff (regular expression search and replace, etc.). I miss it. I still have it on my hard drive, but it no longer runs as of Windows 7. (It still ran under XP.) R.I.P.
Assembly language programming should be fun. That's why I do it.

jj2007

Quote from: NoCforMe on January 21, 2023, 08:48:07 AMYes, a split-screen editor would be just the ticket.

Feasible, absolutely - just select some text and hit Ctrl F12. Or implement it in your own editor - it's fun :thumbsup:

However, separating code and text is still very clumsy, and difficult to read. Who knows why almost nobody uses that in any HLL, The Microsoft Macro Assembler (MASM) included.


hutch--

Hi David,

You may like this design and you don't have to use a 2 step dispatcher. This is in 64 bit but you can do the same in 32 bit MASM. Advantage is each sequential item is a code block using an exit anonymous label. (@@:).

; ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤

    include \masm64\include64\masm64rt.inc

    .code

; ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤

entry_point proc

    LOCAL var   :QWORD

    mov var, 16

    cmp var, 10
    jne @F
      conout "10 chosen",lf
  @@:

    cmp var, 12
    jne @F
      conout "12 chosen",lf
  @@:

    cmp var, 14
    jne @F
      conout "14 chosen",lf
  @@:

    cmp var, 16
    jne @F
      conout "16 chosen",lf
  @@:

    cmp var, 18
    jne @F
      conout "18 chosen",lf
  @@:

    waitkey
    .exit

entry_point endp

; ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤

    end

jj2007

Hutch,

When will you add a 64-bit version of \Masm32\examples\exampl07\slickhuh\slickhuh.asm to the SDK?

NoCforMe

JJ, I just took a look at that example.

Yuck. That's got to be one of the most horrible pieces of code I've ever seen. Unless it's supposed to be a joke. What's so "slick" about it?

[after reading readme.txt]
OK, I get it, I GET IT. I wasn't wrong up there, but it warn't no great revelation neither. Nevermind ...
Assembly language programming should be fun. That's why I do it.

hutch--

David,

You got it right, YUK but the amount of deliberately obscure code that used to be around needed a response. In the minds of those who produce crap like that, Slick Huh !

jj2007

Quote from: NoCforMe on January 21, 2023, 09:11:51 PMWhat's so "slick" about it?

This is almost true bare metal code. Real MenTM can improve it by poking their ideas directly into memory, like this:

    call lsc
.radix 16
dq 0C700000030A045C7
dd 3A445
dw 0
.radix 10
    mov DWORD PTR [ebp-88], OFFSET wpep


Btw these simplified .code, .data etc directives for n00bs can be easily replaced with true segment definitions:

    includelib \masm32\lib\user32.lib
.code
    ims db "Slick Huh ?", 0


    includelib \masm32\lib\user32.lib
MyCode SEGMENT DWORD PUBLIC 'CODE'
    ims db "Slick Huh ?", 0

raymond

A little late from me, but welcome to assembler Brazer.

Quote from: brazer on January 19, 2023, 09:28:24 AM
Assembly is attractive, I'm not really sure why didn't I learn it before but there was and still is a lot of people telling that assembly isn't a thing because you can't defeat compiler and similar excuses.
I guess I was affected by such statements so I never took a look at asm myself but I do realize now there are 2 conflicting world views between assembly coders and HLL coders, at least when it comes to pushing
personal opinions upon others.

So in the end I guess I'll be using assembly in combination with HLL to optimize portions of code and to boost skills overall but nothing serious or big.

The one major reason for me to use assembler in it's power to do almost anything you could expect a computer could do. If you ever get into such an argument, challenge the other person to write a small program to extract the square root of 123456789.987654321 (or anything similar) with the accuracy of 9,999 decimal digits and display the answer on the screen!

If you should doubt such feasibility but you may be curious, I suggest you go to ray.masmcode.com, then to the "Binary Coded Decimals" section at the bottom of the page. There, download the BCDtut where you will find a folder named WINSQR containing a small program which you can use to perform the above challenge.
(BTW, I had written such a program some 40+ years ago on a TRS-80 having a total memory of 64kb. Such is the power of assembly.)

On a separate subject, if you ever delve into writing a program requiring extensive use of floating point maths, significant improvement in the speed of execution can be obtained with assembly. Compared to the use of HLLs, the gains are generally obtained by a possible significant reduction of memory access; with 8 FPU registers, a lot of intermediate results can be retained directly inside the FPU instead of being transfered back and forth between the FPU and memory. While on the above site, you can also have a peek at the "Complex Numbers" section and download the WMANJUL folder. It contains a program generating the Mandelbrot fractal which makes a VERY intensive use of the FPU.

(My pet peeve against Microsoft is the fact that many very useful programs have been produced in the past and provided with a help file .HLP based on Microsoft's design. The support for the use of such files has been dropped entirely as of WINDOWS10. The help file in the above downloaded folder will thus be entirely useless; however, a pop-up help will appear with the F1 key at any time to indicate which key will perform which operation. Enjoy. Full screen is more enjoyable.)
Whenever you assume something, you risk being wrong half the time.
http://www.ray.masmcode.com

jj2007

Quote from: raymond on January 22, 2023, 09:02:46 AMThe support for the use of such files has been dropped entirely as of WINDOWS10

Raymond,

It is sufficient to copy the WinHlp32.exe from an older Windows version to a folder of your choice. It will run just fine on Win10. Make a test with the attachment, and promise to delete it soon, as it is copyrighted ;-)

hutch--


raymond

Quote from: jj2007 on January 22, 2023, 09:09:16 AM
It is sufficient to copy the WinHlp32.exe from an older Windows version to a folder of your choice. It will run just fine on Win10. Make a test with the attachment, and promise to delete it soon, as it is copyrighted ;-)

Believe it or not but I got the following message when I tried to download it:
         winhlp32.zip
Failed - Virus detected

:joking: :joking: :joking: :joking: :eusa_boohoo: :eusa_boohoo: :eusa_boohoo: :eusa_boohoo:
:greenclp: :greenclp: :greenclp: :greenclp: :skrewy: :skrewy: :skrewy: :skrewy:      :icon_idea:
Whenever you assume something, you risk being wrong half the time.
http://www.ray.masmcode.com

jj2007

Funny. Which AV are you using?

https://www.virustotal.com/gui/file/33068a8a5f8f61683b7412e9c2b5730beb12ca0d6f2ebda502ecfd56433edba1?nocache=1

QuoteNo security vendors and no sandboxes flagged this file as malicious

hutch--

AV scanners are getting worse, I checked the details of some false positives and they were rejecting some executable file on the basis of Android phone trojans.

For Ray, try the link in the forum I mentioned, Jim Giordano's package has always worked well here.

raymond


<Funny. Which AV are you using?>

I'm using a ThinkPad laptop which was given to me about 10 years ago, initially with Win7 installed. I have upgraded up to Win10 whenever an upgrade was offered. I think the AV is Windows Defender which came with upgrades.
Whenever you assume something, you risk being wrong half the time.
http://www.ray.masmcode.com