我几乎学习大会,并成功地解决了我的问题在打印here为什么我的装配打印不能在第26行之后打印字符?
现在我还有一个问题。
我使用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
@ Ped7g希望你也可以在这里帮忙 –
历史上,PC上的文本模式限于25行。第26行(部分)在视频RAM内存范围之外。 Emu8086可能会认为这是一个段错误。顺便说一下,在接近结束时,您先调用“INT 10h”,而不先将“AH”设置为2。 –
什么是80x25中的第26行?也许你想首先切换到其他文本模式更多的线?像80x50一样? https://en.wikipedia.org/wiki/VGA-compatible_text_mode#PC_common_text_modes ...在80x25“第26行”不存在,所以我不知道你想要达到什么。 – Ped7g