There are a number of items that are to be pointed out here. Sometimes you will use the keyterm offset while other times you will use ADDR.

Take note of the different ways the macro print is used. In reality, they are all reduced by the macro to the same thing.

Another item of interest here is that you only see one include. It takes care of including everything else that is necessary.

Also notice the chr$ and str$ macros being used. You must convert numeric variables to a string in order to output them.

addr_offset.asm

; filename:  addr_offset.asm
; author:    Gary Burt
; date:      July 8, 2007
; Type app:  Console

    include \masm32\include\masm32rt.inc

    .data
myVar   db  "This is it",0
msg     db  "Enter a number: ",0
myStr   db  128 dup(0)    
    
    .code                       ; Tell MASM where the code starts

; ллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллл

start:                          ; The CODE entry point to the program

    call main                   ; branch to the "main" procedure

    exit

; ллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллл

main proc

    LOCAL var1:DWORD            ; space for a DWORD variable
    LOCAL str1:DWORD            ; a string handle for the input data


    
    print chr$("Address of myVar",13,10)
    mov   ecx, offset myVar     ;ADDR did not work 
    print str$(ecx)             ; show the result at the console
    print chr$(13,10,13,10)

    print chr$("Address of var1",13,10)
    mov   ecx, var1             ; offset/ADDR did not work -- LOCAL
    print str$(ecx)             ; show the result at the console
                                ;   Verify that the result is the offset 
                                ;   from the frame pointer.
    print chr$(13,10,13,10)


    print offset myVar          ; address from .data
    print chr$(13,10,13,10)

    print ADDR myVar            ; address from .data
    print chr$(13,10,13,10)

    mov   var1, 3
    print str$(var1)
    print chr$(13,10,13,10)

    mov   var1, sval(input("Enter a number: " ) )
    print str$( var1 )
    print chr$(13,10,13,10)

    mov   str1,input("Enter a string: ")
    print str1                  ; Note:  Other example was in the form of print offset myVar
                                ; which does not work with LOCAL 
    print chr$(13,10,13,10)

    mov   str1, input("Enter another string: ")
    print str1
    print chr$(13,10,13,10)

    print chr$("Enter a third string:")
    invoke StdIn, ADDR myStr, 128
    invoke StdOut, ADDR myStr
    
    
    ret

main endp

; ллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллл

end start                       ; Tell MASM where the program ends