Skip to content

Commit

Permalink
ini
Browse files Browse the repository at this point in the history
  • Loading branch information
ywh555hhh committed Jul 25, 2024
1 parent f39cf2d commit 3c5776a
Show file tree
Hide file tree
Showing 23 changed files with 1,039 additions and 0 deletions.
Binary file added .DS_Store
Binary file not shown.
27 changes: 27 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/ubuntu
{
"name": "Ubuntu",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/base:jammy",
"features": {
"ghcr.io/devcontainers/features/common-utils:2": {},
"ghcr.io/nils-geistmann/devcontainers-features/zsh:0": {}
},

// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "uname -a",

// Configure tool-specific properties.
// "customizations": {},

// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
"remoteUser": "root"
}
12 changes: 12 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for more information:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
# https://containers.dev/guide/dependabot

version: 2
updates:
- package-ecosystem: "devcontainers"
directory: "/"
schedule:
interval: weekly
Binary file added asm/hello
Binary file not shown.
Binary file added asm/hello.o
Binary file not shown.
17 changes: 17 additions & 0 deletions asm/hello.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
.global _start

.section .data
hello:
.ascii "Hello, World!\n"

.section .text
_start:
mov x0, 1 // 文件描述符 (stdout)
ldr x1, =hello // 字符串地址
mov x2, 13 // 字符串长度
mov x8, 64 // 系统调用号 (sys_write)
svc 0 // 发起系统调用

mov x8, 93 // 系统调用号 (sys_exit)
mov x0, 0 // 返回码
svc 0 // 发起系统调用
Binary file added c/average
Binary file not shown.
16 changes: 16 additions & 0 deletions c/average.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#include <stdio.h>

int main() {
int numbers[] = {10, 20, 30, 40, 50};
int sum = 0;
int n = sizeof(numbers) / sizeof(numbers[0]);

for(int i = 0; i < n; i++) {
sum += numbers[i];
}

double average = (double)sum / n;
printf("The average is: %.2f\n", average);

return 0;
}
Binary file added c/hello
Binary file not shown.
10 changes: 10 additions & 0 deletions c/hello.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// hello.c
#include <stdio.h>

// 定义一个宏 MESSAGE,它代表 "Hello, World!"
#define MESSAGE "Hello, World!"

int main() {
printf("%s\n", MESSAGE); // 使用宏 MESSAGE
return 0;
}
Loading

0 comments on commit 3c5776a

Please sign in to comment.