emu8086中的大数组定义问题

Large array definition problem in emu8086

我想绘制200x200大小的图片,我已经使用emu8086.I将像素坐标提取到屏幕上将坐标传输到数组并打印到屏幕上,但我无法打印整个array.When 我检查了状态,我注意到整个数组不是 memorized.How 我可以解决这个问题还是有其他方法?这是我的项目所需的结构。

我的ASM代码

 .stack 512
 .MODEL small 
DTSEG    SEGMENT
DATA_IN  DB 0Eh,0Fh,010h,011h,012h,013h,014h,02Bh,02Ch,02Dh,02Eh,02Fh,030h,031h,0Ah,0Bh,0Ch,0Dh,0Eh,0Fh,010h,011h,012h,013h,014h,015h,016h,017h,018h,027h,028h,029h,02Ah,02Bh,02Ch,02Dh,02Eh,02Fh,030h,031h,032h,033h,034h,035h,09h,0Ah,0Bh,0Ch,0Dh,0Eh,0Fh,010h,011h,012h,013h,014h,015h,016h,017h,018h,019h,1Ah,025h,026h,027h,028h,029h,02Ah,02Bh,02Ch,02Dh,02Eh,02Fh,030h,031h,032h,033h,034h,035h,036h,07h,08h,09h,0Ah,0Bh,0Ch,0Dh,0Eh,0Fh,010h,011h,012h,013h,014h,015h,016h,017h,018h,019h,1Ah,01Bh,024h,025h,026h,027h,028h,029h,02Ah,02Bh,02Ch,02Dh,02Eh,02Fh,030h,031h,032h,033h,034h,035h,036h,037h,038h,06h,07h,08h,09h,0Ah,0Bh,0Ch,0Dh,0Eh,0Fh,010h,011h,012h,013h,014h,015h,016h,017h,018h,019h,1Ah,01Bh,01Ch,023h,024h,025h,026h,027h,028h,029h,02Ah,02Bh,02Ch,02Dh,02Eh,02Fh,030h,031h,032h,033h,034h,035h,036h,037h,038h,039h,05h,06h,07h,08h,09h,0Ah,0Bh,0Ch,0Dh,016h,017h,018h,019h,1Ah,01Bh,01Ch,01Dh,022h,023h,024h,025h,026h,027h,028h,029h,032h,033h,034h,035h,036h,037h,038h,039h,03Ah,04h,05h,06h,07h,08h,09h,0Ah,0Bh,018h,019h,1Ah,01Bh,01Ch,01Dh,01Eh,021h,022h,023h,024h,025h,026h,027h,034h,035h,036h,037h,038h,039h,03Ah,03Bh,03h,04h,05h,06h,07h,08h,09h,019h,1Ah,01Bh,01Ch,01Dh,01Eh,01Fh,020h,021h,022h,023h,024h,025h,026h,036h,037h,038h,039h,03Ah,03Bh,03Ch,02h,03h,04h,05h,06h,07h,08h,1Ah,01Bh,01Ch,01Dh,01Eh,01Fh,020h,021h,022h,023h,024h,025h,037h,038h,039h,03Ah,03Bh,03Ch,03Dh,02h,03h,04h,05h,06h,07h,01Bh,01Ch,01Dh,01Eh,01Fh,020h,021h,022h,023h,024h,038h,039h,03Ah,03Bh,03Ch,03Dh,01h,02h,03h,04h,05h,06h,01Ch,01Dh,01Eh,01Fh,020h,021h,022h,023h,039h,03Ah,03Bh,03Ch,03Dh,03Eh,01h,02h,03h,04h,05h,06h,01Dh,01Eh,01Fh,020h,021h,022h,039h,03Ah,03Bh,03Ch,03Dh,03Eh,01h,02h,03h,04h,05h,01Eh,01Fh,020h,021h,03Ah,03Bh,03Ch,03Dh,03Eh,00h,01h,02h,03h,04h,05h,01Fh,020h,03Ah,03Bh,03Ch,03Dh,03Eh,03Fh,00h,01h,02h,03h,04h,03Bh,03Ch,03Dh,03Eh,03Fh,00h,01h,02h,03h,04h,03Bh,03Ch,03Dh,03Eh,03Fh,00h,01h,02h,03h,04h,03Bh,03Ch,03Dh,03Eh,03Fh,00h,01h,02h,03h,03Ch,03Dh,03Eh,03Fh,00h,01h,02h,03h,03Ch,03Dh,03Eh,03Fh,00h,01h,02h,03h,03Ch,03Dh,03Eh,03Fh,00h,01h,02h,03h,03Ch,03Dh,03Eh,03Fh,00h,01h,02h,03h,03Ch,03Dh,03Eh,03Fh,00h,01h,02h,03h,04h,03Bh,03Ch,03Dh,03Eh,03Fh,00h,01h,02h,03h,04h,03Bh,03Ch,03Dh,03Eh,03Fh,00h,01h,02h,03h,04h,03Bh,03Ch,03Dh,03Eh,03Fh,00h,01h,02h,03h,04h,03Bh,03Ch,03Dh,03Eh,03Fh,01h,02h,03h,04h,05h,03Ah,03Bh,03Ch,03Dh,03Eh,01h,02h,03h,04h,05h,03Ah,03Bh,03Ch,03Dh,03Eh,01h,02h,03h,04h,05h,06h,039h,03Ah,03Bh,03Ch,03Dh,03Eh,02h,03h,04h,05h,06h,07h,038h,039h,03Ah,03Bh,03Ch,03Dh,02h,03h,04h,05h,06h,07h,038h,039h,03Ah,03Bh,03Ch,03Dh,03h,04h,05h,06h,07h,08h,037h,038h,039h,03Ah,03Bh,03Ch,04h,05h,06h,07h,08h,09h,036h,037h,038h,039h,03Ah,03Bh,04h,05h,06h,07h,08h,09h,0Ah,035h,036h,037h,038h,039h,03Ah,03Bh,05h,06h,07h,08h,09h,0Ah,0Bh,034h,035h,036h,037h,038h,039h,03Ah,06h,07h,08h,09h,0Ah,0Bh,0Ch,033h,034h,035h,036h,037h,038h,039h,07h,08h,09h,0Ah,0Bh,0Ch,0Dh,032h,033h,034h,035h,036h,037h,038h,08h,09h,0Ah,0Bh,0Ch,0Dh,0Eh,031h,032h,033h,034h,035h,036h,037h,09h,0Ah,0Bh,0Ch,0Dh,0Eh,0Fh,030h,031h,032h,033h,034h,035h,036h,0Ah,0Bh,0Ch,0Dh,0Eh,0Fh,010h,02Fh,030h,031h,032h,033h,034h,035h,0Ah,0Bh,0Ch,0Dh,0Eh,0Fh,010h,011h,02Eh,02Fh,030h,031h,032h,033h,034h,035h,0Bh,0Ch,0Dh,0Eh,0Fh,010h,011h,012h,02Dh,02Eh,02Fh,030h,031h,032h,033h,034h,0Ch,0Dh,0Eh,0Fh,010h,011h,012h,013h,02Ch,02Dh,02Eh,02Fh,030h,031h,032h,033h,0Eh,0Fh,010h,011h,012h,013h,014h,02Bh,02Ch,02Dh,02Eh,02Fh,030h,031h,0Fh,010h,011h,012h,013h,014h,015h,02Ah,02Bh,02Ch,02Dh,02Eh,02Fh,030h,010h,011h,012h,013h,014h,015h,016h,029h,02Ah,02Bh,02Ch,02Dh,02Eh,02Fh,011h,012h,013h,014h,015h,016h,017h,018h,027h,028h,029h,02Ah,02Bh,02Ch,02Dh,02Eh,012h,013h,014h,015h,016h,017h,018h,019h,026h,027h,028h,029h,02Ah,02Bh,02Ch,02Dh,013h,014h,015h,016h,017h,018h,019h,1Ah,025h,026h,027h,028h,029h,02Ah,02Bh,02Ch,014h,015h,016h,017h,018h,019h,1Ah,01Bh,024h,025h,026h,027h,028h,029h,02Ah,02Bh,016h,017h,018h,019h,1Ah,01Bh,01Ch,023h,024h,025h,026h,027h,028h,029h,017h,018h,019h,1Ah,01Bh,01Ch,01Dh,022h,023h,024h,025h,026h,027h,028h,018h,019h,1Ah,01Bh,01Ch,01Dh,01Eh,01Fh,020h,021h,022h,023h,024h,025h,026h,027h,019h,1Ah,01Bh,01Ch,01Dh,01Eh,01Fh,020h,021h,022h,023h,024h,025h,026h,01Ah,01Bh,01Ch,01Dh,01Eh,01Fh,020h,021h,022h,023h,024h,025h,01Bh,01Ch,01Dh,01Eh,01Fh,020h,021h,022h,023h,024h,01Dh,01Eh,01Fh,020h,021h,022h,01Eh,01Fh,020h,021h

DATA_OUT  DB 03h,03h,03h,03h,03h,03h,03h,03h,03h,03h,03h,03h,03h,03h,04h,04h,04h,04h,04h,04h,04h,04h,04h,04h,04h,04h,04h,04h,04h,04h,04h,04h,04h,04h,04h,04h,04h,04h,04h,04h,04h,04h,04h,04h,05h,05h,05h,05h,05h,05h,05h,05h,05h,05h,05h,05h,05h,05h,05h,05h,05h,05h,05h,05h,05h,05h,05h,05h,05h,05h,05h,05h,05h,05h,05h,05h,05h,05h,05h,05h,06h,06h,06h,06h,06h,06h,06h,06h,06h,06h,06h,06h,06h,06h,06h,06h,06h,06h,06h,06h,06h,06h,06h,06h,06h,06h,06h,06h,06h,06h,06h,06h,06h,06h,06h,06h,06h,06h,06h,06h,06h,06h,07h,07h,07h,07h,07h,07h,07h,07h,07h,07h,07h,07h,07h,07h,07h,07h,07h,07h,07h,07h,07h,07h,07h,07h,07h,07h,07h,07h,07h,07h,07h,07h,07h,07h,07h,07h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,015h,015h,015h,015h,015h,015h,016h,016h,016h,016h,016h,016h,016h,016h,017h,017h,017h,017h,017h,017h,017h,017h,018h,018h,018h,018h,018h,018h,018h,018h,019h,019h,019h,019h,019h,019h,019h,019h,019h,019h,1Ah,1Ah,1Ah,1Ah,1Ah,1Ah,1Ah,1Ah,1Ah,1Ah,01Bh,01Bh,01Bh,01Bh,01Bh,01Bh,01Bh,01Bh,01Bh,01Bh,01Ch,01Ch,01Ch,01Ch,01Ch,01Ch,01Ch,01Ch,01Ch,01Ch,01Dh,01Dh,01Dh,01Dh,01Dh,01Dh,01Dh,01Dh,01Dh,01Dh,01Eh,01Eh,01Eh,01Eh,01Eh,01Eh,01Eh,01Eh,01Eh,01Eh,01Fh,01Fh,01Fh,01Fh,01Fh,01Fh,01Fh,01Fh,01Fh,01Fh,01Fh,01Fh,020h,020h,020h,020h,020h,020h,020h,020h,020h,020h,020h,020h,021h,021h,021h,021h,021h,021h,021h,021h,021h,021h,021h,021h,022h,022h,022h,022h,022h,022h,022h,022h,022h,022h,022h,022h,023h,023h,023h,023h,023h,023h,023h,023h,023h,023h,023h,023h,024h,024h,024h,024h,024h,024h,024h,024h,024h,024h,024h,024h,024h,024h,025h,025h,025h,025h,025h,025h,025h,025h,025h,025h,025h,025h,025h,025h,026h,026h,026h,026h,026h,026h,026h,026h,026h,026h,026h,026h,026h,026h,027h,027h,027h,027h,027h,027h,027h,027h,027h,027h,027h,027h,027h,027h,028h,028h,028h,028h,028h,028h,028h,028h,028h,028h,028h,028h,028h,028h,029h,029h,029h,029h,029h,029h,029h,029h,029h,029h,029h,029h,029h,029h,02Ah,02Ah,02Ah,02Ah,02Ah,02Ah,02Ah,02Ah,02Ah,02Ah,02Ah,02Ah,02Ah,02Ah,02Bh,02Bh,02Bh,02Bh,02Bh,02Bh,02Bh,02Bh,02Bh,02Bh,02Bh,02Bh,02Bh,02Bh,02Bh,02Bh,02Ch,02Ch,02Ch,02Ch,02Ch,02Ch,02Ch,02Ch,02Ch,02Ch,02Ch,02Ch,02Ch,02Ch,02Ch,02Ch,02Dh,02Dh,02Dh,02Dh,02Dh,02Dh,02Dh,02Dh,02Dh,02Dh,02Dh,02Dh,02Dh,02Dh,02Dh,02Dh,02Eh,02Eh,02Eh,02Eh,02Eh,02Eh,02Eh,02Eh,02Eh,02Eh,02Eh,02Eh,02Eh,02Eh,02Fh,02Fh,02Fh,02Fh,02Fh,02Fh,02Fh,02Fh,02Fh,02Fh,02Fh,02Fh,02Fh,02Fh,030h,030h,030h,030h,030h,030h,030h,030h,030h,030h,030h,030h,030h,030h,031h,031h,031h,031h,031h,031h,031h,031h,031h,031h,031h,031h,031h,031h,031h,031h,032h,032h,032h,032h,032h,032h,032h,032h,032h,032h,032h,032h,032h,032h,032h,032h,033h,033h,033h,033h,033h,033h,033h,033h,033h,033h,033h,033h,033h,033h,033h,033h,034h,034h,034h,034h,034h,034h,034h,034h,034h,034h,034h,034h,034h,034h,034h,034h,035h,035h,035h,035h,035h,035h,035h,035h,035h,035h,035h,035h,035h,035h,036h,036h,036h,036h,036h,036h,036h,036h,036h,036h,036h,036h,036h,036h,037h,037h,037h,037h,037h,037h,037h,037h,037h,037h,037h,037h,037h,037h,037h,037h,038h,038h,038h,038h,038h,038h,038h,038h,038h,038h,038h,038h,038h,038h,039h,039h,039h,039h,039h,039h,039h,039h,039h,039h,039h,039h,03Ah,03Ah,03Ah,03Ah,03Ah,03Ah,03Ah,03Ah,03Ah,03Ah,03Bh,03Bh,03Bh,03Bh,03Bh,03Bh,03Ch,03Ch,03Ch,03Ch

