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,

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

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

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

Edited 6 Years Ago by Goalatio: n/a

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 used:(1)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... =(

This article has been dead for over six months. Start a new discussion instead.