/tests/

te/akkartik/mu/atom/html/mu-init.subx.html?h=hlt' type='application/atom+xml'/>
about summary refs log blame commit diff stats
path: root/html/mu-init.subx.html
blob: e9fa6babbb6af2be0ee35c0a7266c9eaa9ab4a95 (plain) (tree)


















































































                                                                                                                                                                                                                                                                      


                  

                                                  












                                                                                                                                                                     
                                                                                                                                                                    





                                
# Compare 3 and 3.
#
# To run:
#   $ ./translate_subx 000init.subx apps/ex13.subx
#   $ ./a.elf
# Expected result:
#   $ echo $?
#   1

== code
#   instruction                     effective address                                                   register    displacement    immediate
# . op          subop               mod             rm32          base        index         scale       r32
# . 1-3 bytes   3 bits              2 bits          3 bits        3 bits      3 bits        2 bits      2 bits      0/1/2/4 bytes   0/1/2/4 bytes

Entry:
    b8/copy-to-eax  3/imm32
    3d/compare-eax-and  3/imm32
    0f 94/set-if-=                  3/mod/direct    3/rm32/ebx    .           .             .           .           .               .                 # set ebx to ZF
    81 4/subop/and                  3/mod/direct    3/rm32/ebx    .           .             .           .           .               0xff/imm32        # AND with eax

$exit:
    # exit(ebx)
    e8/call  syscall_exit/disp32

# . . vim:nowrap:textwidth=0