Skip to content

Instantly share code, notes, and snippets.

Created April 20, 2014 17:45

Revisions

  1. @invalid-email-address Anonymous created this gist Apr 20, 2014.
    9 changes: 9 additions & 0 deletions test.c
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@

    void * i;

    void func(void * a)
    {
    if i + 10 * 16 {
    a = i;
    }
    }
    21 changes: 21 additions & 0 deletions test.c.asm
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,21 @@
    [cpu 8086]
    [bits 16]

    i:
    resb 2

    func:
    push bp
    mov bp, sp
    mov ax, 10
    mov bx, 16
    mul bx
    mov bx, word [i]
    add bx, ax
    test bx, bx
    jz .L0_0
    mov word [ss:bp + 4], word [i]

    .L0_0:
    pop bp
    ret