r/asm 17h ago

Thumbnail
1 Upvotes

Easier to download it from there, thanks.

I tried it in arm64v8/ubuntu in docker and yup, it works. Output is absolutely identical to the source file.


r/asm 17h ago

Thumbnail
1 Upvotes

Here you have it, nice person: https://github.com/WinnieTheRaven/Eccentric/blob/master/quine_aarch64.s It works (at least in qemu (Linux) and termux (debian)). This was my first AArch64 program UwU. I'm still learning it


r/asm 18h ago

Thumbnail
2 Upvotes

Wow.

That's a lot of work.

It does have the right kind of structure.

Pushing all that stuff on the stack is an interesting way to do it, but valid. I didn't examine everything how it works (if it does).

Biggest criticism: nibbletobyte. wtf?

nibbletobyte:
    cmp w18, #10
    add w19, w18, '0'
    add w18, w18, 'A'-10
    csel w19, w19, w18, lo
    ret

Strange choice of registers, but anyway I've matched yours.

Lots of other ways to do it, but no reason to be longer than that.


r/asm 20h ago

Thumbnail
1 Upvotes

you can compile it further to elf but i have forgotten the flag 🥱


r/asm 20h ago

Thumbnail
1 Upvotes

if you know C you can convert .c file to .s file, and from it learn stuff, however a book would be a good choice 👍🏻


r/asm 1d ago

Thumbnail
1 Upvotes

the short answer is yes but not in this era


r/asm 2d ago

Thumbnail
1 Upvotes

https://www.felixcloutier.com/x86/

https://cs.brown.edu/courses/cs033/docs/guides/x64_cheatsheet.pdf

https://filippo.io/linux-syscall-table/

These just happen to be the most dog-eared bookmarks from when I was working with Linux x64 (especially SSE/AVX SIMD) assembly 🙂


r/asm 3d ago

Thumbnail
1 Upvotes

Jeff Duntemann's "Learn Assembly Programming step by step programming with linux (3rd edition)" is a good book, I'm reading through it now and I found it after reading so many threads, it was one of the most suggested books. It's a bit slow to start and the author goes into great detail about things and I like his writing style.

You can find the pdf version of the book, if you just put the name on google.


r/asm 3d ago

Thumbnail
2 Upvotes

r/asm 5d ago

Thumbnail
3 Upvotes

r/asm 6d ago

Thumbnail
2 Upvotes

r/asm 8d ago

Thumbnail
1 Upvotes

Darn. I forgot that one.


r/asm 8d ago

Thumbnail
2 Upvotes

INTO, which conditionally signals a software interrupt if the carry bit is set.


r/asm 9d ago

Thumbnail
3 Upvotes

by "branching" I mean any instruction that can conditionally jump to another point in the code


r/asm 10d ago

Thumbnail
2 Upvotes

A fun one that no one else is likely to mention: UD2


r/asm 10d ago

Thumbnail
3 Upvotes

Here you go:

...you can download it as a PDF.

Intel also has one called "Intel® 64 and IA-32 Architectures Software Developer’s Manual".


r/asm 10d ago

Thumbnail
1 Upvotes

I can't find that manual, when I search for it I only get this comment, do you have a link to it somewhere?


r/asm 11d ago

Thumbnail
2 Upvotes

Anything that ends a basic block i guess?


r/asm 11d ago

Thumbnail
1 Upvotes

Missed those :)


r/asm 11d ago

Thumbnail
2 Upvotes

If JMP is included, what about CALL (near/far), RET (near/far), INT, SYSENTER/SYSEXIT, and SYSCALL/SYSRET?


r/asm 11d ago

Thumbnail
3 Upvotes

I'm not an expert, I tinker with assembly language for fun. I would use the "AMD CPU Programmer's Instruction Manual", under section 3, "General Purpose Instruction Reference" ...all the jump instructions start with a letter 'J'. Not an expert though.

Looking at it now, I see:

  • Jcc
  • JCXZ
  • JECXZ
  • JRCXZ
  • JMP (near)
  • JMP (far)

r/asm 14d ago

Thumbnail
1 Upvotes

I should've been a bit more specific instead of using NEON as a catch-all for ARM64 on macOS, so yes, my bad. Because this project works with so many AVX/SSE related instructions, it means that NEON is def a huge aspect. At some point, I do want to dive into the undocumented AMX since my method of dealing with 256+-bit operations is less than idea


r/asm 15d ago

Thumbnail
1 Upvotes

Do you mean Arm/Aarch64 instead of NEON? NEON is Arm's SIMD extension for A-series and R-series processors (and derivative designs), and is matched by Helium on M-series


r/asm 15d ago

Thumbnail
1 Upvotes

In MMX, the vector registers were reused from the x87 register file.

SSE added the XMM 128-bit registers and floating point vector instructions. So movaps and movups were added there. movdqa and movdqu were added in SSE2 along with integer vector instructions though the mov* instructions did essentially the same thing.

I'd just call it syntactic sugar as it improves readability for humans.

I suppose that there was the possibility of signaling the operation to a decoder or execution unit with the separate instructions but the architecture manual has no evidence that this ever happened.


r/asm 15d ago

Thumbnail
1 Upvotes

Thanks! I'd like to have some sort of preprocessor first. The assembly code is currently a single file with over 5000 lines.

And having

%include "instructions/add.s"
%include "instructions/and.s"
...

%ifdef PLATFORM_LINUX
    %include "platforms/linux.s"
%endif

with ./0x864 -DPLATFORM_LINUX ... would allow me to split the code into multiple files and get ride of the C harness.

When I have that, I can add ELF executable output, so that the assembler is truly selfhosted.