Score:2

Is there a way to call a window in ubuntu using nasm?

mz flag

I was wondering if there was a way to create a window using nasm. I know that when using wsl-2, it allows the user to actually use linux system calls, so are there any particular system calls or libraries that can create a linux window?

Score:0
vn flag

There are, I believe, two questions here:

  • How to create a window/graphical element using nasm on Ubuntu
  • If this will work on Ubuntu on WSL2

The answer to the first part is, I believe, yes. My assembler days are decades behind me, and I really have no desire to try this personally ;-), but a common library for displaying graphics under Linux at a low-level is SDL. All indications that I can find in my search for "nasm and sdl" indicates that it is possible to do this in nasm.

For the second part, almost certainly "Yes", assuming you have the first part working. I do know that SDL-based code will generate graphical windows under WSL2, but you do have to have Windows 11 in order for GUI support to be built-in to WSL. There are workarounds for Windows 10 using other methods - See here and here.

raven_lee avatar
mz flag
Thank you!! I've tried asking the question in 15 different ways to google, trying to find a lib, that could possibly do this.
NotTheDr01ds avatar
vn flag
@raven_lee Glad I could help, and yes, I can imagine that combination of things can be really tough to find in Google search results. Honestly, it wouldn't surprise me if you are the first person to use nasm/WSL and a graphics library! It's certainly the first time I've seen the question asked with that combination! :-). When you get it working, I'd encourage you to write up your own answer with more details, perhaps on Stack Overflow, but here would be fine as well.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.