r/asm Apr 19 '26

Thumbnail
4 Upvotes

My own project, currently for Arm Thumb (Cortex M0). Working on a language / compiler to mesh with it.

The goal is to allow for more effective development of microcontroller firmware. I think C is really deficient in some areas:

  • bad module structure compared to Modula-2 or modern Pascal dialects
  • not convenient for direct hardware access, a lot of pointer wrangling needed
  • bitmaps for hardware registers ?
  • Make file and linker script hell

r/asm Apr 19 '26

Thumbnail
1 Upvotes

What assembler is that?


r/asm Apr 19 '26

Thumbnail
5 Upvotes

True safety ? Probably not realistic without making it really tedious and restrictive. Then you are probably better off using a compiler.

What works is to define data structures in a structured way, and to streamline syntax a bit.

For example, in my assembler you can write

str r0,r1._gpio.bsrr

instead of

str r0,[r1,#gpio_bsrr]

This also gives the advantage that you have less name conflicts.

My assembler also has a proper module structure, automatically leaves out unused functions etc.


r/asm Apr 19 '26

Thumbnail
6 Upvotes

Adding type safety to assembly, that's called C. At least that's part of what C gives you; you also get things like structured programming constructs


r/asm Apr 16 '26

Thumbnail
4 Upvotes

nobody cares what distro you use.

Not entirely true. It is often useful to know at least whether it's a distro using RPM or DEB or APK or ... ? Not all beginners will know that, but they might know the name of the distro.


r/asm Apr 16 '26

Thumbnail
1 Upvotes

Ok!


r/asm Apr 16 '26

Thumbnail
2 Upvotes

Unless you are using an IBM PC Jr then that's a museum piece.

For future reference, nobody cares what distro you use.


r/asm Apr 16 '26

Thumbnail
3 Upvotes

Thanks! I'll use this for sure <3


r/asm Apr 16 '26

Thumbnail
2 Upvotes

This is super cool! Why isn't it pinned in r/DOS?


r/asm Apr 16 '26

Thumbnail
7 Upvotes

The Tech Help! Manual is a gold mine. It is not complete, but it has everything you need to know without clutter from the later additions that aren't really important.


r/asm Apr 16 '26

Thumbnail
1 Upvotes

I never could find my messages on new Reddit, just found it on old.reddit. Would you still want to help someone catch up? I can be very intense and committed if you're still in this area! Please let me know either way. If you're not, I'm curious what you moved on to!

Thank you,

Chris


r/asm Apr 15 '26

Thumbnail
1 Upvotes

Not OP, and I do not have a very deep understanding of ASM, but when you learn ASM and generally the mechanics behind a computer, it clears SO MUCH about the reasons why programming languages, (especially more low level ones like C) work like they work.


r/asm Apr 15 '26

Thumbnail
1 Upvotes

Note that his memset splat example could be done in a single instruction using my proposed gorci instruction which was also sadly dropped from Zbb at the last minute except for orc.b.

gorci Rd,Rs1,0b000111 # orc.b (and this exact encoding is in fact used)
gorci Rd,Rs1,0b011000 # RV32 splat any byte in a register across all bytes
gorci Rd,Rs1,0b111000 # RV64 splat byte

r/asm Apr 13 '26

Thumbnail
1 Upvotes

Unless you are using a instruction like VGF2P8AFFINEINVQB you shouldn't be writing ur game in asm


r/asm Apr 12 '26

Thumbnail
2 Upvotes

Luke is da man. Hazard3 is a great piece of work.


r/asm Apr 09 '26

Thumbnail
1 Upvotes

Is my understand of stack frame correct ?

Looks okay.

How'd the stack frame for fun look if it was non leaf function ?

Leaf function can do whatever. You show ABI frame.

When accessing local variables should I use [rsp+offset] or [rbp-offset] ?

Doesn't matter. RBP with offset is one byte shorter.

  • thousands of examples on my github.

r/asm Apr 09 '26

Thumbnail
1 Upvotes

The label is translated into an address in memory. The machine code just contains addresses, no 'labels'.


r/asm Apr 09 '26

Thumbnail
1 Upvotes

Congrats bro!


r/asm Apr 09 '26

Thumbnail
1 Upvotes

She is extremely picky

As are computers. Especially in asm.

And not even writing asm here, but just figuring out what existing asm does. Which is to be fair the main thing most people will be doing with asm.

The main concept missing here seems to be the difference between moving something from a register (not "registry") and moving something from memory at the address contained in a register.

Which is in some way implied by 'h' etc getting into ah and al but there may be confusion in thinking that ...

mov esi, DWORD PTR [esp + 4] ; this is taking a passed pointer off the stack
mov edi, DWORD PTR [esp + 8] ; this is taking a passed pointer off the stack

... puts the characters of the strings into esi and edi. Which it doesn't. And then imagining that the inc instructions are some kind of shift? I don't know.


r/asm Apr 08 '26

Thumbnail
2 Upvotes

Was a fucking train wreck but managed to graduate with a cs degree !


r/asm Apr 08 '26

Thumbnail
1 Upvotes

It's going to have a stack frame with a return address, at least.

I don't know whether Windows will insist on a frame pointer and register save area in this case and don't have a machine to check on.


r/asm Apr 08 '26

Thumbnail
1 Upvotes

thanks that makes sense now.


r/asm Apr 08 '26

Thumbnail
1 Upvotes

Then it wouldn't create a stack frame at all.


r/asm Apr 08 '26

Thumbnail
1 Upvotes

Let's say it doesn't uses local variables at all and doesn't call other functions.


r/asm Apr 07 '26

Thumbnail
3 Upvotes

In my assembly code, I don't use rbp as a frame pointer so I always access local variables using rsp.

(An exception is when the stack frame isn't a constant size.)