Export thread

  • SpinRite v6.1 Release #3
    Guest:
    The 3rd release of SpinRite v6.1 is published and may be obtained by all SpinRite v6.0 owners at the SpinRite v6.1 Pre-Release page. (SpinRite will shortly be officially updated to v6.1 so this page will be renamed.) The primary new feature, and the reason for this release, was the discovery of memory problems in some systems that were affecting SpinRite's operation. So SpinRite now incorporates a built-in test of the system's memory. For the full story, please see this page in the "Pre-Release Announcements & Feedback" forum.
    /Steve.
  • Be sure to checkout “Tips & Tricks”
    Dear Guest Visitor → Once you register and log-in please checkout the “Tips & Tricks” page for some very handy tips!

    /Steve.
  • BootAble – FreeDOS boot testing freeware

    To obtain direct, low-level access to a system's mass storage drives, SpinRite runs under a GRC-customized version of FreeDOS which has been modified to add compatibility with all file systems. In order to run SpinRite it must first be possible to boot FreeDOS.

    GRC's “BootAble” freeware allows anyone to easily create BIOS-bootable media in order to workout and confirm the details of getting a machine to boot FreeDOS through a BIOS. Once the means of doing that has been determined, the media created by SpinRite can be booted and run in the same way.

    The participants here, who have taken the time to share their knowledge and experience, their successes and some frustrations with booting their computers into FreeDOS, have created a valuable knowledgebase which will benefit everyone who follows.

    You may click on the image to the right to obtain your own copy of BootAble. Then use the knowledge and experience documented here to boot your computer(s) into FreeDOS. And please do not hesitate to ask questions – nowhere else can better answers be found.

    (You may permanently close this reminder with the 'X' in the upper right.)

Learning ASM

#1

ShadowMeow

ShadowMeow

I'm on a mission to learn ASM. It's going to be difficult at the beginning but in a few years I guess I can master it.


#2

P

PHolder

As strange as this may sound, there is a game (probably more) on Steam that may be helpful. (Making learning fun can be quite helpful for some learners.) Check out https://store.steampowered.com/app/792100/7_Billion_Humans/ . It's visual, but it definitely reminds me of my days learning 6502 assembler.... the instructions you visualize are very close to 6502 assembler. It will probably go on sale at some point, so if you don't think it's worth full price, stick it on your wishlist and wait for a sale notification. Also, I suspect some other games on Steam may also be in a similar category and get recommended to you. (Such as ASTRA-256 Assembler, Shenzhen I/O, TIS-100 .)


#3

C

coffeeprogrammer

I don’t know is your are trying to learn assembly to make money or just for fun or both, but it you are try to make money in general by making software I would be careful. It does not seem clear to me what languages and development tools people make employment decision want the people working on the code to be investing time and money into. But I think that understanding assembly is helpful in understanding how computers work and in my mind it helps understand higher level languages.


#4

ShadowMeow

ShadowMeow

I don’t know is your are trying to learn assembly to make money or just for fun or both, but it you are try to make money in general by making software I would be careful. It does not seem clear to me what languages and development tools people make employment decision want the people working on the code to be investing time and money into. But I think that understanding assembly is helpful in understanding how computers work and in my mind it helps understand higher level languages.
Just for fun. Not everyone is driven by money.


#5

humke

humke

As strange as this may sound, there is a game (probably more) on Steam that may be helpful. (Making learning fun can be quite helpful for some learners.) Check out https://store.steampowered.com/app/792100/7_Billion_Humans/ . It's visual, but it definitely reminds me of my days learning 6502 assembler.... the instructions you visualize are very close to 6502 assembler. It will probably go on sale at some point, so if you don't think it's worth full price, stick it on your wishlist and wait for a sale notification. Also, I suspect some other games on Steam may also be in a similar category and get recommended to you. (Such as ASTRA-256 Assembler, Shenzhen I/O, TIS-100 .)
Going to check that game out! Want to learn 6502 assembler as well. As a kid I had a Commodore 64 and that was magic to me. Was a little bit too young at the time to understand what was happening when reading the code. But now, almost 40 years later, I should be able to understand (some of) it). Bought a second hand Commdore 64 a few months ago, so I have a real 6502 available. Or actually, a 6510, but I understand that's not actually that different.


