Hi!!!<br>
<br>
I´m searching for some help on Mem in Asm...<br>
Could someone of you please post some code on how to<br>
save something in Mem (like an string in basic)<br>
<br>
Thanx<br>
Doc DooM
I'm not sure I understand what you mean. In ASM strings are just chunks of memory. You can declare a block of memory with a DS command (Declare Storage)or a DC (Declare Constant). I am assuming you are using x86 ASM. Different platforms use different commands.<br>
First declare how much memory you want to set <br>
aside for a given field. Either a DC or a DS will<br>
do this. The difference is a DS merely reserves <br>
the memory but doesn't change the contents of the<br>
memory, while a DC reserves the memory and stores <br>
a constant in it. <br>
FIELD-1 DS CL80 Reserves 80 bytes<br>
FIELD-2 DC CL80'ABCE' Reserves 80 bytes, and<br>
puts ABCD in the leftmost<br>
4 bytes, and fills the<br>
remaining 76 with blanks. <br>
The compiler automatically<br>
fills unused positions to the right with blanks,.<br>
for C (character) fields.<br>
Notice the DS has nothing in apostrophes after it.<br>
The DC has to have something in apostrohes, because<br>
that's the nature of the definition.<br>
To move something to the fields:<br>
MVC FIELD-1,=CL8'THORFOUR'<br>
MVC FIELD-2,FIELD-1<br>
Assembler moves the b-field (=CL8'THORFOUR) to the<br>
a-field (FIELD-1). The b-field is another way to<br>
set up a constant, except it won't have a label.<br>
Assembler will then move FIELD-1(which now contains<br>
THORFOUR followed by 76 bytes containing anything,<br>
to FIELD-2, wiping out the ABCD that was there.<br>
Hope this helps. <br>
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.