DTSEG ENDS       
        .CODE
screen macro 
    mov ah,00
    mov al,13h
    int 10h
endm

clear_screen macro  
    mov ax,600h 
    mov bh,07h  
    mov cx,0    
    mov bx,184fh 
    int 10h
endm
MAIN    PROC FAR  
        ASSUME DS:DTSEG
        MOV AX,DTSEG
        MOV DS,AX
        MOV AX,0xA000 
        MOV ES,AX
        MOV BX,OFFSET DATA_IN  
        MOV SI,OFFSET DATA_OUT 
        PUSH BX
        screen 
        POP BX 
        MOV CX,906 
   DNG:
        PUSH CX 
        XOR CX,CX
        mov cx,[BX]    
        XOR CH,CH 
        xor dx,dx
        mov dx,[SI] 
        xor dh,dh 
        PUSH BX
        xor bx,bx
        mov bh,0h ;sayfa sayisi
        POP BX
        mov ah,0ch 
        mov al,06
        int 10h
        INC SI
        INC BX  
        POP CX
        LOOP DNG 
        
        INT 21H
MAIN    ENDP
        END MAIN
; add your code here

ret

我在这里的数组中尝试了一个 64x64 图像,结果是一样的。等待您的帮助

看到 MOV CX,906,我猜,这就是您可以在单个 db 行中填充的全部内容。就像@ecm 在她的评论中告诉你的那样,你应该在多行 db 上写数据,最好让数字对齐(为了你自己的观看乐趣):