#6

C

coffeeprogrammer

Just for fun. Not everyone is driven by money.
There are different assembly languages for different CPUs. Steve did say on a different twit podcast that a thing call a TI launchpad could be used to learn assembly, but it is not x86 assembly. I think the TI launchpad has a small instruction set like maybe 40 instruction.

I asked ChatGPT “in the most fundamental way, when programming a generic von Neumann computer, what be the most essential assembly instructions?” It gave a pretty good answer, so I copied and pasted it into a word processing document and saved the response. Later, I posted the response on Pavel Yosifovich blog. The blog was about his x86 64 bit programming course. Some one was asking for resources learning assembly. I decided to share my thoughts. Here is the link:



https://scorpiosoftware.net/2023/11/02/x64-architecture-and-programming-class/


#7

P

PHolder

Want to learn 6502 assembler
Do you know about Ben Eater on YouTube? If not, you should. He's building a 6502 computer from first principles. https://www.youtube.com/@BenEater


#8

Fuzzball

Fuzzball

Do you know about Ben Eater on YouTube? If not, you should. He's building a 6502 computer from first principles. https://www.youtube.com/@BenEater
Ben is cool. Most of what he's doing is beyond me, but I love his no-nonsense matter-of-fact "glitzless" style.


#9

ShadowMeow

ShadowMeow

Simple "Hello World!" program that works under FreeDOS...

Code:
org 0x100 ; Code starts at offset 100h
use16 ; Use 16-bit code

mov ax,0900h ; DOS function: AX = 0900h (Show Message)
mov dx,hello ; DX = "Hello World!$"
int 21h ; Call a DOS function: AX = 0900h (Show Message)

mov ax,4c00h ; DOS function: AX = 4c00h (Exit)
int 21h ; Call a DOS function: AX = 4c00h (Exit)

hello db "Hello World!$"

Compiling Code...

Code:
nasm hello.asm -o hello.com


#10

D

DarkwinX

Dave's garage did a tutorial on writing in asm. I think this one even has a shout-out to Steve in it.



#11

Steve

Steve

I think that the most important thing for learning MASM (x86 ASM) is having a truly comfortable development environment.

Assuming you're using Windows, everyone raves about the free Visual Studio Community Edition . You'll need to get MASM's tools which are now also available at no charge from Microsoft. Once you have those things in place, you'll have a very comfortable environment where you can write, edit, debug (single step and view registers and memory, etc.)

Then you'll have an environment where you're COMFORTABLY able to write x86 assembly code that looks like this:
1713538708286.png


#12

humke

humke

Do you know about Ben Eater on YouTube? If not, you should. He's building a 6502 computer from first principles. https://www.youtube.com/@BenEater
Watched a few of the 6502 series. Very informative. He explains everthing very well at just the right speed (for me). Thanks for mentioning his channel!


#13

B

Badrod

I never got very far with this, but I'll throw in a link to Maria Markstedter's site in case you're interested in a bit of Arm assembly. She's approaching it from a security research point of view. Pretty easy to find an old Raspberry Pi to practice on.


#14

C

coffeeprogrammer

I think that the most important thing for learning MASM (x86 ASM) is having a truly comfortable development environment.

Assuming you're using Windows, everyone raves about the free Visual Studio Community Edition . You'll need to get MASM's tools which are now also available at no charge from Microsoft. Once you have those things in place, you'll have a very comfortable environment where you can write, edit, debug (single step and view registers and memory, etc.)

