News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

having difficulty with extern

Started by ggmasm32, September 18, 2015, 04:46:29 AM

Previous topic - Next topic

ggmasm32

it is huge code and several files. May be I will put the beginning sections where most important declarations are:

disk.asm where it (int13fnc38Buf) is declared



include macros.inc
include video.inc
include disk.inc

public int13fnc38Buf

sta segment para stack use16 'stack'
sta ends

data segment para public 'data'
    dap             db  16  dup(31h)
    bufSectorRead   db  512 * 16 dup(33h)
    int13fnc38Buf   db  30h dup (34h)
data ends

code segment    para public use16 'code'
assume cs:code, ds:data, ss:sta

M_EXTERNDEF

;   Display drive params for drive information stored in DS:SI
;   input   DS:SI=pointer to drive parameter area.
;   output  CX=0 if success
;           CX=1 if if failure
;   destroys: CX

diskShowDiskParamMem proc  far
    M_PUSH <ax, dx, ds, si>
    M_PRINTF "\nIn


dskclone.asm where it is being used.

.686p

    include macros.inc
    include mbr.inc
    include dskclone.inc
    include disk.inc

; experimental asm file to test out anything in this file.
; past tests can be de-activated using DISABLE_<TESTNAME> software switch in
; exp.inc

sta segment para stack use16 'stack'
    db 100h dup(0)
sta ends

extrn int13fnc38Buf:byte

data segment para public 'data'

;   disk address packet.

dap db  16  dup(31h)

;   declare 16-sectors buffer.

;   bufSectorRead   db  (512 * 16) dup(33h)
;   testString      db  'test String $'

srcDrvNo        db  ?
dstDrvNo        db  ?
LowDrvNo        db  0           ; (Lowest disk No found)
HiDrvNo         db  0           ; (highets disk No found)
counter         db  0

srcDrvParams    db  30h dup (35h)
dstDrvParams    db  30h dup (36h)

remSectors      db  ?           ; number of sectors remainder if not multiple of 16.

data ends

code segment para public use16 'code'
assume cs:code, ds:data,ss:sta
M_EXTERNDEF


ggmasm32

I got by doing so that the var is only used inside disk.asm. any other module access will have to go through one of the api calls and not directly access the variable. Thanks.