| | |
HELP.. assembly program
Please support our Assembly advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Nov 2009
Posts: 2
Reputation:
Solved Threads: 0
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,
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,
•
•
Join Date: Oct 2009
Posts: 33
Reputation:
Solved Threads: 0
0
#3 5 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..
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..
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
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)
[org 0100h] [section .text] [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)
mov al,182 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; 5 Days Ago at 1:50 am.
It's passion that drives me.
![]() |
Similar Threads
- Program help required (Assembly)
- Assembly program need help (Assembly)
- Timer code in assembly program using PIC 16F84A (Assembly)
- How to run assembly program? (Assembly)
- sort program assembly (Assembly)
- Assembly Programming Question (Assembly)
Other Threads in the Assembly Forum
- Previous Thread: help me to make OS in c++ to assembly
- Next Thread: Print Content of SI
| Thread Tools | Search this Thread |
Tag cloud for Assembly





