GNU social JP
  • FAQ
  • Login
GNU social JPは日本のGNU socialサーバーです。
Usage/ToS/admin/test/Pleroma FE
  • Public

    • Public
    • Network
    • Groups
    • Featured
    • Popular
    • People

Conversation

Notices

  1. Embed this notice
    mcc (mcc@mastodon.social)'s status on Wednesday, 22-Jan-2025 10:40:40 JST mcc mcc

    2. At a certain point in my code, I wanted to load a pointer to the .data segment variable "input" into my %r10. The way to do this turned out to be

    lea input(%rip), %r10

    rip is… the instruction pointer?? what the devil is the instruction pointer doing there? `input` is at a fixed location, surely it's not loading it from an address relative to the fricking instruction pointer.

    In conversation about 5 months ago from mastodon.social permalink
    • Embed this notice
      mcc (mcc@mastodon.social)'s status on Wednesday, 22-Jan-2025 10:40:34 JST mcc mcc
      in reply to
      • Erin 💽✨

      @erincandescent Then I still assert we shouldn't be calling it "intel syntax" if it's "vaguely intel inspired syntax"!

      In conversation about 5 months ago permalink
    • Embed this notice
      Erin 💽✨ (erincandescent@akko.erincandescent.net)'s status on Wednesday, 22-Jan-2025 10:40:35 JST Erin 💽✨ Erin 💽✨
      in reply to
      • Tom Forsyth

      @TomF @mcc Intel provided an assembler at one time (ASM86), maybe they still do as part of ICC? And basically “intel syntax” is a descendent of that per oral tradition. It’s Intel syntax because its the syntax that Intel’s asembler used, and that the Intel datasheets use; as opposed to AT&T syntax, the syntax that AT&T’s assembler for Unix used.

      When Microsoft made MASM it copied the syntax. Borland’s Turbo Assembler (TASM) copied that. Everything else “intel syntax” is a descendent of those two

      In ASM86 and MASM, what mov eax, foo does is not immediately obvious. If “foo” is defined as constant (label EQU 0xf00), it’ll set EAX to 0xf00. If “foo” is defined as a variable, it’ll load the contents of that variable.

      TASM added “Ideal Mode”, in which this is always consistent: mov eax, foo always sets EAX to the address of the foo label; mov eax, [foo] loads from that address.

      Most other assemblers implementing Intel syntax (NASM, FASM, YASM, GAS w/ .intel_synatx noprefix) are broadly copying Ideal Mode

      But it’s all kind of vibes.

      In conversation about 5 months ago permalink
    • Embed this notice
      Tom Forsyth (tomf@mastodon.gamedev.place)'s status on Wednesday, 22-Jan-2025 10:40:37 JST Tom Forsyth Tom Forsyth
      in reply to

      @mcc The official tools Intel provides are the C intrinsics - and they are of course C syntax, so have no bearing on the assembly.

      So yeah, my recollection is we picked what seemed sensible and went with it. BUT - that was just for the purposes of ISA documentation - there was no hard link to the actual syntax accepted by the assemblers (dramatically so in the case of AT&T syntax).

      So it really does seem like a thing nobody owns, except for each specific tool vendor!

      In conversation about 5 months ago permalink

      Attachments

      1. No result found on File_thumbnail lookup.
        http://assembly.So/
    • Embed this notice
      mcc (mcc@mastodon.social)'s status on Wednesday, 22-Jan-2025 10:40:38 JST mcc mcc
      in reply to
      • Tom Forsyth

      @TomF So what I am looking for is neither nasm nor masm, but rather "Intel syntax". Clang and GCC both have modes in which they purport to follow "Intel syntax". To me, this is like Clang and GCC promising that an "Intel syntax" exists. From my research, unless there's a BNF I haven't found hiding in this 5000 page Intel x86_64 manual ( https://www.intel.com/content/www/us/en/developer/articles/technical/intel-sdm.html ) , Intel has never defined such a thing. It was apparently only *implied* by examples in 8086 datasheets. (1/2)

      In conversation about 5 months ago permalink

      Attachments

      1. Domain not in remote thumbnail source whitelist: www.intel.com
        Intel® 64 and IA-32 Architectures Software Developer Manuals
        These manuals describe the architecture and programming environment of the Intel® 64 and IA-32 architectures.
    • Embed this notice
      mcc (mcc@mastodon.social)'s status on Wednesday, 22-Jan-2025 10:40:38 JST mcc mcc
      in reply to
      • Tom Forsyth

      @TomF Based on this, in my opinion, GCC and Clang should for clarity stop referring to "Intel syntax" and, taking a cue from ARC, refer to "Alleged Intel syntax", or perhaps "Intel folk syntax".

      However, I'm also perplexed, because if there's no source of truth for "Intel syntax", then how did clang and gcc know what to implement? Or rather, how do clang and gcc know their "Intel syntax"es are compatible with each *other*? (2/2)

      In conversation about 5 months ago permalink
    • Embed this notice
      Tom Forsyth (tomf@mastodon.gamedev.place)'s status on Wednesday, 22-Jan-2025 10:40:38 JST Tom Forsyth Tom Forsyth
      in reply to

      @mcc I added a whole bunch of instructions to x86 (what became AVX512), including new syntax for the mask registers. I remember trying to find out who "owned" that, and whether we should use v0(k1), v0[k1] or v0{k1} or some other syntax.

      Sadly I don't have my notes from that time, but my vague recollection is that the answer was "nobody cares - pick one". Which was very alarming! I did have some feedback from our internal assembler team, but they stressed that they were NOT a public authority.

      In conversation about 5 months ago permalink
    • Embed this notice
      mcc (mcc@mastodon.social)'s status on Wednesday, 22-Jan-2025 10:40:40 JST mcc mcc
      in reply to

      Expanding on my question re: "where is intel assembly format actually documented?"

      mov rax, 60

      This is pretty simple, right? I want the number 60 in rax. This says: ambiguous operand size for mov. Oh, there was something about that in the gas manual. Okay, I say:

      mov rax, dword 60

      It says: junk 60 after expression

      What the heck do I do now? Do I just come back to mastodon for help every time I want to type a number? All the StackOverflow examples on are AT&T format.

      In conversation about 5 months ago permalink
    • Embed this notice
      mcc (mcc@mastodon.social)'s status on Wednesday, 22-Jan-2025 10:40:40 JST mcc mcc
      in reply to

      Findings so far:

      - If you put ".intel_syntax" at the top of a gas file, it does *not* give you intel syntax *or* AT&T syntax but a secret third thing. The way to get the real intel syntax is ".intel_syntax noprefix"

      - It didn't accept the 0(reg) syntax to dereference. By experimentation, I found I could do 0[reg]. That is terrifying. Guessing, I mean.

      - No one I have spoken to has learned intel syntax by anything other than oral tradition. Also, no one uses intel with gas (they all use nasm?)

      In conversation about 5 months ago permalink
    • Embed this notice
      Tom Forsyth (tomf@mastodon.gamedev.place)'s status on Wednesday, 22-Jan-2025 10:40:40 JST Tom Forsyth Tom Forsyth
      in reply to

      @mcc IIRC a lot of the extended syntax was defined by MASM, sometimes to make life simpler for their extremely powerful macros. I don't know how much of that was also adopted by NASM. So well worth checking with both MASM and NASM. But yes - lots of oral tradition here...

      In conversation about 5 months ago permalink
    • Embed this notice
      mcc (mcc@mastodon.social)'s status on Thursday, 23-Jan-2025 10:02:02 JST mcc mcc
      in reply to
      • tom jennings
      • Tom Forsyth
      • Erin 💽✨

      @erincandescent @TomF @tomjennings That's why Apple funded it and why Google jumped on board, but in my opinion it wouldn't have taken over the market *just* because corporations like it. I use clang/lldb preferentially even when GCC/gdb is an option because it's just cleaner, more intentional software.

      In conversation about 5 months ago permalink
    • Embed this notice
      Erin 💽✨ (erincandescent@akko.erincandescent.net)'s status on Thursday, 23-Jan-2025 10:02:07 JST Erin 💽✨ Erin 💽✨
      in reply to
      • tom jennings
      • Tom Forsyth
      • Erin 💽✨
      @mcc @TomF @tomjennings I mean, clang became an actual thing because Apple needed a replacement for GCC 4.2 after FSF changed their license
      In conversation about 5 months ago permalink
    • Embed this notice
      mcc (mcc@mastodon.social)'s status on Thursday, 23-Jan-2025 10:02:09 JST mcc mcc
      in reply to
      • tom jennings
      • Tom Forsyth

      @tomjennings @TomF Clang was supposed to have been about cleaning up the by-convention morass that GNU had fallen into. I expect GNU to accept this state of affairs on the world's most popular PC platform and not try to change it for 25 years, but Clang I expect better!!

      This is two weeks after I discover Clang's libunwind library has literally no api documentation at all.

      In conversation about 5 months ago permalink
    • Embed this notice
      Erin 💽✨ (erincandescent@akko.erincandescent.net)'s status on Thursday, 23-Jan-2025 10:02:09 JST Erin 💽✨ Erin 💽✨
      in reply to
      • tom jennings
      • Tom Forsyth
      @mcc @tomjennings @TomF it was always a goal of clang to accept all of the same input that GCC (and Gas) did...
      In conversation about 5 months ago permalink
    • Embed this notice
      tom jennings (tomjennings@tldr.nettime.org)'s status on Thursday, 23-Jan-2025 10:02:11 JST tom jennings tom jennings
      in reply to
      • Tom Forsyth

      @TomF @mcc

      Assembler syntaxes are peculiar to each assembler. There never was any standardization there. It's still the 1950s in there!

      In conversation about 5 months ago permalink
    • Embed this notice
      Tom Forsyth (tomf@mastodon.gamedev.place)'s status on Thursday, 23-Jan-2025 10:02:13 JST Tom Forsyth Tom Forsyth
      in reply to
      • tom jennings

      @tomjennings @mcc That's the whole discussion. They do not have the *assembler syntax* which is a different thing.

      In conversation about 5 months ago permalink
    • Embed this notice
      tom jennings (tomjennings@tldr.nettime.org)'s status on Thursday, 23-Jan-2025 10:02:15 JST tom jennings tom jennings
      in reply to
      • Tom Forsyth

      @TomF

      I had all of those books, yards of them, as they came out. But no one but board designers used the data books, they're were tediously hardware oriented.

      What we all used were the cheatcharts. Foldout instruction set summaries.
      Oh how I wish I had my collection! I had probably 25, chips if written code for. Weird stuff like 8x300. Cosmac. Weird little Intel and moto.

      The cheatcharts are what you want. All dog-eared torn and coffee stained from use.

      But the datebook will have the official instructions descriptions and assembler mnemonics in excruciating detail.

      @mcc

      In conversation about 5 months ago permalink
    • Embed this notice
      Tom Forsyth (tomf@mastodon.gamedev.place)'s status on Thursday, 23-Jan-2025 10:02:16 JST Tom Forsyth Tom Forsyth
      in reply to
      • tom jennings

      @tomjennings @mcc Let us know if you find it.

      In conversation about 5 months ago permalink
    • Embed this notice
      tom jennings (tomjennings@tldr.nettime.org)'s status on Thursday, 23-Jan-2025 10:02:17 JST tom jennings tom jennings
      in reply to
      • Tom Forsyth

      @mcc

      Like this?http://bitsavers.org/components/intel/8086/9800722-03_The_8086_Family_Users_Manual_Oct79.pdf

      @TomF

      In conversation about 5 months ago permalink

Feeds

  • Activity Streams
  • RSS 2.0
  • Atom
  • Help
  • About
  • FAQ
  • TOS
  • Privacy
  • Source
  • Version
  • Contact

GNU social JP is a social network, courtesy of GNU social JP管理人. It runs on GNU social, version 2.0.2-dev, available under the GNU Affero General Public License.

Creative Commons Attribution 3.0 All GNU social JP content and data are available under the Creative Commons Attribution 3.0 license.