Skip to main content
added 55 characters in body
Source Link
l4m2
  • 28.3k
  • 2
  • 25
  • 103

x86 opcode, 8 bytes

fun:
        call    edx          ; 2B
        cmpxchg eax,    ecx  ; 3B, on 8086 use xchg and cmp instead
        jnz     fun          ; 2B
        ret                  ; 1B

Take input: ecx (value x0), edx (function address, take input from ecx, write result to eax without modifying the value of ecx and edx)

8086 opcode, 7 bytes (but slow)

    xor     cx,     cx
    call    dx
    loop    $-2
    ret

If there exists a fixed point, looping 65536 times always drive it there.
Take input: ax (initial value x0), dx (function address, take input from ax, write output to ax without modifying the value of cx and dx).
Output the fixed point in register ax.

x86 opcode, 8 bytes

fun:
        call    edx          ; 2B
        cmpxchg eax,    ecx  ; 3B, on 8086 use xchg and cmp instead
        jnz     fun          ; 2B
        ret                  ; 1B

Take input: ecx (value x0), edx (function address, take input from ecx, write result to eax without modifying the value of ecx)

8086 opcode, 7 bytes (but slow)

    xor     cx,     cx
    call    dx
    loop    $-2
    ret

If there exists a fixed point, looping 65536 times always drive it there.
Take input: ax (initial value x0), dx (function address, take input from ax, write output to ax).
Output the fixed point in register ax.

x86 opcode, 8 bytes

fun:
        call    edx          ; 2B
        cmpxchg eax,    ecx  ; 3B, on 8086 use xchg and cmp instead
        jnz     fun          ; 2B
        ret                  ; 1B

Take input: ecx (value x0), edx (function address, take input from ecx, write result to eax without modifying the value of ecx and edx)

8086 opcode, 7 bytes (but slow)

    xor     cx,     cx
    call    dx
    loop    $-2
    ret

If there exists a fixed point, looping 65536 times always drive it there.
Take input: ax (initial value x0), dx (function address, take input from ax, write output to ax without modifying the value of cx and dx).
Output the fixed point in register ax.

added 256 characters in body
Source Link
user202729
  • 17.4k
  • 2
  • 37
  • 70

x86 opcode, 8B8 bytes

fun:
        call    edx          ; 2B
        cmpxchg eax,    ecx  ; 3B, on 8086 use xchg and cmp instead
        jnz     fun          ; 2B
        ret                  ; 1B

Take input ecx: ecx (initvalue x0), edxedx (func ecx->eaxfunction address, take input from ecx, write result to eax without modifying non-output varthe value of ecx)

8086 opcode, 7B but7 bytes (but slow)

    xor     cx,     cx
    call    dx
    loop    $-2
    ret

If there exists a fixpointfixed point, looping 65536 times always drive it there. 
inTake input: axax (initinitial value x0), dxdx (func ax=>ax)function address, take input from ax, write output axto ax).
Output the fixed point in register ax.

x86 opcode, 8B

fun:
        call    edx          ; 2B
        cmpxchg eax,    ecx  ; 3B, on 8086 use xchg and cmp instead
        jnz     fun          ; 2B
        ret                  ; 1B

input ecx(init), edx(func ecx->eax without modifying non-output var)

8086 opcode, 7B but slow

    xor     cx,     cx
    call    dx
    loop    $-2
    ret

If there exists a fixpoint, looping 65536 times always drive it there. in: ax(init), dx(func ax=>ax) output ax

x86 opcode, 8 bytes

fun:
        call    edx          ; 2B
        cmpxchg eax,    ecx  ; 3B, on 8086 use xchg and cmp instead
        jnz     fun          ; 2B
        ret                  ; 1B

Take input: ecx (value x0), edx (function address, take input from ecx, write result to eax without modifying the value of ecx)

8086 opcode, 7 bytes (but slow)

    xor     cx,     cx
    call    dx
    loop    $-2
    ret

If there exists a fixed point, looping 65536 times always drive it there. 
Take input: ax (initial value x0), dx (function address, take input from ax, write output to ax).
Output the fixed point in register ax.

added 233 characters in body
Source Link
l4m2
  • 28.3k
  • 2
  • 25
  • 103

x86 opcode, 8B

fun:
        call    edx          ; 2B
        cmpxchg eax,    ecx  ; 3B, on 8086 use xchg and cmp instead
        jnz     fun          ; 2B
        ret                  ; 1B

input ecx(init), edx(func ecx->eax without modifying non-output var)

8086 opcode, 7B but slow

    xor     cx,     cx
    call    dx
    loop    $-2
    ret

If there exists a fixpoint, looping 65536 times always drive it there. in: ax(init), dx(func ax=>ax) output ax

x86 opcode, 8B

fun:
        call    edx          ; 2B
        cmpxchg eax,    ecx  ; 3B, on 8086 use xchg and cmp instead
        jnz     fun          ; 2B
        ret                  ; 1B

input ecx(init), edx(func ecx->eax without modifying non-output var)

x86 opcode, 8B

fun:
        call    edx          ; 2B
        cmpxchg eax,    ecx  ; 3B, on 8086 use xchg and cmp instead
        jnz     fun          ; 2B
        ret                  ; 1B

input ecx(init), edx(func ecx->eax without modifying non-output var)

8086 opcode, 7B but slow

    xor     cx,     cx
    call    dx
    loop    $-2
    ret

If there exists a fixpoint, looping 65536 times always drive it there. in: ax(init), dx(func ax=>ax) output ax

Source Link
l4m2
  • 28.3k
  • 2
  • 25
  • 103
Loading