我对下面给出的汇编语言程序感到困惑。在明确声明的行

时间:2018-11-29 13:23:07

标签: assembly dos masm x86-16 real-mode

我感到困惑的是,变量DPBBUF_SIZ的值将低于(4472 + 15)/ 16并分配给变量DPBBUF_SIZ的值是十六进制还是十进制。请让我知道将为变量DPBBUF_SIZ分配什么值。预先感谢。

    DOSSIZE     EQU  5000H
    DPBBUF_SIZ  DW   (4472 + 15) / 16 ; my PROBLEM is that what value will 
                                  ;be assigned to varible "DPBBUF_SIZ" here.
    GOINIT:
    CLD
    XOR     SI,SI
    MOV     DI,SI

    IF      MSVER
    MOV     CX,[MEMORY_SIZE]
    CMP     CX,1
    JNZ     NOSCAN
    MOV     CX,2048                 ; START SCANNING AT 32K BOUNDARY
    XOR     BX,BX

    MEMSCAN:INC     CX
    JZ      SETEND
    MOV     DS,CX
    MOV     AL,[BX]
    NOT     AL
    MOV     [BX],AL
    CMP     AL,[BX]
    NOT     AL
    MOV     [BX],AL
    JZ      MEMSCAN
    SETEND:
    MOV     [MEMORY_SIZE],CX
    ENDIF

    IF      IBMVER OR IBMJAPVER
    MOV     CX,[MEMORY_SIZE]
    ENDIF

    NOSCAN:
    MOV     AX,CS
    MOV     DS,AX
    ASSUME  DS:SYSINITSEG

    IF      HIGHMEM
    SUB     CX,(DOSSIZE / 16)       ; Leave room for DOS
    SUB     CX,CS:[DPBBUF_SIZ]      ; Allow OEM to tune  (my problem: what 
             ;will be the final value of CX after this line or instruction)
    ENDIF


    SHR     AX,1                    ; Divide by 16 for paras
    SHR     AX,1
    SHR     AX,1
    SHR     AX,1
    SUB     CX,AX
    MOV     ES,CX

    SHR     CX,1                    ; Divide by 2 to get words
    REP     MOVSW                   ; RELOCATE SYSINIT

    ASSUME  ES:SYSINITSEG

    PUSH    ES
    MOV     AX,OFFSET SYSIN
    PUSH    AX

    ....................
    ....more code here..

我认为给定的代码足以理解问题。我在某处做任何错误,请指导。 谢谢。

0 个答案:

没有答案