Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...This was the ONLY place that I could find information that I could use to resolve the problem. So thanks once again to member TomSark and the SQL forum!..."

Geography

Where in the world do Tek-Tips members come from?
DocDooM (Programmer)
2 Mar 99 16:30
Hi!!!

I´m searching for some help on Mem in Asm...
Could someone of you please post some code on how to
save something in Mem (like an string in basic)

Thanx
Doc DooM
zqzq (Programmer)
25 Mar 99 20:14
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.
Helpful Member!  thorfour (Programmer)
24 Jun 99 11:53
First declare how much memory you want to set
aside for a given field. Either a DC or a DS will
do this. The difference is a DS merely reserves
the memory but doesn't change the contents of the
memory, while a DC reserves the memory and stores
a constant in it.
FIELD-1 DS CL80 Reserves 80 bytes
FIELD-2 DC CL80'ABCE' Reserves 80 bytes, and
puts ABCD in the leftmost
4 bytes, and fills the
remaining 76 with blanks.
The compiler automatically
fills unused positions to the right with blanks,.
for C (character) fields.
Notice the DS has nothing in apostrophes after it.
The DC has to have something in apostrohes, because
that's the nature of the definition.
To move something to the fields:
MVC FIELD-1,=CL8'THORFOUR'
MVC FIELD-2,FIELD-1
Assembler moves the b-field (=CL8'THORFOUR) to the
a-field (FIELD-1). The b-field is another way to
set up a constant, except it won't have a label.
Assembler will then move FIELD-1(which now contains
THORFOUR followed by 76 bytes containing anything,
to FIELD-2, wiping out the ABCD that was there.
Hope this helps.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Back To Forum

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close