
DSPValue  macro   hWnd:req, value:req, sign:=<1>, loc:=<'m'>
LOCAL lbl
LOCAL LibName
LOCAL ProcName
LOCAL NoDllMsg
LOCAL NoDllMsgT
LOCAL NoDSPValue

      pushad
;         jmp     lbl
.data
NoDllMsg  db  "Could't load the above DLL."
          db   0dh,0ah
          db  'You will need to place the DLL in the same Dir.'
          db   0dh,0ah
          db  'That your executing your program from.',0
NoDllMsgT db  "Could't load the DSPVALUE.dll.",0
LibName   db  "DSPVALUE.dll",0
ProcName  db  "BaseAscii",0
;lbl:
.code
        push     loc
        push     sign
        push     value
        push     hWnd
      INVOKE     LoadLibrary, ADDR LibName
      .if !eax
            pop     eax
            pop     eax
            pop     eax
            pop     eax
            mov     al, loc
         .if al == 'T' || al == 't'
            INVOKE     SetWindowText, hWnd, addr NoDllMsgT
               jmp     NoDSPValue
         .endif
         .if al == 'S' || al == 's'
            INVOKE     SendMessage, hWnd, SB_SETTEXT, 0, addr NoDllMsgT
               jmp     NoDSPValue
         .endif
         INVOKE     MessageBox, NULL, addr NoDllMsg, addr LibName, MB_OK or MB_ICONWARNING
            jmp     NoDSPValue
      .endif
      INVOKE     GetProcAddress, eax, ADDR ProcName
        call     eax
NoDSPValue:
       popad
        ENDM

;==================================================
DSPRegs MACRO hWnd
LOCAL NoDllMsg
LOCAL LibName
LOCAL ProcName
LOCAL hLib
LOCAL NoDSPValue

      pushad

.data
NoDllMsg  db  "Could't load the above DLL."
          db   0dh,0ah
          db  'You will need to place the DLL in the same Dir.'
          db   0dh,0ah
          db  'That your executing your program from.',0
LibName   db  'DSPVALUE.dll',0
ProcName  db  'ShowRegs',0
hLib      dd  0

.code
      INVOKE     LoadLibrary, ADDR LibName
         mov     hLib, eax
       popad
      pushad
      .if !hLib ;!eax
         INVOKE     MessageBox, NULL, addr NoDllMsg, addr LibName, MB_OK or MB_ICONWARNING
            jmp     NoDSPValue
      .endif
      pushfd
        push     esp
        push     ebp
        push     edi
        push     esi
        push     edx
        push     ecx
        push     ebx
        push     eax
        push     hWnd
      invoke     GetProcAddress, hLib, ADDR ProcName
        call     eax

NoDSPValue:
       popad
      ENDM
