Re: ASM noob - couple of questions



Betov wrote:

Then, feel free to execute your book.

Okay. You like firing squad? Lethal injection? Mme. La Guillotine? Hangin'? ("Bowels in or bowels out? Are you confused? Shall I help you decide?") :)

....
with FASM as I could use it with Linux later.

Good choice, but you will never learn anything of Assembly
by linking Asm Chunks to C... And as long as Linux Assembly
do not, so to say, exist...

None so blind as those who will not see... :)

I wonder what Linux uses instead of DirectX ?

I don't know. Ask Chuck or Frank.

I, for one, don't know. DirectX is the COM thingie, right? (.com = simple, COM = COMplicated) Beth gave a rundown on it some time ago. No wonder John can't figure it out! There's a kind of "linked list" from one "interface" to the next, right?

There are "portable graphics libraries", but John may need DirectX or a near equivalent. This is for the webcam, right? Did "fasmcam.asm" do you any good? That uses AVICAP32.DLL. I don't know what the Linux equivalent would be. I saw an interesting comment that suggested that simply piping the "camera device" into the "framebuffer device" was "interesting"...

We all agrea on the point that, in Win32 Assembly, around
80% ofthe time is wasted at searching the OS infos.

Not limited to Win32, either. I don't think the situation in Linux is quite as bad as you seem to think, but... The "assembly language" part is a lot easier than the "interfacing with the OS" part! Doing anything with graphics in Linux is particularly bad. This is why the "just call the library" (or "you *must* call the library"!) is so popular. :(

Just for the hell of it, here's some Windows/Linux code Numit_or posted (Yahoo nasm-users group). Uses "opengl" (and/or "libglut" and/or "libglu"... "Mesa" may have something to do with it...) Requires some external files, it won't assemble or anything, but "just to look at":

;---------------------------------------------------
; triangle.asm
;
; A very simple *Linux/Windos* opengl application using the glut library. It
; draws a nicely colored triangle in a top-level application window.
; Compile with:
; make linux (in Linux)
; make windows (in Windows)
;
; you can find nasm in:
; http://nasm.sourceforge.net/
;
; Mingw is in:
; http://www.mingw.org/
;
; author: numit_or (numit_or at cantv.net)
;
;-------------------------------------------------------------
;
; libGL is in
; libMesaGL1 pack
; libgkut and libGLU are in:
; libMesaglut pack
;
;------------------------------------------------------------

%include "nmadcros.inc"

GL_COLOR_BUFFER_BIT equ 16384
GL_POLYGON equ 9

section .data
title db 'A Simple Triangle', 0
zero dd 0.0
one dd 1.0
half dd 0.5
neghalf dd -0.5

section .text
display:
invoke glClear, GL_COLOR_BUFFER_BIT ; glClear(GL_COLOR_BUFFER_BIT)
invoke glBegin, GL_POLYGON ; glBegin(GL_POLYGON)
invoke glColor3f, [one], 0, 0 ; glColor3f(1, 0, 0)
invoke glVertex3f, [neghalf], [neghalf], 0 ; glVertex(-.5, -.5, 0)
invoke glColor3f, 0, [one], 0 ; glColor3f(0, 1, 0)
invoke glVertex3f, [half], [neghalf], 0 ; glVertex(.5, -.5, 0)
invoke glColor3f, 0, 0, [one] ; glColor3f(0, 0, 1)
invoke glVertex3f, 0, [half], 0 ; glVertex(0, .5, 0)
invoke glEnd ; glEnd()
invoke glFlush ; glFlush()
ret

PROC main, argc, argv
invoke glutInit, addr [.argc], [.argv]
invoke glutInitDisplayMode, 0
invoke glutInitWindowPosition, 80, 80
invoke glutInitWindowSize, 400, 300
invoke glutCreateWindow, title
invoke glutDisplayFunc, display
invoke glutMainLoop
ret
ENDP
;-------------------

Now, to me, that doesn't look a hell of a lot like "real assembly language". I can stare at it and think like a CPU, but I can't see what it "does". Reminds me a bit of why I found trying to learn C "unsatisfying" - I felt more like a data entry clerk than a programmer. The library routines are having all the fun! :)

Can't blame Linux, or libraries - I get the same reaction to the Windows APIs. James was asking for some "pure asm" - defined as "using just interrupts" for Windows. Might have a better shot at that in Linux, actually. I'm beginning to figure out the "framebuffer device" - graphics for Linux with "just ints". This isn't the popular "GUI app" that John's wanting to learn, though... :(

Dos was more fun!

Best,
Frank
.



Relevant Pages

  • Re: Whats the best 32 Bit Assembly language Tutorial series
    ... > down to the last detail of 32 Bit assembly language. ... > I don't want windows specific assembly I would like ... > basic 32 Bit Assembly language programming series (flat memory addressing ... Gas under Linux, you can find a copy here: ...
    (comp.lang.asm.x86)
  • Re: Id like to learn asm...
    ... In fact, now I'm running under windows XP pro SP2, but I'm trying to ... I've done it I will be running under linux so I'll be learning under ... Actually, if you learn assembly language using HLA, your programs will ...
    (alt.lang.asm)
  • Re: Boot records Intel Architecture
    ... Can't we program that using assembly language and C? ... I want capture the boot record binary into a variable. ... In Linux ... How can I do it in Windows? ...
    (comp.lang.c)
  • Re: Future of IT in Lebanon
    ... working knowledge of Indian programmers DNA, nor of their intuitive Java ... > So Longhorn is not an experiment and Linux is an experiment? ... another chapter in the Windows story, and the Microsoft marketing machine is ... > application opens, Check the about, it says Microsoft Visual Basic 6.3. ...
    (soc.culture.lebanon)
  • FTP DOWNLOAD! More than 6500 CRACKED SOFTWARE(CAD,CAE,CAM,ED
    ... Autodesk Architectural Desktop 2005 ... DASSAULT SYSTEMES CAA ENOVIA LCA V5R13 ... ALTAIR.OPTISTRUCT V5.1 for LINUX ... ANSYS V8.0 FOR WINDOWS ...
    (microsoft.public.dotnet.framework.adonet)