BUT the problem that I have is that I'm trying to make this very basic programing under assembly for 8086 that will prompt for 2 different numbers and output the lowest number regardless of which was entered first. here is my code...
include 'emu8086.inc' org 100h; set location counter to 100h jmp CodeStart DataStart: promptMsg db "enter a number> ", 0 minMsg db "the smallest number is ", 0 promptMsgtwo db "enter the second number> ", 0 newline db 13, 10, 0 num1 dw ? num2 dw ? numSmall dw ? CodeStart: ; prompt user to enter in a number mov si, offset promptMsg call print_string ; read in the number into cx call scan_num ; move the number to a variable mov num1, cx ; advance cursor to the next line mov si, offset newline call print_string ; prompt user to enter in a number mov si, offset promptMsgtwo call print_string ; read in the number into cx call scan_num ; move the number to a variable mov num2, cx ; advance cursor to the next line mov si, offset newline call print_string ;compare values CMP num1, num2 ; print min message mov si, offset minMsg call print_string mov ax, numSmall call print_num EndLabel: ret DEFINE_PRINT_STRING DEFINE_SCAN_NUM DEFINE_PRINT_NUM DEFINE_PRINT_NUM_UNS
Where it says
CMP num1, num2
I keep getting the error wrong parameters on line 47 (for those of you who will actually put it in an 8086 emulator). The main problem I'm having is that I'm going to have to cause some form of a "jump" after wards. But since I can already tell that I'm not using the statement CMP correctly, how should I be calling it. And how would I be able to jump to two different locations (if need be) to be able to say which one is the lowest if number 1, or number 2 is lower.
Please someone help with this, and if you do thank you for your help.