[ Home  |  FAQ-Related Q&As  |  General Q&As  |  Answered Questions ]


    Search the Q&A Archives


write a program in assembly language that will ask for a...

<< Back to: comp.lang.c Answers to Frequently Asked Questions (FAQ List)

Question by sandman4444
Submitted on 5/15/2004
Related FAQ: comp.lang.c Answers to Frequently Asked Questions (FAQ List)
Rating: Not yet rated Rate this question: Vote
write a program in assembly language that will ask for  a number and print a list of prime numbers which is less than the input number?


Answer by macro_man
Submitted on 3/14/2005
Rating: Not yet rated Rate this answer: Vote
hi all.I'm new at Assembly, and I'vebeen trying to write a program that displays a string of characters i.e(this is page 0,this is page 1, and so on until page 7.)Then , the program should be able to go backwards (from page 7-0)...Going from page to page , of course , should be done after a key is pressed........
waiting for reply....
Thankx

 

Answer by Billy BOb Kiss My ass
Submitted on 3/10/2006
Rating: Not yet rated Rate this answer: Vote
This Only prints a number 1 but if you can fix it it should work
TITLE ex1_1.asm

INCLUDE Irvine32.inc

.data
Prompt BYTE "enter a number to see how many primes up to that number 3-up:", 0
Prompt2 BYTE " Is a prime"

.code
main PROC
     mov edx, OFFSET Prompt
     call WriteString
     Call ReadInt
    
     mov ebx, 2
     mov ecx, eax
L1:  cmp ecx, 1
     je Done
     cmp ecx, ebx
     je L2
    
    
     mov eax, ecx
     xor edx, edx
     div ebx
     dec ecx
     inc ebx
     cmp edx, 0
     JE L1
     stc
     jc L1
    
L2:  mov edx, ecx
     call WriteInt
    
     mov edx, OFFSET Prompt2
     call WriteString
    
     mov al, ' '
     call WriteChar
     dec ecx
     JMP L1
Done:
     exit
main ENDP  
END main

 

Answer by Jean michel Joseph
Submitted on 4/25/2006
Rating: Not yet rated Rate this answer: Vote
i need help writing a program

 

Your answer will be published for anyone to see and rate.  Your answer will not be displayed immediately.  If you'd like to get expert points and benefit from positive ratings, please create a new account or login into an existing account below.


Your name or nickname:
If you'd like to create a new account or access your existing account, put in your password here:
Your answer:

FAQS.ORG reserves the right to edit your answer as to improve its clarity.  By submitting your answer you authorize FAQS.ORG to publish your answer on the WWW without any restrictions. You agree to hold harmless and indemnify FAQS.ORG against any claims, costs, or damages resulting from publishing your answer.

 

FAQS.ORG makes no guarantees as to the accuracy of the posts. Each post is the personal opinion of the poster. These posts are not intended to substitute for medical, tax, legal, investment, accounting, or other professional advice. FAQS.ORG does not endorse any opinion or any product or service mentioned mentioned in these posts.

 

<< Back to: comp.lang.c Answers to Frequently Asked Questions (FAQ List)


[ Home  |  FAQ-Related Q&As  |  General Q&As  |  Answered Questions ]

© 2008 FAQS.ORG. All rights reserved.