1
0
mirror of https://github.com/chylex/Advent-of-Code.git synced 2025-04-09 19:15:44 +02:00

Setup x64 ASM

This commit is contained in:
chylex 2022-02-11 08:13:27 +01:00
parent abb0bcaa20
commit 4ccd7125e8
Signed by: chylex
GPG Key ID: 4DE42C8F19A80548
5 changed files with 20 additions and 5 deletions

11
.idea/cmake.xml Normal file
View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CMakeSharedSettings">
<configurations>
<configuration PROFILE_NAME="Debug x86" ENABLED="true" CONFIG_NAME="Debug" TOOLCHAIN_NAME="Visual Studio x86" />
<configuration PROFILE_NAME="Release x86" ENABLED="true" CONFIG_NAME="Release" TOOLCHAIN_NAME="Visual Studio x86" />
<configuration PROFILE_NAME="Debug x64" ENABLED="true" CONFIG_NAME="Debug" TOOLCHAIN_NAME="Visual Studio x64" />
<configuration PROFILE_NAME="Release x64" ENABLED="true" CONFIG_NAME="Release" TOOLCHAIN_NAME="Visual Studio x64" />
</configurations>
</component>
</project>

View File

@ -1,5 +1,5 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="2015 - Day 01" type="CMakeRunConfiguration" factoryName="Application" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" WORKING_DIR="file://$PROJECT_DIR$/2015/01" PASS_PARENT_ENVS_2="true" PROJECT_NAME="AOC" TARGET_NAME="AOC_2015_01" CONFIG_NAME="Debug" RUN_TARGET_PROJECT_NAME="AOC" RUN_TARGET_NAME="AOC_2015_01">
<configuration default="false" name="2015 - Day 01" type="CMakeRunConfiguration" factoryName="Application" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" WORKING_DIR="file://$PROJECT_DIR$/2015/01" PASS_PARENT_ENVS_2="true" PROJECT_NAME="AOC" TARGET_NAME="AOC_2015_01" CONFIG_NAME="Debug x86" RUN_TARGET_PROJECT_NAME="AOC" RUN_TARGET_NAME="AOC_2015_01">
<method v="2">
<option name="com.jetbrains.cidr.execution.CidrBuildBeforeRunTaskProvider$BuildBeforeRunTask" enabled="true" />
</method>

6
2015/.gitignore vendored
View File

@ -1,2 +1,4 @@
/cmake-build-debug/
/cmake-build-release/
/cmake-build-debug-x86/
/cmake-build-debug-x64/
/cmake-build-release-x86/
/cmake-build-release-x64/

View File

@ -56,7 +56,7 @@ char* readFile(const char* filename) {
fclose(file);
if (position != fileSize) {
printf("Error reading whole file, read only %d bytes out of %d\n", position, fileSize);
printf("Error reading whole file, read only %zu bytes out of %d\n", position, fileSize);
free(contents);
return NULL;
}

View File

@ -14,7 +14,9 @@ The source code is in `main.kt`. The run configuration executes the `main()` met
## NASM x86 / x64 Assembly
The repository contains a CMake project (`CMakeLists.txt`) in the respective year's folder, which sets up every day as a CMake subproject. You should be able to load the CMake project into [CLion](https://www.jetbrains.com/clion/).
The repository contains a CMake project (`CMakeLists.txt`) in the respective year's folder, which sets up every day as a CMake subproject. You should be able to load the CMake project into [CLion](https://www.jetbrains.com/clion/), as long as you have two toolchains set up:
- Visual Studio x86
- Visual Studio x64
The source code is in `main.c`, which is either in the puzzle's own folder, or in `utils` if no adjustments are needed. By default, `main.c` reads the whole input file into a buffer, and passes it as a parameter to the `entryPoint` function defined in `main.asm` which implements the logic and output of each puzzle.