我几乎在学习组装,并成功解决了我在这里打印的问题
现在我有另一个问题。
我正在使用emu8086。我让这段代码使用带有背景颜色的空格字符以位打印小兵的图像。我设法让它每行打印图像,但是当它到达第 26 行时,它停止打印并且出现“错误中断”的错误。
谁能帮我。
这是整个代码:
org 100h
name "charchar"
org 100h
;buhok line 1 (Grey)
mov ax,0B800h
mov es,ax
mov di,56;<target_address = y*160 + x*2> ; es:di set up
mov ah,00001000b;<color_attribute_for_whole_string>
; now the print by letter gets here
mov al,179 ; al = letter, ah = attribute (ax set up)
stosw ; [es:di] = ax, di += 2
;buhok line 2
mov ax,0B800h
mov es,ax
mov di,200;<target_address = y*160 + x*2> ; es:di set up
mov ah,00001000b;<color_attribute_for_whole_string>
; now the print by letter gets here
mov al,092 ; al = letter, ah = attribute (ax set up)
stosw ; [es:di] = ax, di += 2
mov ax,0B800h
mov es,ax
mov di,202;<target_address = y*160 + x*2> ; es:di set up
mov ah,00001000b;<color_attribute_for_whole_string>
; now the print by letter gets here
mov al,092 ; al = letter, ah = attribute (ax set up)
stosw ; [es:di] = ax, di += 2
mov ax,0B800h
mov es,ax
mov di,208;<target_address = y*160 + x*2> ; es:di set up
mov ah,00001000b;<color_attribute_for_whole_string>
; now the print by letter gets here
mov al,179 ; al = letter, ah = attribute (ax set up)
stosw ; [es:di] = ax, di += 2
mov ax,0B800h
mov es,ax
mov di,210;<target_address = y*160 + x*2> ; es:di set up
mov ah,00001000b;<color_attribute_for_whole_string>
; now the print by letter gets here
mov al,179 ; al = letter, ah = attribute (ax set up)
stosw ; [es:di] = ax, di += 2
mov ax,0B800h
mov es,ax
mov di,214;<target_address = y*160 + x*2> ; es:di set up
mov ah,00001000b;<color_attribute_for_whole_string>
; now the print by letter gets here
mov al,179 ; al = letter, ah = attribute (ax set up)
stosw ; [es:di] = ax, di += 2
mov ax,0B800h
mov es,ax
mov di,216;<target_address = y*160 + x*2> ; es:di set up
mov ah,00001000b;<color_attribute_for_whole_string>
; now the print by letter gets here
mov al,179 ; al = letter, ah = attribute (ax set up)
stosw ; [es:di] = ax, di += 2
mov ax,0B800h
mov es,ax
mov di,218;<target_address = y*160 + x*2> ; es:di set up
mov ah,00001000b;<color_attribute_for_whole_string>
; now the print by letter gets here
mov al,179 ; al = letter, ah = attribute (ax set up)
stosw ; [es:di] = ax, di += 2
mov ax,0B800h
mov es,ax
mov di,222;<target_address = y*160 + x*2> ; es:di set up
mov ah,00001000b;<color_attribute_for_whole_string>
; now the print by letter gets here
mov al,179 ; al = letter, ah = attribute (ax set up)
stosw ; [es:di] = ax, di += 2
mov ax,0B800h
mov es,ax
mov di,226;<target_address = y*160 + x*2> ; es:di set up
mov ah,00001000b;<color_attribute_for_whole_string>
; now the print by letter gets here
mov al,179 ; al = letter, ah = attribute (ax set up)
stosw ; [es:di] = ax, di += 2
mov ax,0B800h
mov es,ax
mov di,230;<target_address = y*160 + x*2> ; es:di set up
mov ah,00001000b;<color_attribute_for_whole_string>
; now the print by letter gets here
mov al,047 ; al = letter, ah = attribute (ax set up)
stosw ; [es:di] = ax, di += 2
mov ax,0B800h
mov es,ax
mov di,234;<target_address = y*160 + x*2> ; es:di set up
mov ah,00001000b;<color_attribute_for_whole_string>
; now the print by letter gets here
mov al,047 ; al = letter, ah = attribute (ax set up)
stosw ; [es:di] = ax, di += 2
;buhok line 3
mov ax,0B800h
mov es,ax
mov di,352;<target_address = y*160 + x*2> ; es:di set up
mov ah,00001000b;<color_attribute_for_whole_string>
; now the print by letter gets here
mov al,092 ; al = letter, ah = attribute (ax set up)
stosw ; [es:di] = ax, di += 2
mov ax,0B800h
mov es,ax
mov di,354;<target_address = y*160 + x*2> ; es:di set up
mov ah,00001000b;<color_attribute_for_whole_string>
; now the print by letter gets here
mov al,092 ; al = letter, ah = attribute (ax set up)
stosw ; [es:di] = ax, di += 2
mov ax,0B800h
mov es,ax
mov di,356;<target_address = y*160 + x*2> ; es:di set up
mov ah,00001000b;<color_attribute_for_whole_string>
; now the print by letter gets here
mov al,092 ; al = letter, ah = attribute (ax set up)
stosw ; [es:di] = ax, di += 2
mov ax,0B800h
mov es,ax
mov di,358;<target_address = y*160 + x*2> ; es:di set up
mov ah,00001000b;<color_attribute_for_whole_string>
; now the print by letter gets here
mov al,092 ; al = letter, ah = attribute (ax set up)
stosw ; [es:di] = ax, di += 2
mov ax,0B800h
mov es,ax
mov di,360;<target_address = y*160 + x*2> ; es:di set up
mov ah,00001000b;<color_attribute_for_whole_string>
; now the print by letter gets here
mov al,092 ; al = letter, ah = attribute (ax set up)
stosw ; [es:di] = ax, di += 2
mov ax,0B800h
mov es,ax
mov di,362;<target_address = y*160 + x*2> ; es:di set up
mov ah,00001000b;<color_attribute_for_whole_string>
; now the print by letter gets here
mov al,092 ; al = letter, ah = attribute (ax set up)
stosw ; [es:di] = ax, di += 2
mov ax,0B800h
mov es,ax
mov di,364;<target_address = y*160 + x*2> ; es:di set up
mov ah,00001000b;<color_attribute_for_whole_string>
; now the print by letter gets here
mov al,092 ; al = letter, ah = attribute (ax set up)
stosw ; [es:di] = ax, di += 2
mov ax,0B800h
mov es,ax
mov di,366;<target_address = y*160 + x*2> ; es:di set up
mov ah,00001000b;<color_attribute_for_whole_string>
; now the print by letter gets here
mov al,092 ; al = letter, ah = attribute (ax set up)
stosw ; [es:di] = ax, di += 2
mov ax,0B800h
mov es,ax
mov di,368;<target_address = y*160 + x*2> ; es:di set up
mov ah,00001000b;<color_attribute_for_whole_string>
; now the print by letter gets here
mov al,179 ; al = letter, ah = attribute (ax set up)
stosw ; [es:di] = ax, di += 2
mov ax,0B800h
mov es,ax
mov di,370;<target_address = y*160 + x*2> ; es:di set up
mov ah,00001000b;<color_attribute_for_whole_string>
; now the print by letter gets here
mov al,179 ; al = letter, ah = attribute (ax set up)
stosw ; [es:di] = ax, di += 2
mov ax,0B800h
mov es,ax
mov di,372;<target_address = y*160 + x*2> ; es:di set up
mov ah,00001000b;<color_attribute_for_whole_string>
; now the print by letter gets here
mov al,179 ; al = letter, ah = attribute (ax set up)
stosw ; [es:di] = ax, di += 2
mov ax,0B800h
mov es,ax
mov di,374;<target_address = y*160 + x*2> ; es:di set up
mov ah,00001000b;<color_attribute_for_whole_string>
; now the print by letter gets here
mov al,179 ; al = letter, ah = attribute (ax set up)
stosw ; [es:di] = ax, di += 2
mov ax,0B800h
mov es,ax
mov di,376;<target_address = y*160 + x*2> ; es:di set up
mov ah,00001000b;<color_attribute_for_whole_string>
; now the print by letter gets here
mov al,179 ; al = letter, ah = attribute (ax set up)
stosw ; [es:di] = ax, di += 2
mov ax,0B800h
mov es,ax
mov di,378;<target_address = y*160 + x*2> ; es:di set up
mov ah,00001000b;<color_attribute_for_whole_string>
; now the print by letter gets here
mov al,179 ; al = letter, ah = attribute (ax set up)
stosw ; [es:di] = ax, di += 2
mov ax,0B800h
mov es,ax
mov di,382;<target_address = y*160 + x*2> ; es:di set up
mov ah,00001000b;<color_attribute_for_whole_string>
; now the print by letter gets here
mov al,179 ; al = letter, ah = attribute (ax set up)
stosw ; [es:di] = ax, di += 2
mov ax,0B800h
mov es,ax
mov di,384;<target_address = y*160 + x*2> ; es:di set up
mov ah,00001000b;<color_attribute_for_whole_string>
; now the print by letter gets here
mov al,179 ; al = letter, ah = attribute (ax set up)
stosw ; [es:di] = ax, di += 2
mov ax,0B800h
mov es,ax
mov di,386;<target_address = y*160 + x*2> ; es:di set up
mov ah,00001000b;<color_attribute_for_whole_string>
; now the print by letter gets here
mov al,179 ; al = letter, ah = attribute (ax set up)
stosw ; [es:di] = ax, di += 2
mov ax,0B800h
mov es,ax
mov di,388;<target_address = y*160 + x*2> ; es:di set up
mov ah,00001000b;<color_attribute_for_whole_string>
; now the print by letter gets here
mov al,47 ; al = letter, ah = attribute (ax set up)
stosw ; [es:di] = ax, di += 2
mov ax,0B800h
mov es,ax
mov di,390;<target_address = y*160 + x*2> ; es:di set up
mov ah,00001000b;<color_attribute_for_whole_string>
; now the print by letter gets here
mov al,47 ; al = letter, ah = attribute (ax set up)
stosw ; [es:di] = ax, di += 2
mov ax,0B800h
mov es,ax
mov di,392;<target_address = y*160 + x*2> ; es:di set up
mov ah,00001000b;<color_attribute_for_whole_string>
; now the print by letter gets here
mov al,47 ; al = letter, ah = attribute (ax set up)
stosw ; [es:di] = ax, di += 2
mov ax,0B800h
mov es,ax
mov di,394;<target_address = y*160 + x*2> ; es:di set up
mov ah,00001000b;<color_attribute_for_whole_string>
; now the print by letter gets here
mov al,47 ; al = letter, ah = attribute (ax set up)
stosw ; [es:di] = ax, di += 2
mov ax,0B800h
mov es,ax
mov di,396;<target_address = y*160 + x*2> ; es:di set up
mov ah,00001000b;<color_attribute_for_whole_string>
; now the print by letter gets here
mov al,47 ; al = letter, ah = attribute (ax set up)
stosw ; [es:di] = ax, di += 2
........
;line 26 Hand, Body blue
mov ax,0B800h
mov es,ax
mov di,4172;<target_address = y*160 + x*2> ; es:di set up
mov ah,10001000b;<color_attribute_for_whole_string>
; now the print by letter gets here
mov al,' ' ; al = letter, ah = attribute (ax set up)
stosw ; [es:di] = ax, di += 2
mov al,' ' ; al = letter, ah = attribute (ax set up)
stosw ; [es:di] = ax, di += 2
mov al,' ' ; al = letter, ah = attribute (ax set up)
stosw ; [es:di] = ax, di += 2
mov al,' ' ; al = letter, ah = attribute (ax set up)
stosw ; [es:di] = ax, di += 2
mov ax,0B800h
mov es,ax
mov di,4188;<target_address = y*160 + x*2> ; es:di set up
mov ah,11101000b;<color_attribute_for_whole_string>
; now the print by letter gets here
mov al,' ' ; al = letter, ah = attribute (ax set up)
stosw ; [es:di] = ax, di += 2
mov dl,0 ;X (SCREEN COORDINATE).
mov dh,5 ;Y (SCREEN COORDINATE).
int 10h ;BIOS SCREEN SERVICES.
;FINISH THE PROGRAM PROPERLY.
mov ax,4c00h
int 21h
ret