Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Oct 12th, 2004, 3:41 AM   #1
elmo
Newbie
 
Join Date: Oct 2004
Posts: 4
Rep Power: 0 elmo is on a distinguished road
Alright, at school we're using the LC3 compiler (Little computer i assume) for assembly, and have some assignments for it.
Problem:
Cant figure out how to save *anything* into a pointer.

example:
...
LEA R2, P; R2 should be a pointer to P now
...
A  .STRINGZ "A"
P  .BLKW 10; should be a pointer with 10 slots

now, no matter what i try, i cant seem to be able to store anything in any of the
pointers location, tried with ST, STI, but it seems like it wont do anything.
Could someone provide me with a example to store 'A' into one of the memory locations of P, using R2?
elmo is offline   Reply With Quote
Old Mar 3rd, 2005, 11:31 AM   #2
professor63
Newbie
 
Join Date: Mar 2005
Posts: 1
Rep Power: 0 professor63 is on a distinguished road
Pointers in LC3

The problem is to write a program to store the character 'A' that is pointed to by base address 'A' into the memory location pointed to by the base address 'P' .

.ORIG x3000
LEA R2, P
LEA R1, A
LDR R0,R1,#0
STR R0,R2,#0
HALT
A .STRINGZ "A"
P .BLKW 10
.END
professor63 is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 4:43 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC