Jing Wen
Jing Wen

Reputation: 20

Using 'LENGTHOF' in dosbox's masm

I am running masm within dosbox environment. Using the masm.exe from the following link

https://medium.com/@axayjha/getting-started-with-masm-8086-assembly-c625478265d8

I am trying to read the length of an array by using 'LENGTHOF'. When i trying to assemble the codes, the following is shown up.

Please check the following snapshot of the assembling output.

enter image description here

The following are my codes to run

  .386
  .model small
  .stack 100
  .data
        ; Your data definition
        message1 db "Please key in numbers: ", "$"
        message2 db "The number you keyed in is: ", "$"
        nextLine db 0Ah, 0Dh, "$"
   .code
main proc
        ; Your program here
    mov ax, @data
    mov ds, ax
    mov dx,LENGTHOF nextLine

    
END_PROGRAM:
   mov ah, 4ch ; Program ending
   int 21h
   end main

Is there any steps needed to enable the functions of LENGTHOF ?

Upvotes: 0

Views: 428

Answers (1)

vengy
vengy

Reputation: 2257

LENGTHOF was introduced in MASM Version 6.0
I've used this site MASM32 SDK Version 11 Downloads to update MASM.

masmv6

Upvotes: 1

Related Questions