Then you'll have an environment where you're COMFORTABLY able to write x86 assembly code that looks like this:
Yes, I just sent Microsoft another email asking about their developer licenses. OMG it is boring reading software licenses. If they actually email me back and I decide to buy some software from them I will ask why visual studio is so blotted. It would be really cool to have Steve's brain.


#15

C

coffeeprogrammer

Yes, I just sent Microsoft another email asking about their developer licenses. OMG it is boring reading software licenses. If they actually email me back and I decide to buy some software from them I will ask why visual studio is so blotted. It would be really cool to have Steve's brain.
Well really the brain of any one really good at 32-bit or 64-bit intel assembler.


#16

miquelfire

miquelfire

I wonder if Visual Studio Code could be used instead of the full Visual Studio? Out of the box, Code supports Typescript/JavaScript and C# (and maybe HTML and CSS, as its target is for web developers) but you can install plugins to support more stuff (I think MS has some Python support as well, which I only know about because I added the plugin for Jupyter Notebook, and it installed Python language support as a result)

I'm sure there's ASM language support. You would need to install the MASM Tools Steve linked at the very least.


#17

Happenstrance

Happenstrance

Yes, I just sent Microsoft another email asking about their developer licenses. OMG it is boring reading software licenses. If they actually email me back and I decide to buy some software from them I will ask why visual studio is so blotted. It would be really cool to have Steve's brain.
You could always just use an open source assembler like FASM (Flat Assembler 2)
Discussion thread for FASM - https://board.flatassembler.net/topic.php?t=22855
FASM syntax
FAQ on FASM vs MASM
The Fresh IDE with FASM built in.


#18

Steve

Steve

I wonder if Visual Studio Code could be used instead of the full Visual Studio?
YES! That's the Visual Studio that I meant.


#19

Steve

Steve

You could always just use an open source assembler like FASM (Flat Assembler 2)
That also looks like a great learning tool. What's not clear is whether a debugging facility is also integrated? For learning, an integrated debugging facility is SO important. That's what Visual Studio Code offers, and since it's free and the MASM tools are free, that's what I would recommend for Windows users. (y)


#20

ShadowMeow

ShadowMeow

When I try to download MASM's tools. I get this message We're sorry, this download is no longer available.


#21

M

Mervyn Haynes

When I try to download MASM's tools. I get this message We're sorry, this download is no longer available.
Are they not included when you download "Visual Studio Code". Or at least downloadable as an extension after VSC is installed?


#22

Greg S

Greg S

When I try to download MASM's tools. I get this message We're sorry, this download is no longer available.
See this link.


#23

C

coffeeprogrammer

I would try a few things all at the same time. 1) write down on a piece of paper what you want and why you want it. 2) try to contact the original organization of what you want if they still exist 3) think about if it is possible that any one besides yourself is aware or could become aware of what you are wanting to do and why 3) pick a few different search engines and try searching for what you want, if you think you found, it make sure it is correct if it is truly important.



As far as Microsoft product and services go, if you listen to SN, twit, or have an insight into commercialization of computer science, then I think it is basically impossible to ignore Microsoft’s influence.


#24

M

Mervyn Haynes

I would try a few things all at the same time. 1) write down on a piece of paper what you want and why you want it. 2) try to contact the original organization of what you want if they still exist 3) think about if it is possible that any one besides yourself is aware or could become aware of what you are wanting to do and why 3) pick a few different search engines and try searching for what you want, if you think you found, it make sure it is correct if it is truly important.
I am sorry, but I don't even understand this response! Can you explain?


#25

Steve

Steve

The MASM32 Project is probably the best maintained group around: http://www.masm32.com/
There are many terrific resources there, and I believe that the MASM32 downloads contain Microsoft's Macro Assembler itself. It also includes a really terrific collection of useful code libraries and an extensive set of forums.


#26

ShadowMeow

ShadowMeow

Whats the differences between MASM and NASM?


#27

P

PHolder

