Other Programming Languages
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreOther Programming Languages

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
1200+ fellow developers rate and compare features of the top IDEs, like Visual Studio, Eclipse, RAD, Delphi and others, across 13 categories. Enjoy this FREE Download of the IDE User Satisfaction Study by Evans Data Corporation. Download Now!
  #1  
Old December 1st, 2006, 06:08 AM
MastahUK's Avatar
MastahUK MastahUK is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Location: UK
Posts: 242 MastahUK User rank is Corporal (100 - 500 Reputation Level)MastahUK User rank is Corporal (100 - 500 Reputation Level)MastahUK User rank is Corporal (100 - 500 Reputation Level)MastahUK User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 1 Day 9 h 33 m 7 sec
Reputation Power: 8
Send a message via ICQ to MastahUK
Need help on a very simple assembler program!

Hi, I've never ever been taught how to actually program in assembler before, but an assignment I have requires me to create a small bit of assembly code to put into a program called WinDLX to test things such as processor pipelining.

All my 'program' in assembler has to do is generate DLX code that avoids stalls for the sequence of a=b+c and then d=e-f. To do this I know I need to define f before I add b and c to a, and store a before I do the subtraction to avoid stalls. Here is my code that I know is very close (as I remember seeing an example of this and it was similar, although I can't recall how it was done!) but for some reason the program WinDLX cannot load it because it claims there are errors with the code.

Code:

		.data

a:		.word		0
b:		.word		3
c:		.word		4
d:		.word		0
e:		.word		8
f:		.word		5

		.text
		.global		main
main:	
			
		lw r2, b
		lw r3, c
		lw r5, e
		add r1, r2, r3
		lw r6, f
		sw a, r1
		sub r4, r5, r6
		sw d, r4


Finish:
		lw		r2,b
		lw		r3,c
		lw		r4,d
		lw		r5,e
		lw		r6,f
		trap	0


Thanks for any help with this!

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreOther Programming Languages > Need help on a very simple assembler program!


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway