Skip to content

Commit e4e0db1

Browse files
committed
fix(course/12,14): 适配 Zig 内联汇编语法变更
- 将 clobber 列表由 .{ .rcx = true, .r11 = true } 改为 "rcx", "r11" - 保持与最新 Zig 语法一致,提升代码兼容性
1 parent 2082539 commit e4e0db1

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

course/code/12/assembly.zig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ const inline_assembly = struct {
4141
: [ret] "={rax}" (-> usize),
4242
: [number] "{rax}" (number),
4343
[arg1] "{rdi}" (arg1),
44-
: .{ .rcx = true, .r11 = true }
44+
: "rcx", "r11"
4545
);
4646
}
4747

@@ -52,7 +52,7 @@ const inline_assembly = struct {
5252
[arg1] "{rdi}" (arg1),
5353
[arg2] "{rsi}" (arg2),
5454
[arg3] "{rdx}" (arg3),
55-
: .{ .rcx = true, .r11 = true }
55+
: "rcx", "r11"
5656
);
5757
}
5858
// #endregion inline_assembly

course/code/14/assembly.zig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ const inline_assembly = struct {
4141
: [ret] "={rax}" (-> usize),
4242
: [number] "{rax}" (number),
4343
[arg1] "{rdi}" (arg1),
44-
: .{ .rcx = true, .r11 = true }
44+
: "rcx", "r11"
4545
);
4646
}
4747

@@ -52,7 +52,7 @@ const inline_assembly = struct {
5252
[arg1] "{rdi}" (arg1),
5353
[arg2] "{rsi}" (arg2),
5454
[arg3] "{rdx}" (arg3),
55-
: .{ .rcx = true, .r11 = true }
55+
: "rcx", "r11"
5656
);
5757
}
5858
// #endregion inline_assembly

0 commit comments

Comments
 (0)