Aperrently, 32-bit system calls are not supported under WSL
Thank you Timothy Baldwin!
I made a simple program to return the highest element of an array, but $ echo $?
echos 1, instead of 222
I am using as GNU assembler
/*
%edi will hold the current position in the list.
%ebx will hold the current highest value in the list.
%eax will hold the current element being examined
*/
# data_items - contains the item data. A 0 is used
# to terminate the data
.section .data
data_items: #These are the data items
.long 3,67,34,222,45,75,54,34,44,33,22,11,66,0
.section .text
.globl _start
_start:
movl $0, %edi # zero into index register
movl data_items(,%edi,4), %eax #load the first bit
movl %eax, %ebx # since this is the first item, %eax is the biggest
start_loop: # start loop
cmpl $0, %eax # check if element==0
je loop_exit
incl %edi # load next element
movl data_items(,%edi,4), %eax
cmpl %eax, %ebx # compare value
jle start_loop # jump to beginning if element is not the largest
movl %eax, %ebx # move the value as the largest
jmp start_loop # go to beginning
loop_exit:
movl $1, %eax # exit
int $0x80 #call kernel