Assembly language porgram to find positive or negative and take values from user
Answers
Answered by
0
org 100h
.data
msg1 db 10,13,’Positive Sign$’;
msg2 db 10,13,’Negative Sign$’;
.code
mov ax,@data;
mov ds,ax;
xor ax,ax;
mov ax,15;
cmp ah,0;positive is start with 0 bit and negative by 1 bit in reg
je positive;
mov ah,09h;
mov dx,offset msg2;
int 21h;
jmp exit;
positive:
mov ah,09h;
mov dx,offset msg1;
int 21h;
jmp exit;
exit:
mov ah,04ch;
int 21h
ret
.data
msg1 db 10,13,’Positive Sign$’;
msg2 db 10,13,’Negative Sign$’;
.code
mov ax,@data;
mov ds,ax;
xor ax,ax;
mov ax,15;
cmp ah,0;positive is start with 0 bit and negative by 1 bit in reg
je positive;
mov ah,09h;
mov dx,offset msg2;
int 21h;
jmp exit;
positive:
mov ah,09h;
mov dx,offset msg1;
int 21h;
jmp exit;
exit:
mov ah,04ch;
int 21h
ret
Similar questions
Math,
6 months ago
Math,
6 months ago
History,
6 months ago
Math,
1 year ago
Social Sciences,
1 year ago