Skip to content

Commit 090c8da

Browse files
Eliyaanspytheman
authored andcommitted
fix comments
1 parent 87ebb04 commit 090c8da

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

vlib/v/gen/native/amd64.v

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,7 @@ fn (mut c Amd64) mov64u(reg Register, val u64) {
560560
c.g.write8(0xbf)
561561
}
562562
else {
563-
eprintln('unhandled mov64 ${reg}')
563+
eprintln('unhandled mov64u ${reg}')
564564
}
565565
}
566566
c.g.write64(val)
@@ -569,11 +569,12 @@ fn (mut c Amd64) mov64u(reg Register, val u64) {
569569

570570
fn (mut c Amd64) mov64(reg Register, val i64) {
571571
// see AMD64 Architecture Programmer's Manual Volume 3 about the MOV instruction to have a detailed explaination
572-
// if you wonder about the BF (B8+rq) there is an explaination about that in Table 2-2 (and a bit above in 2.5.2 Opcode Syntax)
572+
// about the BF (B8+rq) there is an explaination in Table 2-2 (and a bit above in 2.5.2 Opcode Syntax)
573573
// in short the 64 mov instruction is 0xB8 and after a 64 bits immediate value
574574
// but for the cpu to know which register to move the value to, it adds a number to B8
575575
// that number is the Value column in table 2-2
576576
// for example the bytecode for mov rdx is 0xB8 + 2 so 0xBA
577+
// 0x48 is the opcode for REX.W prefix for 64 bits MOV instruction
577578
match reg as Amd64Register {
578579
.rax {
579580
c.g.write8(0x48)

vlib/v/gen/native/expr.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ fn (mut g Gen) expr(node ast.Expr) {
6262
g.code_gen.infix_expr(node)
6363
}
6464
ast.IntegerLiteral {
65-
// Integer literal stores both signed and unsigned integers but sometimes unsigned integers are too big for i64 but not for u64
65+
// Integer literal stores both signed and unsigned integers, some unsigned integers are too big for i64 but not for u64
6666
println(node.val)
6767
if node.val[0] == `-` { // if the number is negative
6868
g.code_gen.mov64(g.code_gen.main_reg(), node.val.i64())

0 commit comments

Comments
 (0)