CPL32 & ASM32

Intelligent Firmware's multipass CPL32 is the best assembler for true, pure assembly programmers. Purpose built for 32 bit protected mode programming (supports also 16 bit) and for embedded systems (ROM) programming. The most important feature of CPL32 is that it is a real assembler, not a high level language C like assembler like most. With CPL32 you write assembly, not some high level language, so there is absolutely NO RED TAPE, you do NOT declare variable types, segments or procedures. That's why we built ASM32 and the next generation CPL32 because we couldn't manage any more with traditional C like assemblers on our huge assembly only projects, like MASM/TASM or even A386.

Short example:

TASM/MASM   ASM32/CPL32 
.model small 
.stack
.data
Message DB "Hello World!$"
.code
main proc
MOV DX,OFFSET Message
MOV AX,SEG Message
MOV DS,AX
MOV AH,9 
INT 21h
MOV AX,4C00h
INT 21h
main endp
END main 
BEGIN 100h  ; for .COM file





MOV DX,Message


MOV AH,9
INT 21h
MOV AX,4C00h
INT 21h

Message:DB "Hello World!$"

As you see, except the standart "BEGIN 100h" for generating a .COM file, nothing else is needed. All the red tape is not needed for pure assembly, it's needed for TASM/MASM.


CPL32's improvements

CPL32 is the next generation ASM32 with the following additions:
  • Simple compiler instructionsto make assembly calculations easier. These compiler instructions are optional, CPL32 continues to be a normal assembler, just like ASM32.
  • Full MMX instruction set.
  • Full Floating point instruction set.
  • Full Pentium/Pentium Pro instruction set.
  • Full Pentium II/III/IV instruction set.
  • SSE & SSE2 instruction set.
  • Macros.
  • Several useful assembler directives (e.g. INCLBIN to include binary data/program as it is).
  • Several bugs fixed.

From our vast assembly programming experience we concluded that the main cause of assembly's increased programming effort compared to medium/high level languages are the calculations, therefore we added some simple optional compiler instructions. (Assuming of course that one knows very well to program assembly.)

+ Examples of CPL32's simple optional compiler instructions

EXAMPLE:high levelassemblyCPL32
Average av=(a+b+c)/3 MOV AX,[var_a]
ADD AX,[var_b]
ADD AX,[var_c]
MOV CX,3
XOR DX,DX
DIV CX
LET AX=(W[var_a]+W[var_b]+W[var_c])/3
Circular
buffer
warning=(outp-inp)<(max+20) MOV AX,[outp]
SUB AX,[inp]
MOV BX,[max]
ADD BX,20
CMP AX,BX
SETL B[warning]
LET B[warning]=W[outp]-W[inp]<W[max]+20
If If warning=0 and buffer(outp-max)=en CMP B[warning],0
JNZ N1
MOV BX,[outp]
SUB BX,[max]
MOV DL,[en]
CMP B[BX+buffer],DL
JNZ N1
IF (B[warning]=0) and (B[buffer+W[outp]-
-W[max]]=B[en])

+ CPL32 compiler instruction list

  • LET regmem = expression : Set <register/memory> to value of <expression>
  • IF expression =,<>,>,=>,<,<=; expression : As simple IF <flag> but instead of a flag it uses 2 full expressions.
  • REPEAT expression : Repeats following {...} <expression> times.Repeats can be nested.
  • MOVS B/W/D,source,dest,len : Moves <len> expression times <Bytes/Words/Doubles> from <source> expression's address to <dest> expression's address. This is an very easy way to make those difficult in buffer scrolls. Note: Direction has to be preset.
  • CMPS B/W/D,source,dest,len : Similar to MOVS but comparing.
  • STOS B/W/D,dest,len,data : Stores <data> expression as <B/W/D> for <len> expression's times to <dest> expression's address.
  • SCAS B/W/D,dest,len,data : Similar to STOS but searching.
  • PRINT b0,...,bx: <bx>=data bytes or strings ("abc"). Generates an INT 38h followed by the data bytes, followed by the "EN" label. This is very useful, but in order for it to work, you need to build the service routine for INT 38h which will take the bytes and prints them, until it reaches EN.
  • CREGS reg,...,reg:Declares 1 or more registers as available for compiler's use. Always compiler instructions require some registers to use. Default is (E)AX,(E)DX. When a register is declared as compiler available, that means that whenever a compiler instruction is used, this register will get overwritten. But you are still allowed to use a compiler register for source or destination of compiler instructions.
  • SIGNED : Following compiler instructions will use signed arithmetic.
  • UNSIGNED : Following compiler instructions will use unsigned arithmetic.
  • COMPDATA : Uses about 36 bytes of memory for compiler instruction use. Should be put once at the start of the program.

+ CPL32 instruction sets supported

  • 8086
  • enhanced (80186)
  • protected (80286)
  • 32bit (386)
  • 486
  • Pentium
  • conditional (Pentium Pro)
  • floating point
  • MMX (Pentium MMX)
  • SSE (Pentium III)
  • SSE2 (Pentium IV)


ASM32 is available for non-commercial use as a free download (23 Kbytes).
CPL32 is available to purchase for $45
    Acceptance Mark