0

I have the following very simple Y86 program in file foo.ys:

irmovl $1, %eax

Running the following command:

$ yas foo.ys

I get the following (utterly useless) feedback from yas:

Invalid Line

So--I have a few questions:

  1. Where does the Y86 documentation live?
  2. What is invalid about the above program?
StudentsTea
  • 329
  • 4
  • 16
  • 1
    1. google, for example [y86tutoring](https://y86tutoring.wordpress.com/y86-ia/) 2. nothing, works here. – Jester Mar 21 '18 at 14:35
  • 1
    Mainstream (real) architectures might be more complicated, but they often have better toolchains that give (slightly) more useful error messages. Assembler error messages are often pretty vague, but not *that* vague. – Peter Cordes Mar 21 '18 at 14:41
  • @Jester - What version of yas are you using? – StudentsTea Mar 21 '18 at 14:42
  • I downloaded [this one](https://www.cs.unm.edu/~bradykey/sim341Student.tar), it has no version number. – Jester Mar 21 '18 at 14:50

2 Answers2

1

Looks like you are using the 64 bit version, y86-64. I have checked, that in fact produces the given error message. While x86-64 does support 32 bit, apparently y86-64 doesn't. You should use irmovq $1, %rax instead (note the change of instruction suffix and register prefix).

Jester
  • 56,577
  • 4
  • 81
  • 125
  • Can you please take a look https://stackoverflow.com/questions/70919423/y86-instructions-set-create-confusion – Encipher Feb 03 '22 at 00:07
-1

It looks like Y86 is supposed to be a subset of the IA-32, whose documentation can be found here.

It seems, in IA-32, move instructions ending in l don't move long data types; they do conditional moves and things irrelevant to Y86.

Yet, some versions of Y86 support irmovl, some don't.

If you're using a 64-bit version of yas, use quadword instructions and addresses:

irmovq $1, %rax
StudentsTea
  • 329
  • 4
  • 16
  • Sounds like you have a 64 bit version. Those use quadwords, but then your register should be `rax` not `eax`. – Jester Mar 21 '18 at 15:29
  • @StudentsTea: it's IA-32 (Intel Architecture), not AI. Not my downvote, but this answer isn't really useful and you should probably delete it. (It also has errors. x86 doesn't have `movl`, you're thinking of `cmovl`.) Intel x86 docs aren't really useful for y86. Maybe AT&T-syntax docs would be, but with y86 or y86-64 only supporting a fixed operand size (or maybe also byte?) real x86 manuals would just be confusing. – Peter Cordes Mar 21 '18 at 16:05