News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

code error

Started by xxxx, January 31, 2005, 07:38:31 AM

Previous topic - Next topic

xxxx

the following code was taken from a book:


PAGE 60,132
TITLE PROG2-19(EXE) PURPOSE:ADDS 5 BYTES OF DATA
     .MODEL SMALL
     .STACK 64



;------------------------------------

.DATA
DATA_IN DB 25H,12H,1FH,2BH
SUM     DB      ?

;-------------------------------------

.CODE
MAIN PROC FAR
    MOV AX,@DATA
    MOV DS,AX
    MOV CX,05
    MOV BX,OFFFSET DATA_IN
    MOV AL,0

AGAIN:ADD AL,[BX]
     INC BX
     DEC CX
     JNZ AGAIN
     MOV SUM,AL
     MOV AH,4CH
     INT 21H
MAIN      ENDP
     END MAIN


i am getting an error on line 21 which is 'mov bx,offset data_in' and the error is : error A2206: missing operator in expression
could someone explain what is the cause of the error and what i need to do to rectify it?
thanks

thomasantony

Hi,

   MOV BX,OFFFSET DATA_IN

shoudl be

MOV BX,OFFSET DATA_IN

It is OFFSET and not OFFFSET :lol :boohoo:

Thomas Antony :P ::) :P :lol :boohoo: :lol :P :U
There are 10 types of people in the world. Those who understand binary and those who don't.


Programmer's Directory. Submit for free