944,035 Members | Top Members by Rank

Ad:
  • Assembly Discussion Thread
  • Unsolved
  • Views: 1401
  • Assembly RSS
Nov 10th, 2009
0

HELP.. assembly program

Expand Post »
Hello Everyone,

i'm new to assembly language programing
i would like to write a program that will print prompts to enter two values and a code #. If the code # is 1, output the greater of the values.... otherwise it should output the lesser

here is what i have:

.begin
in first
in second
in code
load code
store code
jumpneq outsecond
load first
compare second
jumplt outsecond
out first
jump done
outsecond: out second
done: halt
first: .data 0
second: .data 0
code: .data 0
.end


Thanx,
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
JhonRR is offline Offline
4 posts
since Nov 2009
Nov 11th, 2009
0
Re: HELP.. assembly program
HEEEEEELP!!!
Reputation Points: 10
Solved Threads: 0
Newbie Poster
JhonRR is offline Offline
4 posts
since Nov 2009
Dec 10th, 2009
0
Re: HELP.. assembly program
We cannot help you unless you tell us which assembler and OS you are using.. Why should we take the time to help if you don't give a good description of your problem?

By NASM16 standards, ALL of your code would flag an error.

If you are compiling this to .COM format, you will need to base your code off this..

Assembly Syntax (Toggle Plain Text)
  1. [org 0100h]
  2.  
  3.  
  4. [section .text]
  5.  
  6.  
  7. [section .data]

In NASM16 (And a few others), I've never seen ANY assembler syntax like the one you just showed.

when you are saying "in code", that will certainly give you an error, the "in" and "out" commands are short for input\output, and are used for ports..

As an example, to access the internal speaker on port 43h..

Assembly Syntax (Toggle Plain Text)
  1. mov al,182
  2. out 43h,al

Unless 'code' is some variable that you did not show, but I am basing my answer off the code you supplied.

JUMP and JUMPNEQ
Are also invalid commands (In NASM16)
use

JMP LOCATION

cmp REGISTER,VALUE
JNE LOCATION
Last edited by Goalatio; Dec 10th, 2009 at 1:50 am.
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
Goalatio is offline Offline
72 posts
since Oct 2009
Dec 12th, 2009
0
Re: HELP.. assembly program
still need help?
Reputation Points: 10
Solved Threads: 0
Newbie Poster
espartano is offline Offline
1 posts
since Aug 2008
Dec 18th, 2009
0
Re: HELP.. assembly program
sorry for this interruption..
May i ask you sir about our project.? It is a round medicine organizer that will alarm at a specified time that the user set. It's like a pizza pie that has

7 pies (compartment of the medicine). This what we want to happen. When the user select a compartment then select a time (example:8:30am) the pie will

rotate automatically and will stop at the set compartment at 8:30am. It will also produce an alarm sound. Per compartment can be selected up to 6 times

within a day but not at the same time (because the motor will not work at the same time). These are the materials that we're going to used1)DC Motor (this

will make the organizer rotate clockwise). (2)quad-7 segment(w/c displays the real time) (3) LCD 16x2 16bit mode (this will display the compartment to

select and the setting of time). (4) 4 PUSH buttons (left & right selector, enter, cancel) (5) Buzzer (for the alarm sound) (6) LDR (sensor that will gives

signal to the motor) (7) mcu PIC16F877A. We are using assembly language in MPLAB. Our big problem is the PROGRAM. We don't know how to start the program

properly. But we have made a program for the LCD (ONLY displays data,,but not manipulating it,,w/c we need most,,since we need to set the time manually on

the LCD using only the 4 pushbuttons. We also have created all the schematic (using eagle software). We have the hardware but not the software. It will be a

great help for us if you'll help us. We are graduating students. We have thought about microcontroller programming but only the basic since its only one

semester & the professor is always absent due to certain circumstances.We see lot of sample codes over the internet & study all. But still we need help.Pls

help us..We're begging you... =(
Reputation Points: 10
Solved Threads: 0
Newbie Poster
jianina07 is offline Offline
5 posts
since Dec 2009

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Assembly Forum Timeline: C++ to MIPS
Next Thread in Assembly Forum Timeline: assembly using PIC16F877A HELP





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC