I'm having troubles in programming in assembly language, this is my question, How to make a program and add four (4) numbers, (the 4 numbers will be inputted by the user), in assembly language? I only know adding two numbers by user input, Thank you and more power...
-this is my code in adding two numbers.
#make_COM# ; COM file is loaded at CS:0100h ORG 100h include 'emu8086.inc' LEA SI,msg1 CALL PRINT_STRING CALL scan_num mov ax,cx putc 13 putc 10 LEA SI,msg2 CALL PRINT_STRING CALL scan_num mov bx,cx putc 13 putc 10 JMP calc back: JMP stop calc: ADD ax, bx Print "The sum is: " CALL print_num putc 10 putc 13 JMP back stop: RET msg1 DB 'Enter the first number: ',0 msg2 DB 'Enter the second number: ',0 DEFINE_SCAN_NUM DEFINE_PRINT_STRING DEFINE_PRINT_NUM DEFINE_PRINT_NUM_UNS END
Edited by macosxnerd101: Please, .