0

I'd like to write a program that counts the amount of specific symbols in string using scasb and masm32, I found the example, but I couldn't figure out why i'm getting errors. Here's the part of code:

.data
str  db '. . .'

len_str=$-str

.code                     

start:                      

  mov  ax,@data
  mov  ds,ax
  mov  es,ax
  lea  di,str
  mov  cx, len_str  
  mov  al,' '
  mov  bx,0 
  cld

cycl:
repe scasb
  jcxz exit 
  inc  bx
  jmp  cycl

exit:  

getting

A2008 syntax error db, str

A2006 syntax error len_str

A2148 invalid symbol type in expression: exit

A2004: symbol type conflict

Vanguard
  • 129
  • 1
  • 11

1 Answers1

2

str is an instruction, it is the mnemonic for Store Task Register. You cannot use it as a label name as you are trying to do. Name it something else and that should take care of your errors

Gunner
  • 5,780
  • 2
  • 25
  • 40