From ab0686ba2d145e096a273c52e5e74611ce2ec359 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 7 May 2023 12:30:26 +0000 Subject: [PATCH 01/14] build(deps): bump actions/upload-artifact from 2 to 3 Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 2 to 3. - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/v2...v3) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/create_installers.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/create_installers.yml b/.github/workflows/create_installers.yml index ea27a2c7..a72a1448 100644 --- a/.github/workflows/create_installers.yml +++ b/.github/workflows/create_installers.yml @@ -37,13 +37,13 @@ jobs: cd .. - name: Archive debian installer - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: debian-installer path: memeassembly_${{ github.event.inputs.version }}_amd64.deb - name: Archive rpm installer - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: rpm-installer path: memeassembly-${{ github.event.inputs.version }}.x86_64.rpm @@ -52,7 +52,7 @@ jobs: run: make windows - name: Upload Windows executable - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: memeasm.exe path: memeasm.exe \ No newline at end of file From 65120aad0233aadcafbd9657b7c5d8051f444cc4 Mon Sep 17 00:00:00 2001 From: Tobias Kamm <47085077+kammt@users.noreply.github.com> Date: Sun, 7 May 2023 14:55:21 +0200 Subject: [PATCH 02/14] publish-aur.yml: Repo name as variable --- .github/workflows/publish-aur.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish-aur.yml b/.github/workflows/publish-aur.yml index 58e7a6db..03ebe333 100644 --- a/.github/workflows/publish-aur.yml +++ b/.github/workflows/publish-aur.yml @@ -21,7 +21,7 @@ jobs: - name: Replace 256SUM in PKGBUILD file with parameter run: | sudo apt-get install wget - wget https://github.com/kammt/MemeAssembly/archive/refs/tags/$GITHUB_REF.tar.gz + wget https://github.com/${{ github.repository }}/archive/refs/tags/$GITHUB_REF.tar.gz sed -i 's/256SUM/$(sha256sum $GITHUB_REF.tar.gz | cut -d " " -f 1)/g' PKGBUILD - name: Output PKGBUILD for debugging purposes From 5530f8d1765f8ab73a35d95d81300be72eeb398c Mon Sep 17 00:00:00 2001 From: Tobias Kamm <47085077+kammt@users.noreply.github.com> Date: Sun, 7 May 2023 15:04:10 +0200 Subject: [PATCH 03/14] publish-aur.yml: Allow manual dispatch --- .github/workflows/publish-aur.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish-aur.yml b/.github/workflows/publish-aur.yml index 03ebe333..e792e570 100644 --- a/.github/workflows/publish-aur.yml +++ b/.github/workflows/publish-aur.yml @@ -3,15 +3,24 @@ name: Publish to AUR on: release: types: [published] + workflow_dispatch: + inputs: + version: + description: 'Repository Tag (e.g. v1.6)' + required: true + jobs: aur-publish: runs-on: ubuntu-latest - steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - uses: actions/checkout@v2 + - name: Set GITHUB_REF correctly if manually run + if: ${{ github.event_name == 'workflow_dispatch' }} + run: export GITHUB_REF=${{ github.event.inputs.version }} + - name: Replace VERSION_STRING in PKGBUILD file with parameter run: sed -i 's/VERSION_STRING/${GITHUB_REF:1}/g' PKGBUILD From b08287f4b9ff8dfcbbb38c7739be17589257acf9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 7 May 2023 13:04:44 +0000 Subject: [PATCH 04/14] build(deps): bump actions/checkout from 2 to 3 Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v2...v3) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/build_test.yml | 6 +++--- .github/workflows/codeql-analysis.yml | 2 +- .github/workflows/compilation_test.yml | 6 +++--- .github/workflows/compile_and_run_test.yml | 6 +++--- .github/workflows/create_installers.yml | 2 +- .github/workflows/publish-aur.yml | 2 +- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build_test.yml b/.github/workflows/build_test.yml index eb01f8b2..d5178dc4 100644 --- a/.github/workflows/build_test.yml +++ b/.github/workflows/build_test.yml @@ -22,7 +22,7 @@ jobs: # Steps represent a sequence of tasks that will be executed as part of the job steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Build Linux run: make CFLAGS+=-Werror debug @@ -33,7 +33,7 @@ jobs: # Steps represent a sequence of tasks that will be executed as part of the job steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Run Makefile shell: powershell @@ -47,7 +47,7 @@ jobs: steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Build MacOS run: make CFLAGS+=-Werror debug diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 05e3263e..69a6086d 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -27,7 +27,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL diff --git a/.github/workflows/compilation_test.yml b/.github/workflows/compilation_test.yml index 42546b1e..fd75a303 100644 --- a/.github/workflows/compilation_test.yml +++ b/.github/workflows/compilation_test.yml @@ -20,7 +20,7 @@ jobs: # Steps represent a sequence of tasks that will be executed as part of the job steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 # Runs a single command using the runners shell - name: compile the project @@ -49,7 +49,7 @@ jobs: # Steps represent a sequence of tasks that will be executed as part of the job steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Compile memeasm shell: powershell @@ -71,7 +71,7 @@ jobs: # Steps represent a sequence of tasks that will be executed as part of the job steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 # Runs a single command using the runners shell - name: compile the project diff --git a/.github/workflows/compile_and_run_test.yml b/.github/workflows/compile_and_run_test.yml index 57394f4a..2cb06856 100644 --- a/.github/workflows/compile_and_run_test.yml +++ b/.github/workflows/compile_and_run_test.yml @@ -15,7 +15,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Compile the project run: make debug @@ -30,7 +30,7 @@ jobs: runs-on: windows-2019 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Compile memeasm shell: powershell @@ -50,7 +50,7 @@ jobs: runs-on: macos-11 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Compile the project run: make debug diff --git a/.github/workflows/create_installers.yml b/.github/workflows/create_installers.yml index ea27a2c7..649d2419 100644 --- a/.github/workflows/create_installers.yml +++ b/.github/workflows/create_installers.yml @@ -13,7 +13,7 @@ jobs: steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Install mingw-w64 run: sudo apt-get install mingw-w64 diff --git a/.github/workflows/publish-aur.yml b/.github/workflows/publish-aur.yml index e792e570..c2547581 100644 --- a/.github/workflows/publish-aur.yml +++ b/.github/workflows/publish-aur.yml @@ -15,7 +15,7 @@ jobs: runs-on: ubuntu-latest steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Set GITHUB_REF correctly if manually run if: ${{ github.event_name == 'workflow_dispatch' }} From 21ede482192072bb350b21d13fc865a8162b2e69 Mon Sep 17 00:00:00 2001 From: Tobias Kamm <47085077+kammt@users.noreply.github.com> Date: Sun, 7 May 2023 15:25:15 +0200 Subject: [PATCH 05/14] publish-aur.yml: Hopefully fixed automatic and manual run --- .github/workflows/publish-aur.yml | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/.github/workflows/publish-aur.yml b/.github/workflows/publish-aur.yml index c2547581..50899503 100644 --- a/.github/workflows/publish-aur.yml +++ b/.github/workflows/publish-aur.yml @@ -6,7 +6,7 @@ on: workflow_dispatch: inputs: version: - description: 'Repository Tag (e.g. v1.6)' + description: 'Repository Tag (without v, e.g. 1.6)' required: true @@ -17,21 +17,28 @@ jobs: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - uses: actions/checkout@v3 - - name: Set GITHUB_REF correctly if manually run - if: ${{ github.event_name == 'workflow_dispatch' }} - run: export GITHUB_REF=${{ github.event.inputs.version }} - - name: Replace VERSION_STRING in PKGBUILD file with parameter - run: sed -i 's/VERSION_STRING/${GITHUB_REF:1}/g' PKGBUILD + if: ${{ github.event_name == 'release' }} + run: sed -i 's/VERSION_STRING/${GITHUB_REF:11}/g' PKGBUILD + + - name: Replace VERSION_STRING in PKGBUILD file with parameter + if: ${{ github.event_name == 'workflow_dispath' }} + run: sed -i 's/VERSION_STRING/${{ github.event.inputs.version }}/g' PKGBUILD - name: Replace PKGREL in PKGBUILD file with parameter run: sed -i 's/PKGREL/1/g' PKGBUILD - name: Replace 256SUM in PKGBUILD file with parameter + if: ${{ github.event_name == 'release' }} run: | - sudo apt-get install wget - wget https://github.com/${{ github.repository }}/archive/refs/tags/$GITHUB_REF.tar.gz + wget https://github.com/${{ github.repository }}/archive/$GITHUB_REF.tar.gz sed -i 's/256SUM/$(sha256sum $GITHUB_REF.tar.gz | cut -d " " -f 1)/g' PKGBUILD + + - name: Replace 256SUM in PKGBUILD file with parameter + if: ${{ github.event_name == 'workflow_dispatch' }} + run: | + wget https://github.com/${{ github.repository }}/archive/refs/tags/v${{ github.event.inputs.version }}.tar.gz + sed -i 's/256SUM/$(sha256sum v${{ github.event.inputs.version }}.tar.gz | cut -d " " -f 1)/g' PKGBUILD - name: Output PKGBUILD for debugging purposes run: cat PKGBUILD From 13619a75e91b9ad007e823d5862d1899a5cb27b2 Mon Sep 17 00:00:00 2001 From: Tobias Kamm <47085077+kammt@users.noreply.github.com> Date: Sun, 7 May 2023 15:53:59 +0200 Subject: [PATCH 06/14] publish-aur.yml: pkgrel as variable, change ' to " in sed --- .github/workflows/publish-aur.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish-aur.yml b/.github/workflows/publish-aur.yml index 50899503..8a1b5f9a 100644 --- a/.github/workflows/publish-aur.yml +++ b/.github/workflows/publish-aur.yml @@ -8,6 +8,9 @@ on: version: description: 'Repository Tag (without v, e.g. 1.6)' required: true + pkgrel: + required: true + default: "1" jobs: @@ -26,19 +29,25 @@ jobs: run: sed -i 's/VERSION_STRING/${{ github.event.inputs.version }}/g' PKGBUILD - name: Replace PKGREL in PKGBUILD file with parameter + if: ${{ github.event_name == 'release' }} run: sed -i 's/PKGREL/1/g' PKGBUILD + - name: Replace PKGREL in PKGBUILD file with parameter + if: ${{ github.event_name == 'workflow_dispath' }} + run: sed -i 's/PKGREL/${{ github.event.inputs.pkgrel }}/g' PKGBUILD + - name: Replace 256SUM in PKGBUILD file with parameter if: ${{ github.event_name == 'release' }} run: | wget https://github.com/${{ github.repository }}/archive/$GITHUB_REF.tar.gz - sed -i 's/256SUM/$(sha256sum $GITHUB_REF.tar.gz | cut -d " " -f 1)/g' PKGBUILD + export CHECKSUM= + sed -i "s/256SUM/$(sha256sum $GITHUB_REF.tar.gz | cut -d " " -f 1)/g" PKGBUILD - name: Replace 256SUM in PKGBUILD file with parameter if: ${{ github.event_name == 'workflow_dispatch' }} run: | wget https://github.com/${{ github.repository }}/archive/refs/tags/v${{ github.event.inputs.version }}.tar.gz - sed -i 's/256SUM/$(sha256sum v${{ github.event.inputs.version }}.tar.gz | cut -d " " -f 1)/g' PKGBUILD + sed -i "s/256SUM/$(sha256sum v${{ github.event.inputs.version }}.tar.gz | cut -d " " -f 1)/g" PKGBUILD - name: Output PKGBUILD for debugging purposes run: cat PKGBUILD From 7fa4c05ba424391f174cd3e5415db95c60df7ec6 Mon Sep 17 00:00:00 2001 From: Tobias Kamm <47085077+kammt@users.noreply.github.com> Date: Sun, 7 May 2023 15:58:32 +0200 Subject: [PATCH 07/14] publish-aur.yml: Typo --- .github/workflows/publish-aur.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish-aur.yml b/.github/workflows/publish-aur.yml index 8a1b5f9a..46a7a439 100644 --- a/.github/workflows/publish-aur.yml +++ b/.github/workflows/publish-aur.yml @@ -25,7 +25,7 @@ jobs: run: sed -i 's/VERSION_STRING/${GITHUB_REF:11}/g' PKGBUILD - name: Replace VERSION_STRING in PKGBUILD file with parameter - if: ${{ github.event_name == 'workflow_dispath' }} + if: ${{ github.event_name == 'workflow_dispatch' }} run: sed -i 's/VERSION_STRING/${{ github.event.inputs.version }}/g' PKGBUILD - name: Replace PKGREL in PKGBUILD file with parameter @@ -33,7 +33,7 @@ jobs: run: sed -i 's/PKGREL/1/g' PKGBUILD - name: Replace PKGREL in PKGBUILD file with parameter - if: ${{ github.event_name == 'workflow_dispath' }} + if: ${{ github.event_name == 'workflow_dispatch' }} run: sed -i 's/PKGREL/${{ github.event.inputs.pkgrel }}/g' PKGBUILD - name: Replace 256SUM in PKGBUILD file with parameter From a41c928fb45ccfb70ffc291783cf039c3aff82b5 Mon Sep 17 00:00:00 2001 From: Tobias Kamm <47085077+kammt@users.noreply.github.com> Date: Sun, 7 May 2023 16:02:26 +0200 Subject: [PATCH 08/14] PKGBUILD: Correct usage of DESTDIR --- PKGBUILD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PKGBUILD b/PKGBUILD index 230a661d..54d8d7e4 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -13,5 +13,5 @@ sha256sums=('256SUM') package() { cd "MemeAssembly-$pkgver" - make DESTDIR="$pkgdir/usr/local/bin" install + make DESTDIR="$pkgdir" install } From d01d340a07fc51a4e631a6296dca7fa865c761e6 Mon Sep 17 00:00:00 2001 From: Tobias Kamm <47085077+kammt@users.noreply.github.com> Date: Tue, 9 May 2023 00:07:43 +0200 Subject: [PATCH 09/14] nfpm: Simplified uninstallation script --- nfpm/postremove.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nfpm/postremove.sh b/nfpm/postremove.sh index 706874b3..c36d4b42 100755 --- a/nfpm/postremove.sh +++ b/nfpm/postremove.sh @@ -1,2 +1,2 @@ #!/bin/bash -sudo make DESTDIR=$(dirname $(which memeasm)) uninstall \ No newline at end of file +sudo make uninstall From b7dfaedf4502f7cb60eaebb63ad4e4823db1a238 Mon Sep 17 00:00:00 2001 From: Tobias Kamm <47085077+kammt@users.noreply.github.com> Date: Tue, 9 May 2023 00:12:30 +0200 Subject: [PATCH 10/14] nfpm.yaml: Update package name --- nfpm/nfpm.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nfpm/nfpm.yaml b/nfpm/nfpm.yaml index e23c1da5..bb55f521 100644 --- a/nfpm/nfpm.yaml +++ b/nfpm/nfpm.yaml @@ -1,7 +1,7 @@ # # check https://nfpm.goreleaser.com/configuration for detailed usage # -name: "memeassembly" +name: "memeasm" arch: "amd64" platform: "linux" version: VERSION_STRING From 4b94378ca498a0d2ca16d2a3678637f151999046 Mon Sep 17 00:00:00 2001 From: Tobias Kamm <47085077+kammt@users.noreply.github.com> Date: Tue, 9 May 2023 00:15:42 +0200 Subject: [PATCH 11/14] create_installers.yml: Update package name, removed Windows compilation --- .github/workflows/create_installers.yml | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/.github/workflows/create_installers.yml b/.github/workflows/create_installers.yml index 1b135bd2..ff42b10f 100644 --- a/.github/workflows/create_installers.yml +++ b/.github/workflows/create_installers.yml @@ -14,9 +14,6 @@ jobs: steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - uses: actions/checkout@v3 - - - name: Install mingw-w64 - run: sudo apt-get install mingw-w64 - name: Install nfpm run: | @@ -39,20 +36,11 @@ jobs: - name: Archive debian installer uses: actions/upload-artifact@v3 with: - name: debian-installer - path: memeassembly_${{ github.event.inputs.version }}_amd64.deb + name: memeasm_${{ github.event.inputs.version }}_amd64.deb + path: memeasm_${{ github.event.inputs.version }}_amd64.deb - name: Archive rpm installer uses: actions/upload-artifact@v3 with: - name: rpm-installer - path: memeassembly-${{ github.event.inputs.version }}.x86_64.rpm - - - name: Compile for Windows - run: make windows - - - name: Upload Windows executable - uses: actions/upload-artifact@v3 - with: - name: memeasm.exe - path: memeasm.exe \ No newline at end of file + name: memeasm-${{ github.event.inputs.version }}.x86_64.rpm + path: memeasm-${{ github.event.inputs.version }}.x86_64.rpm From 69623762449234b30eae6d340ce8cad447a3c9d6 Mon Sep 17 00:00:00 2001 From: Aamin Gem Date: Sun, 11 Jun 2023 17:48:43 +0900 Subject: [PATCH 12/14] Added instructions on contribution --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index 4548c629..107c12fb 100644 --- a/README.md +++ b/README.md @@ -107,6 +107,18 @@ To do so, insert this code block into your ReadMe file: \ ## Contributing Contributions to this repository are welcome! Especially ideas for new (and hopefully idiotic) commands. To add a new command, either create an issue with the tag "new-command" or add it yourself and create a pull-request. +### How to add new commands? +This Is No Kinder Spiel, Old Bean! + +So, you reckon you've got the moxie to add a new command, eh? Brilliant! Here's the plan: + +1. **Command Crafting:** First, pop over to `compiler/compiler.c` and have a butcher's at the `commandList` array. Once you've spotted it, add your brand spanking new command to the squad. + +2. **The Count-Up:** Now that your new command is showing its colours, you'll need to keep the books straight. Duck into `compiler/commands.h` and notch up the `NUMBER_OF_COMMANDS` by the number of new commands you've added. Keeping tally matters! + +3. **Fingers Crossed:** Done everything by the book? Now cross your fingers, touch wood, and maybe toss a coin into the wishing well. You've played your hand, now it's time to let the code fairies sprinkle their magic! + + ### Current Contributors: ![GitHub Contributors Image](https://contrib.rocks/image?repo=kammt/MemeAssembly) From 4864001ba59406b32d3a778b862e31101c805625 Mon Sep 17 00:00:00 2001 From: Aamin Gem Date: Sun, 11 Jun 2023 17:49:05 +0900 Subject: [PATCH 13/14] Added a fuck tonne of new commands --- compiler/commands.h | 2 +- compiler/compiler.c | 96 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 97 insertions(+), 1 deletion(-) diff --git a/compiler/commands.h b/compiler/commands.h index e3b8c4f4..0f4df2b9 100644 --- a/compiler/commands.h +++ b/compiler/commands.h @@ -25,7 +25,7 @@ along with MemeAssembly. If not, see . #include #include -#define NUMBER_OF_COMMANDS 46 +#define NUMBER_OF_COMMANDS 60 #define MAX_PARAMETER_COUNT 2 #define OR_DRAW_25_OPCODE NUMBER_OF_COMMANDS - 2; diff --git a/compiler/compiler.c b/compiler/compiler.c index b19b8f1c..fd575dbc 100644 --- a/compiler/compiler.c +++ b/compiler/compiler.c @@ -84,6 +84,34 @@ const struct command commandList[NUMBER_OF_COMMANDS] = { .analysisFunction = NULL, .translationPattern = "pop {0}" }, + { + .pattern = "knock knock, who's there? {p}", + .usedParameters = 1, + .allowedParamTypes = {PARAM_REG | PARAM_DECIMAL}, + .analysisFunction = NULL, + .translationPattern = "mov rax, [rip + {0}]" + }, + { + .pattern = "why don't you come on in, {p}", + .usedParameters = 1, + .allowedParamTypes = {PARAM_REG | PARAM_DECIMAL}, + .analysisFunction = NULL, + .translationPattern = "mov [rip + {0}], rax" + }, + { + .pattern = "big brain time {p} {p}", + .usedParameters = 2, + .allowedParamTypes = {PARAM_REG, PARAM_REG | PARAM_DECIMAL}, + .analysisFunction = NULL, + .translationPattern = "mov [rip + {0}], {1}" + }, + { + .pattern = "execute order 66 {p}", + .usedParameters = 1, + .allowedParamTypes = {PARAM_REG | PARAM_DECIMAL}, + .analysisFunction = NULL, + .translationPattern = "mov rax, 66\n\tmov [rip + {0}], rax" + }, ///Logical Operations { @@ -117,6 +145,20 @@ const struct command commandList[NUMBER_OF_COMMANDS] = { .analysisFunction = NULL, .translationPattern = "mov {0}, {1}" }, + { + .pattern = "I don't feel so good", + .usedParameters = 0, + .analysisFunction = NULL, + .translationPattern = "xor rax, rax\n\txor rbx, rbx\n\txor rcx, rcx\n\txor rdx, rdx\n\txor rsi, rsi\n\txor rdi, rdi\n\txor rbp, rbp\n\txor rsp, rsp\n\txor r8, r8\n\txor r9, r9\n\txor r10, r10\n\txor r11, r11\n\txor r12, r12\n\txor r13, r13\n\txor r14, r14\n\txor r15, r15" + }, + { + .pattern = "just a little switcheroo {p} {p}", + .usedParameters = 2, + .allowedParamTypes = {PARAM_REG, PARAM_REG}, + .analysisFunction = NULL, + .translationPattern = "xor {0}, {1}\nxor {1}, {0}\nxor {0}, {1}" + }, + ///Arithmetic operations { @@ -274,6 +316,12 @@ const struct command commandList[NUMBER_OF_COMMANDS] = { .analysisFunction = NULL, .translationPattern = ".LSamePicture_{F}:" }, + { + .pattern = "deja vu", + .usedParameters = 0, + .analysisFunction = NULL, + .translationPattern = "jmp main" + }, ///IO-Operations { @@ -376,6 +424,47 @@ const struct command commandList[NUMBER_OF_COMMANDS] = { .analysisFunction = NULL, .translationPattern = "syscall" }, + { + .pattern = "why are we still here, just to suffer", + .usedParameters = 0, + .analysisFunction = NULL, + .translationPattern = "mov eax, 0\n\tidiv eax" + }, + { + .pattern = "you're in the wrong neighbourhood {p}", + .usedParameters = 1, + .allowedParamTypes = {PARAM_REG64 | PARAM_REG32 | PARAM_REG16}, + .analysisFunction = NULL, + .translationPattern = "rdrand {0}\n\tjmp {0}" + }, + { + .pattern = "stop, you violated the law", + .usedParameters = 0, + .analysisFunction = NULL, + .translationPattern = "hlt" + }, + { + .pattern = "into the multiverse {p}", + .usedParameters = 1, + .allowedParamTypes = {PARAM_REG64 | PARAM_REG32 | PARAM_REG16}, + .analysisFunction = NULL, + .translationPattern = "mov ecx, {0}\nmultiverse:\nadd ecx, ecx\nsub ecx, 2\ncmp ecx, 0\njnz multiverse\ninc ecx\ndec ecx\nmov {0}, ecx\npushad\npopad\nmov eax, 2\ndiv eax" + }, + { + .pattern = "you're invited to suffer {p}", + .usedParameters = 1, + .allowedParamTypes = {PARAM_REG64 | PARAM_REG32 | PARAM_REG16}, + .analysisFunction = NULL, + .translationPattern = "mov eax, {0}\nsuffer:\ncmp eax, 666\nje end_suffer\nadd eax, 1\njmp suffer\nend_suffer:\npush eax\npop eax\nxor eax, eax\ninc eax\nadd eax, 2\ndec eax\ndec eax\nmov {0}, eax" + }, + { + .pattern = "hollup, let him cook {p}", + .usedParameters = 1, + .allowedParamTypes = {PARAM_REG64 | PARAM_REG32 | PARAM_REG16}, + .analysisFunction = NULL, + .translationPattern = "mov eax, 0\nmov ebx, 0\nmov ecx, 0\ncook:\ninc eax\ninc ebx\ninc ecx\nmov edx, eax\ncmp edx, {0}\njne cook\n" + }, + ///Debug commands { @@ -384,6 +473,13 @@ const struct command commandList[NUMBER_OF_COMMANDS] = { .analysisFunction = NULL, .translationPattern = "int3" }, + { + .pattern = "I'm feeling lucky {p}", + .usedParameters = 1, + .allowedParamTypes = {PARAM_REG | PARAM_DECIMAL}, + .analysisFunction = NULL, + .translationPattern = "int {0}" + }, //Insert commands above this one { .pattern = "or draw 25", From 58a8bd7779782fc84c19b0e287fdfd25327b5433 Mon Sep 17 00:00:00 2001 From: Aamin Gem Date: Sun, 11 Jun 2023 18:24:12 +0900 Subject: [PATCH 14/14] Added guidelines to PR Branch --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 107c12fb..b2149539 100644 --- a/README.md +++ b/README.md @@ -118,6 +118,7 @@ So, you reckon you've got the moxie to add a new command, eh? Brilliant! Here's 3. **Fingers Crossed:** Done everything by the book? Now cross your fingers, touch wood, and maybe toss a coin into the wishing well. You've played your hand, now it's time to let the code fairies sprinkle their magic! +*Note: The pull requests should be made to the `develop` branch and not to the `main` branch. Failure to do so results in a bonk from the devs.* ### Current Contributors: ![GitHub Contributors Image](https://contrib.rocks/image?repo=kammt/MemeAssembly)