General Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
Iron Speed
 
Go Back   Dev Articles Community ForumsProgrammingGeneral Programming Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
Free Web 2.0 Code Generator! Generate data entry and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
  #1  
Old April 10th, 2008, 02:53 PM
puneetkulkarni puneetkulkarni is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2008
Posts: 1 puneetkulkarni User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 37 m 16 sec
Reputation Power: 0
Unhappy Help with Assembly Language Program

Hey guys,
I have this program which is not working. I have been working on it for sometime.. I mean just staring at the code to see if it makes sense. And I havent got any help to go to see if it works. If you could help me it would be really helpful. Its is an 80*86 problem. Here is the code for it. It is really urgent. It was due last week but I havent been able to work it out. I use Windbg to debug it . But it doesnt like something I m doing here. I have added a few lines of code too just for outputing.


;Puneet Kulkarni
;CS 301 assignment 4
.386
.MODEL FLAT

ExitProcess PROTO NEAR32 stdcall, dwExitCodeWORD

INCLUDE io.h ;header file for input/output



cr EQU 0dh ;carriage return character
Lf EQU 0ah ;line feed

.STACK 4096 ;reserve 4096-byte stack
.DATA ;reserve storage for data
prompt BYTE "PLEASE ENTER THE NUMBER YOU WANT TO ADD AND ENTER A NEGATIVE NUMBER TO EXIT",0
prompt1 BYTE "Please enter an integer: ", 0
string BYTE 11 DUP (?),0
Num1 Byte 11 Dup(?),0
Num2 Byte 11 Dup(?), 0
Num3 Byte 11 Dup(?), cr,Lf,0
nums WORD 60 DUP (?)
Orig Byte 11 DUP(?),0
.CODE
_start:
output prompt

lea ebx,nums ;get address of the nums array
Startingpoint:

mov cx, 0
mov dx,0
inc cx
inc cx
output prompt1
input string, 10
cmp string,0
jng finalstart
atod string ; put input in eax
dtoa Num1,eax
output Num1
mov [ebx],eax
dtoa Orig,eax ; moves the value in Orig


lowerloop:
mov cx,2
sub ax, 1
jmp lowerprimetest

lowerprimetest:
mov dx,0
cmp cx, ax
je lowerprime
dtoa Orig,eax

div cx
cmp dx, 0
je lowerloop
inc cx
atod Orig
jmp lowerprimetest


lowerprime:
dtoa Num2,eax
Output Num2
mov [ebx],eax
jmp highestloop


highestloop:
add ax,1
jmp higherprimetest

higherprimetest:
mov dx,0
cmp cx, ax
dtoa Orig,eax
je higherprime
div cx
cmp dx, 0
je highestloop
inc cx
atod Orig
jmp higherprimetest


higherprime:
dtoa Num3,eax
Output Num3
mov [ebx],eax

jmp Startingpoint

finalstart:
lea ebx,nums
mov ecx,0

finalout:
dtoa num1,[ebx]
output num1
dtoa num2,[ebx+2]
output num2
dtoa num3,[ebx+4]
output num3
inc ecx
add ebx,6
cmp ecx,30
je endloop
jmp finalout
endloop:
INVOKE ExitProcess, 0

PUBLIC _start

END

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingGeneral Programming Help > Help with Assembly Language 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

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

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

Iron Speed




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