Skip to content

Commit abe45f6

Browse files
committed
Translate untranslated lines in asm.md
1 parent 4980063 commit abe45f6

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/unsafe/asm.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -601,12 +601,24 @@ assert_eq!(x, 0xabab);
601601
# }
602602
```
603603

604+
<!--
604605
In this example, we use the `reg_abcd` register class to restrict the register allocator to the 4 legacy x86 registers (`ax`, `bx`, `cx`, `dx`) of which the first two bytes can be addressed independently.
606+
-->
607+
この例では、`reg_abcd`レジスタクラスを用いて、レジスタアロケータを4つのレガシーなx86レジスタ (`ax`, `bx`, `cx`, `dx`) に制限しています。このうち最初の2バイトは独立して指定できます。
605608

609+
<!--
606610
Let us assume that the register allocator has chosen to allocate `x` in the `ax` register.
607611
The `h` modifier will emit the register name for the high byte of that register and the `l` modifier will emit the register name for the low byte. The asm code will therefore be expanded as `mov ah, al` which copies the low byte of the value into the high byte.
612+
-->
613+
レジスタアロケータが`x``ax`レジスタに割り当てることにしたと仮定しましょう。
614+
`h`修飾子はそのレジスタの上位バイトのレジスタ名を出力し、`l`修飾子は下位バイトのレジスタ名を出力します。
615+
したがって、このアセンブリコードは`mov ah, al`に展開され、値の下位バイトを上位バイトにコピーします。
608616

617+
<!--
609618
If you use a smaller data type (e.g. `u16`) with an operand and forget to use template modifiers, the compiler will emit a warning and suggest the correct modifier to use.
619+
-->
620+
より小さなデータ型(例:`u16`)をオペランドに利用し、テンプレート修飾子を使い忘れた場合、
621+
コンパイラは警告を出力し、正しい修飾子を提案してくれます。
610622

611623
## Memory address operands
612624

0 commit comments

Comments
 (0)