I am trying to make a program in which the user will need to type a command in a certain format to preform a calculation, for example, "get a number in Hexa,get another number in binary,subtract them,represent in decimal".
in order to do this I want to take each sentence until the char ','for example: "get a number in Hexa"
and then I will know to which function to jump, I thought about going over the input in a loop and just add it to a variable in which I will compare string with but do know how, here is what i wrote so far:
.model Small
.data
Table db "get a number in decimal,"," get a number in binary,"," get a number in hexa,"," get another number in binary,", "get another number in decimal,", "get another number in hexa"," multply them,"," sum them,", "subtract them,","divide them,","or them,","and them,","xor them," ,"not them,","represent in hexa,", "represen in binary,", "represent in decimal,"
Num dw ?
Num2 dw ?
Result dw ?
Num_count db 1
ourbuffer db ?
temp db ?
FirstS db "Please enter a the command in the following pattern: get a number in hexa,get another number in binary,substract them,represet in decimal",13,10,"$"
.stack 100H
.code
start:
mov AX,@data
mov DS,AX
mov di,0
mov si,0
instructions:
mov dx,offset FirstS ->print instruction to the user
mov ah,09h
int 21h
setBuffer:
mov bx,offset ourBuffer-set buffer
mov dx,bx
mov byte [bx],128
ScanInitialString:->get the string from the user
mov ah,0Ah
int 21h
reset:
mov si,0
mov DI,0
Extract:->here i want to extract each sentance into temp and then compare with Table
MOV Al,0
mov Al,ourbuffer[si]
mov temp[DI],Al
add SI,2
ADD DI,2
jmp Extract
Exit:
mov ax, 4c00H
int 21H
end Start
please assist me?