about summary refs log blame commit diff stats
path: root/apps/ex13.subx
blob: b7e802fdce16093d2b809b3e90c52f0f0e57f2de (plain) (tree)
1
2
3
4
5


                  

                                                                  












                                                                                                                                                                     
                                                                                                                                                                    





                                
# Compare 3 and 3.
#
# To run:
#   $ ./bootstrap translate init.linux apps/ex13.subx -o apps/ex13
#   $ ./bootstrap run apps/ex13
# 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
kr/pty v1.1.5 // indirect github.com/pkg/errors v0.8.1 // indirect github.com/prometheus/client_golang v0.9.4 // indirect github.com/prometheus/tsdb v0.8.0 // indirect github.com/rogpeppe/fastuuid v1.1.0 // indirect github.com/sirupsen/logrus v1.4.2 // indirect github.com/spaolacci/murmur3 v1.1.0 // indirect github.com/stretchr/objx v0.2.0 // indirect go.etcd.io/bbolt v1.3.3 // indirect go.opencensus.io v0.22.0 // indirect golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8 // indirect golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522 // indirect golang.org/x/image v0.0.0-20190523035834-f03afa92d3ff // indirect golang.org/x/mobile v0.0.0-20190607214518-6fa95d984e88 // indirect golang.org/x/mod v0.1.0 // indirect golang.org/x/net v0.0.0-20190611141213-3f473d35a33a // indirect golang.org/x/tools v0.0.0-20190611222205-d73e1c7e250b // indirect google.golang.org/appengine v1.6.1 // indirect google.golang.org/genproto v0.0.0-20190611190212-a7e196e89fd3 // indirect google.golang.org/grpc v1.21.1 // indirect honnef.co/go/tools v0.0.0-20190607181801-497c8f037f5a // indirect )