Whats the differences between MASM and NASM?

Since I didn't know (and thus a warning I can't vouch for this answer) I asked ChatGPT 3.5 on a lark:

MASM (Microsoft Macro Assembler) and NASM (Netwide Assembler) are both popular assemblers used to convert assembly language code into machine code. Here are some key differences between the two:

Syntax:
MASM uses Intel syntax, which is more closely aligned with the syntax used in Intel's official documentation.
NASM uses a more flexible syntax that resembles traditional Unix assembly syntax. It is often referred to as "AT&T syntax."

Platform Support:
MASM is primarily associated with the Windows platform and is often used for developing Windows applications and drivers.
NASM is cross-platform and can generate code for a variety of operating systems, including Windows, Linux, macOS, and others.

Licensing:
MASM is proprietary software owned by Microsoft and is typically distributed as part of the Microsoft Visual Studio suite.
NASM is open-source software distributed under the GNU General Public License (GPL), which means it is free to use and modify.

Features:
MASM has been around for a long time and has extensive documentation and support for Windows-specific features and APIs.
NASM is known for its simplicity, speed, and portability. It may lack some of the advanced features found in MASM, but it is highly customizable and suitable for a wide range of applications.

Assembler Directives:
Both MASM and NASM support assembler directives, but the syntax and set of directives may differ between the two assemblers.

Community and Resources:
MASM has a large user base and extensive documentation provided by Microsoft. There are also many online resources and tutorials available for learning MASM programming.
NASM also has a strong community of users and contributors, with documentation and resources available on its official website and various online forums and communities.

Overall, the choice between MASM and NASM often depends on factors such as the target platform, licensing preferences, and familiarity with the syntax and features of each assembler.


#28

C

coffeeprogrammer

You know, I think I touched on this before. I like assembly, I am not very good at it, because I figure out a way to give it the time and attention it would require. I also like C++, at least when I watch the trainsec.net videos I notice C++ features that I don’t understand well. If you really want to learn x86 assembler, I would recommend the intel software developers manual. It covers a lot of concepts that would be required to learn assembly. When comparing different assemblers, at least x86 assemblers, I think there are two different syntaxs, intel and gas. Both NASM and MASM are intel syntax I think. Kip Irvine’s work is also very practical and if you slow down and read it slowly and carefully while well rested you will learn important assembly concepts. In my mind people that pay attention to details would be best at assembly (or really any computer programming).

Another resource, I read about half of it, is “Computer Systems” by Stanley Warford. He has also posted his college lectures on youtube. “Computer System” assembly language is not based on a real chip, it is a simplified theoretical instruction set.




#29

cschuber

cschuber

It's not the assembly language that one needs to focus on. That's actually a fallacy. It's not a language, per se. Though some assemblers are languages, i.e. IBM Assembler F and especially Assembler H, for their macro languages. One needs to wrap one's head around the machine architecture.

Learning your first machine architecture will be a steep learning curve. Mine was IBM S/360 (and the S/370 series of machines) back in the day. When I picked up my first book on 8086 architecture, the idea of certain registers with only one function felt so foreign to me. The amd64 (x86_64) architecture includes a good number of general registers. Learning your second architecture will feel less steep than your first, i.e. if you already understand Intel x86 picking up ARM will be easier because all hardware generally works similarly to each other. It's a way of "thinking" about it.

IMO AMD architecture docs are an easier read than the Intel documentation. But in the beginning I found The 8086 Book by Russell Rector and George Alexy was a good Intel primer for me at the time. It's a bit dated but has excellent diagrams outlining the operation of each instruction. The diagrams are worth a thousand words. Moving from that to AMD or Intel documentation should make it less daunting.

Hope this helps.


#30

miquelfire

miquelfire

Because of my TI-86, I had learned ASM for z-80. Never actually made anything with it.


#31

Steve

Steve

