mu/linux/ex13.subx

26 lines
1.0 KiB
Plaintext
Raw Normal View History

2020-03-07 01:41:36 +00:00
# Compare 3 and 3.
#
# To run:
2021-03-30 01:47:52 +00:00
# $ bootstrap/bootstrap translate ex13.subx -o ex13
2021-03-04 08:24:24 +00:00
# $ bootstrap/bootstrap run ex13
2020-03-07 01:41:36 +00:00
# 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
2020-03-31 07:12:37 +00:00
81 4/subop/and 3/mod/direct 3/rm32/ebx . . . . . 0xff/imm32 # AND with eax
2020-03-07 01:41:36 +00:00
$exit:
# exit(ebx)
e8/call syscall_exit/disp32
# . . vim:nowrap:textwidth=0