picolisp

Unnamed repository; edit this file to name it for gitweb.
git clone https://logand.com/git/picolisp.git/
Log | Files | Refs | README | LICENSE

x86-64.freeBsd.code.l (1036B)


      1 # 07jan13abu
      2 # Mansur Mamkin <mmamkin@mail.ru>
      3 
      4 # System macros
      5 (code 'errno_A 0)
      6    call __error  # Get address of 'errno'
      7    ld A (A)  # Load value
      8    ret
      9 
     10 (code 'errnoC 0)
     11    call __error  # Get address of 'errno'
     12    ld (A) C  # Store new value
     13    ret
     14 
     15 #define>_WSTATUS(x)<--->(_W_INT(x) & 0177)
     16 #define>_WSTOPPED<----->0177<--><------>/* _WSTATUS if process is stopped */
     17 #define>WIFSTOPPED(x)<->(_WSTATUS(x) == _WSTOPPED)
     18 #define>WIFSIGNALED(x)<>(_WSTATUS(x) != _WSTOPPED && _WSTATUS(x) != 0)
     19 #define>WTERMSIG(x)<--->(_WSTATUS(x))
     20 
     21 (code 'wifstoppedS_F 0)  # WIFSTOPPED
     22    ld A (S I)  # Get status
     23    and B `(oct "0177")
     24    cmp B `(oct "0177")  # (((status) & 0177) == 0177)
     25    ret
     26 
     27 (code 'wifsignaledS_F 0)  # WIFSIGNALED
     28    ld A (S I)  # Get status
     29    and B `(oct "0177")  # ((((status) & 0177) != 0177) && ((status) & 0177) != 0)
     30    cmp B `(oct "0177")
     31    if ne
     32       nul B
     33    end
     34    ret
     35 
     36 (code 'wtermsigS_A 0)  # WTERMSIG
     37    ld A (S I)  # Get status
     38    and B `(oct "0177")  # ((status) & 0177)
     39    zxt
     40    ret
     41 
     42 # vi:et:ts=3:sw=3