First of all, thank you for your interest and help in my topic. Do any of you know how to do it? We wrote the code in class together with the lecturer, but I do not know if it is correct for the 8086 processor. I am a beginner and i was start learning assembler and I apologize if I give any big mistakes.
%include "asm.mac"
global ToDec
SUB ToDec, number, podstawa
%define result ebx
mov edi,decoder
mov esi,number
xor result,result
or ecx,-1
.go
xor eax,eax
lodsb
call instr, edi, eax
and al,al
jz .quit
dec eax
push eax
mov eax,result
mul dword base
pop ebx
add eax,ebx
mov result,eax
loop .go
.quit
mov eax,result
ENDSUB
SUB instr, searchString, CharToFind
%define result edx
xor result,result
mov ebx,CharToFind
mov esi,searchString
or ecx,-1
.go:
lodsb
and al,al
jz .notf
cmp al,bl
loopne .go
;found
sub esi,searchString
mov result,esi
.notf
mov eax,result
ENDSUB
segment .data use32
decoder db "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ",0