Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/video/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Video 需要汇编程序视频模式的帮助吗_Video_Assembly_Interrupt - Fatal编程技术网

Video 需要汇编程序视频模式的帮助吗

Video 需要汇编程序视频模式的帮助吗,video,assembly,interrupt,Video,Assembly,Interrupt,我正在为我的班级做一些编码,我认为我在正确的轨道上,但我有一个垂直线的问题。当我运行这段代码时,它会在同一个确切位置同时画两条水平线,但我需要第2行从50,50垂直移动到50,75,而不是从50,50水平移动到75,50水平。我不是在问答案,我只是需要一个提示和解释,谢谢: ; video.asm ; uses interrupts to set video mode and draw a line include 'emu8086.inc' org 100h ; set location

我正在为我的班级做一些编码,我认为我在正确的轨道上,但我有一个垂直线的问题。当我运行这段代码时,它会在同一个确切位置同时画两条水平线,但我需要第2行从50,50垂直移动到50,75,而不是从50,50水平移动到75,50水平。我不是在问答案,我只是需要一个提示和解释,谢谢:

; video.asm
; uses interrupts to set video mode and draw a line

include 'emu8086.inc'

org  100h ; set location counter to 100h

jmp CodeStart

DataStart:
    xStart1 dw 50        ; x coordinate of line start 1
    yStart1 dw 50        ; y coordinate of line start 1
    xStart2 dw 50        ; x coordinate of line start 2
    yStart2 dw 50        ; y coordinate of line start 2
    length dw 25        ; length of line

CodeStart:

    ; set the video mode 320x200, 256 colors
    mov al, 13h
    mov ah, 0
    int 10h

    ; initialize cx (x coord) to xStart1 + length
    ; initialize bx (y coord) to yStart2 + length
    mov cx, xStart1
    mov bx, yStart2
    add cx, length
    add bx, length


    ; loop from (xStart1+length) to xStart1 to draw a horizontal line
    ; loop from (yStart1+length) to yStart1 to draw a vertical line
    LoopStart:    

        ; draw a pixel
        ; set color in al, x in cx, y in dx
        mov al, 50
        mov dx, yStart1

        ; set sub function value in ah to draw a pixel
        ; and invoke the interrupt
        mov ah, 0ch
        int 10h

        ; decrement the x coord for line 1
        ; decrement the y coord for line 2
        sub cx, 1
        sub bx, 1

        ; test to see if x coord has reached start value
        cmp cx, xStart1

    ; continue loop if cx >= xStart1
    jae LoopStart

    ret

与其保持
y
常数和变化
x
,不如保持
x
常数和变化
y

而不是保持
y
常数和变化
x
,保持
x
常数和变化
y