Computer Science, asked by pmehra15, 1 year ago

assembly language program that converts as ASCII string containing decimal digits, stored in consecutive locations in the memory into equivalent binary number. you may assume that the three locations contains ASCII equivalent of digit 3 , digit 4 and digit 5. the output of this program should be stored in AX registers

Answers

Answered by Arslankincsem
0

DATA SEGMENT; ARR DB ’3',’4',’5'; HUN DB ?; TEN DB ?; UNT DB ?; LEN DW $-ARR; RES DW ?; DATA ENDS..CODE SEGMENT; ASSUME DS:DATA CS:CODE; START:; MOV AX,DATA; MOV DS,AX..LEA SI,ARR;..MOV AL,ARR[SI]; SUB AL,30H; MOV HUN,AL; INC SI..MOV AL,ARR[SI]; SUB AL,30H; MOV TEN,AL; INC SI..MOV AL,ARR[SI]; SUB AL,30H; MOV UNT,AL.. MOV AX,0; MOV CL,100; MOV AL,HUN; MUL CL; MOV BX,AX..MOV AX,0; MOV CL,10; MOV AL,TEN; MUL CL..ADD AX,BX..MOV BX,0; MOV BL,UNT; ADD AX,BX..MOV RES,AX; MOV; AH,4CH; INT 21H; CODE ENDS; END START.

Similar questions