init
This commit is contained in:
commit
cd55c3a57f
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
0x??
|
8
Makefile
Normal file
8
Makefile
Normal file
|
@ -0,0 +1,8 @@
|
|||
%.o: %.asm
|
||||
nasm -felf64 $<
|
||||
%: %.o
|
||||
gcc -z noexecstack -o $@ $<
|
||||
|
||||
template:
|
||||
@echo "Copy template.asm to \$$name.asm and run \`make \$$name\`"
|
||||
.PHONY: template
|
25
flake.lock
Normal file
25
flake.lock
Normal file
|
@ -0,0 +1,25 @@
|
|||
{
|
||||
"nodes": {
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1694593561,
|
||||
"narHash": "sha256-WSaIQZ5s9N9bDFkEMTw6P9eaZ9bv39ZhsiW12GtTNM0=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "1697b7d480449b01111e352021f46e5879e47643",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"id": "nixpkgs",
|
||||
"type": "indirect"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
25
flake.nix
Normal file
25
flake.nix
Normal file
|
@ -0,0 +1,25 @@
|
|||
{
|
||||
description = "xchg rax, rax";
|
||||
|
||||
outputs = { self, nixpkgs, ... }:
|
||||
let
|
||||
supportedSystems = [ "x86_64-linux" ];
|
||||
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
|
||||
in
|
||||
{
|
||||
devShells = forAllSystems (system:
|
||||
let
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
in
|
||||
{
|
||||
default = pkgs.mkShell {
|
||||
buildInputs = with pkgs;
|
||||
[
|
||||
gdb
|
||||
gnumake
|
||||
nasm
|
||||
];
|
||||
};
|
||||
});
|
||||
};
|
||||
}
|
6
template.asm
Normal file
6
template.asm
Normal file
|
@ -0,0 +1,6 @@
|
|||
BITS 64
|
||||
SECTION .text
|
||||
global main
|
||||
|
||||
main:
|
||||
xor eax, eax
|
Loading…
Reference in a new issue