Hey, i need to put 4 values into the memory and im only able to use 2 registers. I was wondering what would be the best way to do this??
I need to put the values away somewhere, somehow, and must be able to get them out later agian to do some calculation.
Posted on 2006-09-14 05:51:59 by w00
Look, mom, no registers!
``mov , 100mov , 42``

In other words, your questions are overly general - be a bit more specific.
Posted on 2006-09-14 06:29:49 by f0dder
i thing he wants to use  2 registers for storing 4 variables value
like a=100,b=200,c=300,d=400
i guess he tries to says,to stores these four variables(a,b,c,d) values into two registers by some how stuff and access them later
Posted on 2006-09-14 07:22:30 by AssemblyBeginner

i thing he wants to use  2 registers for storing 4 variables value
like a=100,b=200,c=300,d=400
i guess he tries to says,to stores these four variables(a,b,c,d) values into two registers by some how stuff and access them later

Yeh, thats exactly what i want.
I thought it would be something like this:

``mov 10, eax;mov 20, ebx;push eax;push ebx;mov 30, eax;mov 40, ebx;push eax;push ebx;``

This is probably very wrong, cause i dont know how to retrieve the values... So how can i work this out...???
Posted on 2006-09-14 09:23:42 by w00
Well, in that case you could push them all directly too:
``push 10push 20push 30push 40``

or if your numbers are not signed and below or equal 65535 then you could shift them a little like this:
``mov eax, number1shl eax, 16mov ax, number2mov ebx, number3shl ebx, 16mov bx, number4``

And to retrieve them you would just take them out and shr reg, 16.
Posted on 2006-09-14 10:11:50 by JimmyClif
Thanks, i think i can go one with this information. Although there one thing i would like to know.
I have to work from a asm simulator called "zep2". This is some sort of microprocessor simulation, which only has two register (thats why i asked it like that), but it also uses weird ASM commands like,'begin', 'load' and 'store'... It doens't know what 'mov' is and what shl or shr is.
So its not good to learn from that program at all! What would be a better program to write and assemble ASM sources in??
I know of MASM32, but i would like a free one which can run on a Windows OS.
Posted on 2006-09-14 10:52:32 by w00
Masm32 is pretty much free, it just has a sheity license. :-/ I use Masm32 for most of my projects as I'm just too used to it's syntax.

Other good free assemblers are GoAsm, Fasm, Nasm (check Nasm32 here on the board), PoAsm (99% Masm compatible with better license) and RosAsm.

Posted on 2006-09-14 11:27:29 by JimmyClif
enough chouce i see, well thanks for the info, im gonna try a few. :)
Posted on 2006-09-14 11:58:25 by w00
Can you not just name an array in memory.

;
ARRAY  ;
db "00000000000000000000"  ;
;

Then access it with:
mov ax,2
mov bx,3
mov w,ax
mov w,bx

kinda thing.

so it ends up as:
02030000000000....etc

Then grab it, manipulate it and dump it back as required.
mov ax,w blah blah
Posted on 2006-09-15 07:51:19 by eek