2

I want to create my first assembler so I can program my own program languages, my own OS and so on. There's just one problem:

I can't find an instruction set for the ryzen 7 2700. I already found out that it uses the zen+ architecture but I couldn't find something for this either. Does anyone know where I can find a full instruction set with all operations the CPU is capable of and all register names and so on? This would be really helpful.

By the way: do you know an open source code of an assembler for me to study? I'm new to this topic so I first have to learn a lot about it and think this would be an opportunity to learn how the coding of an assembler is done. I would also be thankful for more stuff to read and other things I can learn from!

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Dzenan
  • 43
  • 2
  • 6
  • 3
    You even tagged it ... x86-64 is the instruction set. As to what extensions it supports you can always check your own cpu if you have one. Otherwise it's not hard to find online e.g. at [wikichip](https://en.wikichip.org/wiki/amd/ryzen_7/2700) or [cpu world](http://www.cpu-world.com/CPUs/Zen/AMD-Ryzen%207%202700.html) – Jester Feb 04 '19 at 21:39
  • 2
    For an open source assembler, it might be interesting to study the source code of [nasm](http://nasm.us). Note that writing an x86 assembler is mainly an exercise in patience. x86 has quite a few instructions and you need to implement them all (or at least all you plan to use). – fuz Feb 04 '19 at 22:03
  • re: *all* instructions / registers: that would include undocumented stuff. Possibly relevant: https://www.blackhat.com/docs/us-17/thursday/us-17-Domas-Breaking-The-x86-Instruction-Set-wp.pdf. Also http://www.undocumented.info/oldinfo/undocumented/static/files/content/lst_intel_insns/byname.php claims to be a list of "Instructions In the AMD Opcode Map", and does include SALC (Set AL from Carry, undocumented but still supported by Intel in every CPU since 8086, at least in 32-bit mode.) – Peter Cordes Feb 04 '19 at 22:59

1 Answers1

5

The manuals can be good sources. If you aren't familiar check them out. There are better introductory sources, but these are where you will likely need to turn for the raw details.

  1. AMD's page of manuals.
  2. AMD's General Purpose Instructions manual.
  3. Intel's x86 manual.

Intel's x86 and AMD's x86 aren't quite the same, but the core of them are nearly the same.

ruthafjord
  • 2,037
  • 1
  • 11
  • 14