When I picked up my first book on 8086 architecture, the idea of certain registers with only one function felt so foreign to me.
Right. This is very typical of microprocessor design, since it allows for a surprisingly significant reduction in chip complexity and code size by allowing for "implied" registers for many opcodes. Mainframe architectures tend to be for more “orthogonal.” One of the biggest problems created by non-orthogonal (microprocessor) architectures is that they tend to be hostile to higher-level compilation. When I'm coding for x86, I'm able to design my implementation around the specific needs (strong biases) created by the processor's design. The result is insanely efficient code, but it is not forward-looking. It's not the future.


#32

cschuber

cschuber

Right. This is very typical of microprocessor design, since it allows for a surprisingly significant reduction in chip complexity and code size by allowing for "implied" registers for many opcodes. Mainframe architectures tend to be for more “orthogonal.” One of the biggest problems created by non-orthogonal (microprocessor) architectures is that they tend to be hostile to higher-level compilation. When I'm coding for x86, I'm able to design my implementation around the specific needs (strong biases) created by the processor's design. The result is insanely efficient code, but it is not forward-looking. It's not the future.
Except for the M68K, though it did have separate general data registers and general address registers. This was not nearly as restrictive as the 8086 was. The intel 64-bit architecture does have eight general registers in addition to the legacy registers. That was welcome.

z/Architecture is hostile to higher level languages such as C, C++, and the like, because these languages use the stack to pass arguments. On an architecture with no stack, the stack must be emulated using multiple instructions.

Agreed. The most efficient code I've ever written was in assembly.


#33

Steve

Steve

Except for the M68K
Yes... and I SO MUCH WISH that the Motorola 68000 had been chosen by IBM. It was a close call, apparently. THAT would have changed the destiny of the PC industry SO significantly. <sigh> Instead we're stuck with this crock.


#34

ShadowMeow

ShadowMeow

photo_2024-05-02_22-45-38.jpg


This example of ASM code look super clean. Love how it starts with [BITS 16] and [ORG 0100H].


#35

C

coffeeprogrammer

Yes, the few time I have followed an assembly program in a debugger it was much harder than in a high level language. A few days ago I did get a FreeDOS VM working and used MASM's CodeView to debug a program. It was a little bit difficult because I had to pop out CodeView into the dos program and then back to CodeView, everything was crowded on the screen in CodeView. It must have been much more difficult to write software back in the days of a single CRT monitor. I do think it is possible to have two DOS VMs and have one running the program and one running the debugger. What would be best would to be able to use a graphical environment like windows and have a debugger connect into DOS VM. I am not sure how that would be possible. But in any case, people still use assembly in modern operating system like Windows and Linux. There is a programs called WinASM that has a DOS template for assembler, I loaded it once, but it was not obvious how to use a debugger with that. For writing assembly programs in Windows, you can use WinDBG, it is not to hard to use. What do you have for an operating system to test these assembly programs? Modern Windows or Linux? A DOS virtual machine? Or maybe an old Pentium 1 from 1996?


#36

C

coffeeprogrammer

View attachment 1208

This example of ASM code look super clean. Love how it starts with [BITS 16] and [ORG 0100H].
One thing about assembly programs on Windows is that when you write a console program for example and use C or C++, the main function is started by the runtime of the language (the C or C++ runtime) in assembler I think it is a little different, if I understand correctly, there really would not be any runtime like that. In Windows, I think when a program is started, it is NTDLL.dll that starts it and I think it does things like allocate a process and load up the required DLLs, maybe start the threads.

That program in the picture you posted is of a dos .com file. I think those were limited to 64K. I am not sure I know the exact reason for that. However the parts with int 21H is how I think the DOS API works, I think the exact function is specified in AH and then you call int 21h. The int instruction is used for some specific reason, which I am not sure I fully understand, but I do know that interrupt service routines are important in understanding operating systems. For example, I think some exceptions are defined with interrupt service routines. Such as divide by zero, I think that when a processor divides by zero, it would look up the interrupt service routine for than and run it. Therefore in theory you could write your own ISR for dividing by zero. You may have noticed I said “I think” many times here. That is because much of this I picked up by reading and not testing. So I am not sure if my understanding is correct.


