Hi CaRooR,
Welcome to the forum.
Let me paste this in while I've got it in the buffer...
http://home.myfairpoint.net/fbkotler/nasmdocr.htmlDebs is a Nasm developer too. She and Yuri and I put a lot of work into that instruction set reference. Then it was removed from the Nasm doc. Despite being obsolete, it might be some use to you.
Debs forgets that "mul" always uses ax or eax as the first parameter and complains if we tell it so... as you discovered... "imul" which is similar. will let us specify parameters/
You probably want
nasm -f elf32 myprog.asm
ld -m elf_ i386 -o myprog myprog.o
global _start
section .text
_start:
mov eax, 2 ; first param
mov ebx, 2 ; second param
mov ecx, 4 ; loop count
top:
mul ebx
loop top ; the mysterious loop instruction!
mov ebx, eax; make the result the exit code
mov eax, 0 ; sys_exit
int 80h
That's untested (when will I Learn?)
if it works. typing "echo $?" should show the result... only up to a byte...
I may be back with some tested code... maybe...
Best,
Frank