X db  0Eh, 0Fh,010h,011h,012h,013h,014h,02Bh
  db 02Ch,02Dh,02Eh,02Fh,030h,031h, 0Ah, 0Bh 
  db  0Ch, 0Dh, 0Eh, 0Fh,010h,011h,012h,013h
  db 014h,015h,016h,017h,018h,027h,028h,029h
  db ...

Y db 03h,03h,03h,03h,03h,03h,03h,03h
  db 03h,03h,03h,03h,03h,03h,04h,04h
  db 04h,04h,04h,04h,04h,04h,04h,04h
  db 04h,04h,04h,04h,04h,04h,04h,04h
  db ...

因为你的DATA_INDATA_OUT数组实际上是X和Y坐标,为什么不你更恰当地命名它们 XY?


代码还有一些问题:

  • clear_screen宏中,mov bx,184fh指令有两处错误。 LowerRightCorner 必须进入 DX 并且对于 320x200 256 色屏幕 (13h),列数为 40,因此 4Fh 不是正确的值。使用 mov dx, 1827h.

  • 因为你写了mov bh,0h ;sayfa sayisi然后是POP BX,你不会在BH中设置DisplayPage。

  • 下方的 INT 21H 指令在 AH 中缺少其功能编号。可能你的意思是 mov ax, 4C00h int 21h.


快速修复,以便您了解还有哪些改进可能!

        ...
        MOV  AX, DTSEG
        MOV  DS, AX
        screen
        MOV  si, OFFSET X  
        MOV  di, OFFSET Y 
        mov  bh, 0          ;sayfa sayisi
        MOV  CX, 906 
   DNG:
        PUSH CX 
        XOR  CX, CX
        mov  cl, [si]    
        xor  dx, dx
        mov  dl, [di]
        mov  ah, 0Ch 
        mov  al, 6         ; Brown
        int  10h
        INC  si
        INC  di 
        POP  CX
        LOOP DNG 
        
        mov  ax, 4C00h
        INT  21h
        ...