News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

How to test ALU in assembler.

Started by Gitler, February 16, 2007, 11:45:48 AM

Previous topic - Next topic

Gitler

I took this term-paper, the title of it: "Development of algorythm and program of testing ALU of microprocessor".  My teacher sad me that there is, in case of dire need, reserved variant: to test ALU by one command through another ones (suppose we know result of mutiplication on 2, this value could be derived by left shift on 1 разряд, and just as adding twice - in general all commands must bring to one result). But he say: "But in this case word of student will - X - such as". I must to devise my several methods. Teacher say that proceed from that I've read about structure of  ALU, and say -there is no signals in 2d chapter of my term paper, which are sent to ALU, and I can use them. And there is need of those signals and I have nothing of them. Next chapter about all methods of testing of ALU will be written as a logical deduction about ALU testing.
I don't know at all... (there is no literature of ALU testing).
(Rather well perhaps someone had seen ALU structure in particular i8086).

dsouza123

MASM32 has a help file Opcodes help which lists and describes the x86 CPU family's ALU opcodes.

It gives a fairly good description of each so that you could emulate a particular instruction with
other ones, such as your description of emulating mul num  with num a dword variable.

.data
  num dd 2

.code
   mov eax, 9  ; give eax register the value 9
   mul dd        ; multiply eax by the value 2 held in dword variable num

   mov eax, 9  ; emulation using shift left
   shl eax, 1

   mov eax, 9    ; emulation using add
   add  eax, eax

The Intel and AMD instruction manuals (downloads available, search this forum,
people have posted links for the manuals) give even more in depth descriptions of the opcodes
but also include FPU (floating point unit), MMX (integer vector SIMD unit), 3DNow (AMD vector SIMD unit),
SSE/SSE2/SSE3 (Intel vector SIMD unit).

The list from Opcodes Help (Intel Opcodes and Mnemonics) in MASM32 easily accessed through Quick Editor
is just the ALU instructions.  The file itself is opcodes.hlp in the \masm32\help directory.

Gitler

Well, hot to test for proper work such commands:
Loop Mov Int Lea Cmp Jmp Push Rep Ret
?