Re: ASM Tutorial
- Posted by Bernie Ryan <xotron at bluefrog.com> Nov 11, 2006
- 531 views
I think see why you are haveing difficulty see how to use ASM.EX This is a really short tutorial. First Download: http://www.rapideuphoria.com/asm2.zip 1: Look at fpixel.asm this is a text file of assembler neumonics. 2: Run asm.ex like this: --------------------------------- ASM to Euphoria compiler (32-bit) by Pete Eberlein Nov 05, 2006 --------------------------------- Enter the name of the asm file to compile: fpixel.asm 1: commented source with line numbers (default), 2: commented source, 3: no source Select source option: 2 fpixel.inc compiled with great success. Warning: local constant SSE_MODRM_REG64 in asm.e is not used 3: Now you will have a file containing the machine code called fpixel.inc. This is not a complete program so you have to write some additional interface code to run it with Euphoria. 4: Compare this code in (fpixel.inc) with fpixel.ex and you will see that some extra code was needed to make a complete Euphoria. There are some locations that contain #00,#00,#00,#00, where there should be parameters loading into registers. For example the x value, the y value, and the color value. We have to poke these 4-bytes (dword) values into memory at correct offsets. Look at the comment in -- 1: mov ebx, dword x (2) in the fpixel.inc file; the dword x is at offset 2 that is what (2) in the comment means. Once all the parameters are setup (poked-in) then to execute the code you use call(fpixel) fpixel being the constant pointer that contains the allocated memory. The other code in the file is just ordinary Euphoria program code. 5: Now run the fpixel.ex file and see what happens. Bernie My files in archive: WMOTOR, XMOTOR, W32ENGIN, MIXEDLIB, EU_ENGIN, WIN32ERU, WIN32API Can be downloaded here: http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan