1
Fork 0
This commit is contained in:
Jan-Erik Rediger 2023-09-15 11:11:51 +00:00
commit cd55c3a57f
5 changed files with 65 additions and 0 deletions

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
0x??

8
Makefile Normal file
View 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
View 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
View 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
View file

@ -0,0 +1,6 @@
BITS 64
SECTION .text
global main
main:
xor eax, eax