Assembler with LCC-Win32  This page was last updated 4th October 2005

Here are various notes and code listings on using assembler with LCC-Win32, they have been uploaded as they were written and are in no particular order.


CHM Help file containing the Intel x86 Opcodes.
Introduction, Gaining Access To Parameters, You Must Push And Pop, The Return Value, Sizes And Instructions, An Example Routine, Addressing Modes, Labels, When Compiling Optimized, Timings
Flags Register, Flag Register Instructions, Jump Instructions, String Instructions, Floating Point & Example, The FPU Control Register, Rounding Control, The FPU Status Register, Calling a function with asm. The If/Else/Endif Construct.
Going Naked, Alignment, Pass A Big One, Return 8 Bytes, Asm Data, Copying with MMX, Using LEA Mult, Compile Asm Files
Intricacies Of Multiply, Entanglement with Divide
Directives
 
 
 
(7k) directives.txt - Listing of LCC-win32 Assembler Directives.

mnemonics.txt - Listing of LCC-win32 Assembler Errors and LCC-win32 Assembler Mnemonics.

 Author: Mike Caetano

Assembler listings.

Cipher
 
Cipher with 128 bit key in assembler and C
Finds the closest match for a colour in an array of colours.
MemCpy
 
Copies memory using MMX registers. (2 bugs fixed 9th June 2004)
MemSet
 
Sets the bits. Uses a similar method to MemCpy above.
StrLen
 
As the name suggests.
RevByte
 
A routine to reverse the bits in a byte.

 

Copy sub-string into main string. Also demonstrates how to call a routine from within a function and uses the RET num  instruction to clean up the stack automatically when returning.
ArrAdd
 
Routines that memset and routines to add a value to array elements. These routines use lods & stos.
MmxPadd
 
Packed addition using the MMX instruction paddb.

 

MulVec
 
AMD 3DNOW pfmul used to multiply two float vectors.

 

SeDel
 
A program that deletes itself. (On WinME, maybe others)

 

SeDelNT
 
A program that deletes itself. (On NT) An explanation has been added by Mike Caetano. (3rd Oct 2002)
FpuRegs
 
(2k zip) An example of using FSAVE.

 

Winasm
 
(8k zip) Windows asm listing. (Hard work!)

 

(3k zip) asm snippets using inline __declspec(naked)

 Author: John Webb 

386xp
 
 
 
 
 
(38k zip) Sample of 386xp callback procedure integrated into C for Lcc.

Purpose is: Anybody can use it without any assembler knowledge, or even knowing, what this 386xp procedure is all about. Just use your common sense when programming, and your programs will run (somewhat) faster with 386xp.

Author: Bernat Bogner

 

Back to main page