#37

C

coffeeprogrammer

Maybe I wasted my money, but I have this book.


Likely you can find it online at this point.


#38

C

coffeeprogrammer

Right. This is very typical of microprocessor design, since it allows for a surprisingly significant reduction in chip complexity and code size by allowing for "implied" registers for many opcodes. Mainframe architectures tend to be for more “orthogonal.” One of the biggest problems created by non-orthogonal (microprocessor) architectures is that they tend to be hostile to higher-level compilation. When I'm coding for x86, I'm able to design my implementation around the specific needs (strong biases) created by the processor's design. The result is insanely efficient code, but it is not forward-looking. It's not the future.


That is interesting, it is not the first time that I have heard something like that. I am not sure of the reasoning behind that. I do recall that you (Steve) have pointed out that you like x86 because it is a complex instruction set. Saying that writing assembly in for a RISC is not all that rewarding and too difficult I suppose. Maybe I will do a google search comparing Motorola 68000 to intel. This is the reason I’ve said before Steve should write book. (In all his spare time). I will have to check around on Amazon for microprocessor design books, maybe somebody covers these ideas that Steve and @cschuber are discussing. I will look for that 8086 Book by Russell Rector, but I am guessing is like an 80s book. I wish they would put all those 80s and 90s programming books on kindle. Thanks for your input @cshuber, keep it coming, sometimes learning things is easier in small chunks over time and sometimes it good and set aside sometime and do a “deep dive” I will think about that, learning the machine architecture and less the assembly “language”.

I guess with high level languages, I often suggest people focus on things like learning to use a debugger, the call stack, control structures, types and data structures, and threads.


#39

cschuber

cschuber

That is interesting, it is not the first time that I have heard something like that. I am not sure of the reasoning behind that. I do recall that you (Steve) have pointed out that you like x86 because it is a complex instruction set. Saying that writing assembly in for a RISC is not all that rewarding and too difficult I suppose. Maybe I will do a google search comparing Motorola 68000 to intel. This is the reason I’ve said before Steve should write book. (In all his spare time). I will have to check around on Amazon for microprocessor design books, maybe somebody covers these ideas that Steve and @cschuber are discussing. I will look for that 8086 Book by Russell Rector, but I am guessing is like an 80s book. I wish they would put all those 80s and 90s programming books on kindle. Thanks for your input @cshuber, keep it coming, sometimes learning things is easier in small chunks over time and sometimes it good and set aside sometime and do a “deep dive” I will think about that, learning the machine architecture and less the assembly “language”.

I guess with high level languages, I often suggest people focus on things like learning to use a debugger, the call stack, control structures, types and data structures, and threads.
Having worked on CISC and RISC, both are rewarding. Though IMO working in IBM S/360, S/370, z/Series mainframes were most rewarding simply because I could do things like branch tables, i.e.,

Code:
         EX    R4,LOCSTART          LOCATE START OF NEXT TOKEN
         BC    7,*+4(R2)            SOMETHING FOUND
         B     MAINNFND             00 - NOTHING FOUND
         B     MAINRBRK             04 - RIGHT BRACKET FOUND
         B     MAINEQAL             08 - EQUAL SIGN FOUND
         B     MAINLBRK             0C - LEFT BRACKET FOUND
         B     MAINCOMA             10 - COMMA FOUND
         B     MAINSTRT             14 - START OF TOKEN FOUND
         B     MAINSPEC             18 - SPECIAL CHARACTER...
...
LOCSTART TRT   0(*-*,R3),0(R5)        LOCATE START OF NEXT TOKEN
...
#NXTTOKN HTRTAB (C')',4),(C'=',8),(C'(',X'0C'),(C',',X'10'),           X
               (C'A'-C'I',C'J'-C'R',C'S'-C'Z',C'0'-C'9',X'4A',C'.',    X
               C'<',C'|',C'&&',C'!',C'$',C'*',C';',X'5F',C'/',C'%',    X
               C'_',C'>',C'?',C':',C'#',C'@',C'''',C'"',X'14')

Here an instruction located a character and if matched translated it into an integer of multiple 4, placing it into register 2. This in turn was an index into a branch table immediately following. Thereby avoiding multiple compare and branch (jump) instructions. What would have normally taken many more than 14 instructions to implement this case construct in x86 (also a CISC architecture), it took only 8 instructions on S/370. (Note that HTRTAB is not a real instruction but a macro that defines a 256 byte table.) Try doing this with these few instructions on Intel or any other microprocessor today.

No, you can't compare CISC with RISC. Each architecture is different. Not all CISC architectures are the same.

The most satisfying thing about writing code in assembler is the satisfaction of reducing the code to the minimum instructions to do the job

Macro assemblers are certainly more satisfying than your average simple assembler.

I think I bought the book after 1986.

I should mention that Steve did say in the last podcast he uses exclusive or (XOR on Intel) to zero out registers because it's faster. Indeed on many architectures it is. But I do recall IBM releasing notes about some models of mainframes saying that on those models subtract register (SR) took fewer cycles than exclusive or (XR). Though, typically it's accepted practice to use exclusive or, one must keep in mind that this is not always the case and that it is model dependent; that some machines may take fewer cycles to execute subtract register than exclusive or. The take away from this is one must have intimate knowledge of the machine architecture one is working on.

Learning an assembler is just the tip of the iceberg. It is an exciting world to explore.


#40

bithamr

bithamr

I have a couple of recommendations based on my own experiences and across a couple different learning styles, I hope they may be helpful to you.

Books​

If you prefer the classic/academic approach (reading books, e.t.c.) I started learning x86 assembly in the mid-2000's using this book:

1716638425316.png


Its focus is more on introducing you to programming with x86 assembly as the language, which I think is part of what makes it a particularly good book (and I imagine Steve would appreciate such an approach?).

You can buy it on Amazon in its most recent edition:

https://www.amazon.com/Programming-Ground-Up-Jonathan-Bartlett/dp/1616100648

(but unfortunately that version dropped the iconic purple cover)

The author was also very generous to release the original version under the GNU Free Documentation License, so you can find it for free on gnu.org:

https://download-mirror.savannah.gnu.org/releases/pgubook/

It's a bit old, but scanning over it again today I have a sense that it didn't age too poorly.

---

In recent years I also purchased and read this book:

1716639010344.png


(https://www.amazon.com/Introduction-Assembly-Programming-RISC-V/dp/6500158113)

Admittedly this one is short, not the absolute best quality and ultimately purpose-focused on RISC-V assembly, but I got a lot out of this book during the pandemic because I was looking for something to do and had purchased some RISC-V SOCs for some projects. If you're like me and you think RISC-V is the future of computing, you might enjoy this book. The cost of the book is helpfully very low.

Practical​

If you prefer a more practical or "hands on" approach, there is a game called "Turing Complete" which I found to be an absolute joy:

1716639583993.png


It sells itself as a "game" (which is partly true because it provides levels and goals in a game-like fashion) but it's really just a robust simulator for building logic gates and components to build your own computer essentially from scratch. The game will step you up from the basics, to building your own Arithmetic Logic Unit (ALU), to ultimately having a fully working computer with an assembly language you define yourself!

I love this game, and I keep coming back to it every few months. It's available DRM-free on GOG.com:

https://www.gog.com/game/turing_complete

(it runs great under wine, if you're on Linux)

Or if you can tolerate DRM and don't mind not really truly owning a copy of the game, it's available on Steam as well:

https://store.steampowered.com/app/1444480/Turing_Complete/

---

I noticed mention here about the 6502, and if you want to get truly hands-on I think this video series on building your own 6502 computer is amazing:

1716640875691.png


https://www.youtube.com/playlist?list=PLowKtXNTBypFbtuVMUVXNR0z1mu7dp7eH

This (like the game above) is a bit more focused on the fundamentals behind assembly programming than it is directly focusing on syntax and practices, but you mentioned that this is something you mostly wanted to do for fun, and I remember having a blast building this kit myself. The creator sells kits too, if you don't have components laying around or if you don't want to have to find everything over on Mouser or something like that (but you can otherwise source all the parts yourself if you prefer).

AI​

I never got formal training on assembly (when I was in college it was touched on, but we mostly learned C and Java) so I'm self taught. However (and while this may be contentious), I have found modern Large Language Models (LLMs) to be reasonably useful as tutors or guides when learning or refreshing yourself on programming topics such as x86 assembly, for instance using Mistral AI:

1716641868739.png


You can go on to ask it how to build the code, and it will do a pretty good job. Like humans however LLMs can produce inaccuracies, but generation over generation they get better and better. For instance, all I had to do was give it some of my compiler output (I was using the GNU assembler, it was providing NASM):

1716642393412.png


Again, not "perfect" and you definitely have to remain skeptical while using them but they do a good job the bulk of the time and importantly you can dig into very specific subjects and syntax very quickly (i.e. "explain what `.section` does, e.t.c.).

I personally use Mistral AI and recommend it because it's open-source (Apache 2.0 License) and I can run it locally, but many of the prominent providers will also give good results.

---

So those were some highlights from my own experiences, I hope they'll help you with your own!


#41

C

coffeeprogrammer

I heard of this years ago and somewhat forgot about it. It looks like there is a cloud version now. I wonder if trying to design a CPU would help for understanding? I searched for CPU and it is like there is per-made CPUs designs. The is one problem however, I have started to use configurations that are not connected to the internet more and more. That means most of the software I buy needs to be able to run while not connected to the internet. I think this company has a version that will run on the OS, but I think it costs a lot. I am not sure if there is a version that is affordable and offline.


I guess a person has to almost waste time when time to learn these things because there is so much unknown.


#42

C

coffeeprogrammer

If you want to focus on MASM style assembler there are good places on the internet for too!


I used the firefox extension "Down them all" to download all these samples from the MASM32 forums.
Am am thinking that some day I could study the code and maybe learn something.



With the growth of GitHub there are some things there too, I found these two users that have some stuff.
It would be nice if there were more on GitHub for assembler, studying others peoples code is a good way to learn I think.

I do know that someone on GitHub took the time to create the masm32 include files to program to the Windows API, this is something that sometimes assembler programmers have to do, converting from the C++ .h files I think. I could not file it quickly, so I am not sure of the address, but it is on there some place.

In fact, Steve has a download that might be helpful:


I downloaded that a few years time ago and studied some of it, if I remember correctly it has some of the marcos he talked about on the podcast, like the "free" macro are in there.


#43

C

coffeeprogrammer

When I try to download MASM's tools. I get this message We're sorry, this download is no longer available.


#44

C

coffeeprogrammer

Ok, I have 80x86 Assembly Language and Computer Architecture, I disabled the DRM and I have speechify for the next year to read it to me. How could this possibly go wrong? If this works, I will do the same with the Irvine book and then maybe Jeff Duntemann's linux assembly book. It is easier to do Linux assembly now because of WSL anyhow.


#45

C

coffeeprogrammer

Well I did this today to make it more easy and convenient to program in 16bit DOS ASM, setting up this stuff take a long time. If anyone has any question about how I did this, let me know. (the preview makes it look like I am playing doom, but that is not the what the video is about, I was just showing that FreeDOS has sound over remote desktop).