HELP.. assembly program

Please support our Assembly advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Nov 2009
Posts: 2
Reputation: JhonRR is an unknown quantity at this point 
Solved Threads: 0
JhonRR JhonRR is offline Offline
Newbie Poster

HELP.. assembly program

 
0
  #1
Nov 10th, 2009
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,
Reply With Quote Quick reply to this message  
Join Date: Nov 2009
Posts: 2
Reputation: JhonRR is an unknown quantity at this point 
Solved Threads: 0
JhonRR JhonRR is offline Offline
Newbie Poster
 
0
  #2
34 Days Ago
HEEEEEELP!!!
Reply With Quote Quick reply to this message  
Join Date: Oct 2009
Posts: 33
Reputation: Goalatio is an unknown quantity at this point 
Solved Threads: 0
Goalatio Goalatio is offline Offline
Light Poster
 
0
  #3
6 Days Ago
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..

  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..

  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; 6 Days Ago at 1:50 am.
It's passion that drives me.
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 1
Reputation: espartano is an unknown quantity at this point 
Solved Threads: 0
espartano espartano is offline Offline
Newbie Poster
 
0
  #4
3 Days Ago
still need help?
Reply With Quote Quick reply to this message  
Reply

Message:


Thread Tools Search this Thread



Tag cloud for Assembly
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC