Emojasm 2

βž‘οΈπŸ“ΌπŸ‘οΈπŸ“ΌπŸ“¦πŸ”¨   - Read T0 into A, store in X. 
βž‘οΈπŸŽžοΈπŸ‘οΈπŸŽžοΈ       - Read T1 into A
πŸ΄πŸ”¨πŸ“¦β›οΈ      - AND A in place with X, store result in Y.
πŸ‘οΈπŸŽžοΈ          - Read T1 back into A
πŸŽ·πŸ”¨πŸ“¦πŸ”¨      - OR A in place with X, store result in X
πŸ¦”πŸ”¨πŸ¦”β›οΈ      - DEC X, DEC Y
❔⛏️          - CMP Y 0
βœ‰οΈπŸ˜πŸ˜πŸ·οΈ       - JNE 1D (decrement phase - this makes a subtraction loop,   
                subtracting Y from X, and leaving result in X.)
πŸŽπŸ”¨πŸ“€        - Print X
βž‘οΈπŸ“ΌπŸ‘οΈπŸ“Όβ¬…οΈπŸ“Ό    - Read the next char from T0 into A, move back.
β”πŸ—ƒοΈ          - CMP A 0 (is the tape empty)
βœ‰οΈπŸ˜€πŸ˜€πŸ·οΈ       - JNE 00
βž‘οΈπŸŽžοΈπŸ‘οΈπŸŽžοΈβ¬…οΈπŸŽžοΈ    - Read the next char from T1 into A, move back.
β”πŸ—ƒ          - CMP A 0 (same thing but makes sure both are empty
οΈβœ‰οΈπŸ˜€πŸ˜€πŸ·οΈ       - JNE 00
πŸ—Ώ            - HLT

This works because the difference between the AND of two numbers and the OR of those numbers, logically, is equal to the XOR. OR is also always greater than AND, as it has 1s in all the same places, and more.

Flag: ractf{x0rmoj1!}

Last updated