I wrote the initial code for this problem but I want to be able to take -1 as an input. Right now it takes only one input 1 or - and then shows the result. I'm a novice when it comes to assembly language and emu8086 so it would really help me out if someone could help me to solve this problem. Here's the code so far:
April 09, 2019
Code: ; Program to check number is positive or not .MODEL SMALL .STACK 100H .DATA NUM DB -12H RES DB ? .CODE MOV AX , @DATA ; Initializing Data Segment MOV DS , AX MOV AL , NUM ; LOAD NUMBER ROL AL , 01 ; ROTATE BY 01 JC DN MOV RES , 1 ; POSITIVE JMP EXIT DN: MOV RES , 2 ; NEGATIVE EXIT: MOV DL , RES MOV AH , 4CH ; Service routine for exit INT 21H END
|