Post by Dirk Wolfgang Glomp[Info]
Ich bin gerade mit dem Linux-Assembeln(Nasm) angefangen.
Hier scheinen aber alle unter Linux nur C zu Programmieren.
So das schon das Verwenden der Linux-Syscalls mir etwas
schwer fällt.
Bei Problemen kann ich dir comp.lang.asm.x86 (moderiert, daher
nur sachbezogen) oder alt.lang.asm (falls du auch die verbalen
Schlachten der Assemblerautoren mitbekommen willst) empfehlen.
Post by Dirk Wolfgang GlompEin Versenden/Empfangen von "Hello World" übers Netz,
sowie eine Grafikausgabe mittels frame buffer geht schon mal.
Damit ist schon ein klitze-kleiner Anfang geschafft.
Ich kann mich schon mit Assemblerprogrammierung unter Windows
nicht anfreunden (es geht doch nichts über DOS com Programme)
und daher habe ich von Linux bisher meine Finger gelassen. Aber
hier ein kleines Windows-Programm das auch für diese Gruppe
möglicherweise interessant ist, da man damit innerhalb eine
Batchdatei das Fenster minimieren oder komplett verstecken
kann:
--------------------------------------------------------------------
showwin.exe let you minimize/maximize/hide the command window
within a batch program (requires W2k or better).
Usage: showwin.exe number
0 SW_HIDE
Hides the window and activates another window.
1 SW_SHOWNORMAL
Activates and displays a window. If the window is minimized or maximized,
the system restores it to its original size and position. An application
should specify this flag when displaying the window for the first time.
2 SW_SHOWMINIMIZED
Activates the window and displays it as a minimized window.
3 SW_MAXIMIZE
Maximizes the specified window.
3 SW_SHOWMAXIMIZED
Activates the window and displays it as a maximized window.
4 SW_SHOWNOACTIVATE
Displays a window in its most recent size and position. This value is
similar to SW_SHOWNORMAL, except the window is not actived.
5 SW_SHOW
Activates the window and displays it in its current size and position.
6 SW_MINIMIZE
Minimizes the specified window and activates the next top-level window
in the Z order.
7 SW_SHOWMINNOACTIVE
Displays the window as a minimized window. This value is similar to
SW_SHOWMINIMIZED, except the window is not activated.
8 SW_SHOWNA
Displays the window in its current size and position. This value is
similar to SW_SHOW, except the window is not activated.
9 SW_RESTORE
Activates and displays the window. If the window is minimized or maximized,
the system restores it to its original size and position. An application
should specify this flag when restoring a minimized window.
10 SW_SHOWDEFAULT
Sets the show state based on the SW_ value specified in the STARTUPINFO
structure passed to the CreateProcess function by the program that
started the application.
11 SW_FORCEMINIMIZE
Windows 2000/XP: Minimizes a window, even if the thread that owns the
window is not responding. This flag should only be used when minimizing
windows from a different thread.
---------------------------------------------------------------------------
A simple example:
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
@echo off
echo ***@jzh`0X-`/PPPPPPa(DE(DM(DO(Dh(Ls(Lu(LX(LeZRR]EEEUYRX2Dx=>showwin.com
echo 0DxFP,0Xx.t0P,=XtGsB4o@$?PIyU WwX0GwUY Wv;ovBX2Gv0ExGIuht6>>showwin.com
echo T}{zE~@***@OEKcUt`E}@mqqBsy?seHBEaPhxr?@zAB`***@Cj?>>showwin.com
echo ***@QEKpEt@ij?***@REKpEt@jj?***@SEKkjtlGuNw?***@pjirz>>showwin.com
echo FEvAUSQ?_YLTQ@@?~QCo_F~RDU@?aU?@MQ_AMy1GHs?Gw`***@shM`S_d>>showwin.com
echo bD_nsDddlTr_sPdlnTcnaTv_xP_ngD_rhDhsrT_kkDhrtT_fmDRNCTILk?>>showwin.com
echo staThg_So_rPfnqTl`***@ILm?O?cOKFDP?@@?dx>>showwin.com
echo OdFUu?N?***@J@??KD?HUA?QOGB_QO?F?SCAQO?UDF?UCE?Q_F?DUA?CUB?>>showwin.com
echo OFO?FOS?DUO?IUO?FOW?RU{OWFO?mYU?***@OQ@?QAQ?LUA?_F_og~>>showwin.com
echo UODUO?FOSAFOeAUOyAO_DCSHUOOQO?OCFGuHUOGFO?TUO?***@kcmS>>showwin.com
echo gFkPFUO?ngRThVvTncmTJFvPMQDTrKDDcmqOFkkDFOSAFOeAUOyAdFFSnB>>showwin.com
echo sT`***@PBsdTrmnTdknTmhVTvncTwDSSOshTbnqTrrdTT~?K>>showwin.com
echo ?OGOQp?o??Gds?wOw?PGAtaCHQvNntQv_w?A?it\=upkNQD??OuQsQG[i?>>showwin.com
echo RwrqosHy?Mjmv\@IuBlpUrHdjNAslF~mH}OKT?U??PT~OL?O?O?i?COT~B>>showwin.com
echo U?OCU?YF0x>>showwin.com
showwin.com>showwin.exe
del showwin.com
dir
:: wait 4 seconds
ping -n 4 localhost >nul
:: hide window
showwin.exe 0
dir /b
:: wait 4 seconds
ping -n 4 localhost >nul
:: show window
showwin.exe 5
:: wait 4 seconds
ping -n 4 localhost >nul
del showwin.exe
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
The source code:
winmain::
jsr.l (GetCommandLine)
; skip program name
eor.l r1,r1 ; not within "" flag
dec.l r0
_20: inc.l r0
cmp.b #0,(r0)
beq.b _10
cmp.b #'"',(r0)
bne.b _30
not.l r1
_30: or.l r1,r1
bne.b _20
cmp.b #' ',(r0)
bne.b _20
inc.l r0
_10: eor.l r5,r5
move.l #5,r4 ; default: SW_SHOW
_50: movu.bl (r0),r1
inc.l r0
or.b r1,r1
beq.b _40
sub.b #'0',r1
bcs.b _50
cmp.b #9,r1
bhi.b _50
mulsq.l #10,r5,r5
add.l r1,r5
eor.l r4,r4
br.b _50
_40: or.l r4,r4
beq.b _60
move.l r4,r5
_60: jsr.l (GetConsoleWindow)
move.l r5,-(sp)
move.l r0,-(sp)
jsr.l (ShowWindow)
moveq.l #0,-(sp)
jsr.l (ExitProcess) ; exit program