Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added rot13 example #57

Merged
merged 5 commits into from
Jan 19, 2022
Merged

Added rot13 example #57

merged 5 commits into from
Jan 19, 2022

Conversation

M3L73D
Copy link
Contributor

@M3L73D M3L73D commented Jan 18, 2022

Simple ROT13 cipher implementation.

Had to get around and compare each character with letters instead of simple a >= 'a' && a <= 'z', so the implementation may not be the cleanest.

Might be worth adding comparison operators with dynamic labels that can be used multiple times in the code, what do you think?

@kammt
Copy link
Owner

kammt commented Jan 18, 2022

Might be worth adding comparison operators with dynamic labels that can be used multiple times in the code, what do you think?

I was thinking about implementing that, but until now I couldn't come up with a good syntax.
An easy way would be name:command, but that's too easy for devs to remember. What could be done is restrict the name like most websites restrict their passwords. So a label name:

  • must be at least 8 characters long
  • must contain letters from a-z, A-Z, numbers from 0-9 and a special character (maybe out of !?$%&§"#)
  • and.. must contain "yeet" somewhere in its name?

Any ideas from your side?

Replaced `rbx` with `rcx`
Copy link
Owner

@kammt kammt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok thats a lot of jumping around
But everything seems to work - nicely done!

@M3L73D
Copy link
Contributor Author

M3L73D commented Jan 18, 2022

The main idea is to add an ability to jump with condition so you can achieve something like this:

C

if(a > 5 && a < 20) {
    // some code
}
// continue

ASM

cmp     eax, 5
jle     .LYeet0
cmp     eax, 19
jg      .LYeet0
# some code
.LYeet0:
# continue

@kammt kammt merged commit 82d7a57 into kammt:develop Jan 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants