Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/loops/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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/assembly/5.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
Loops 循环和增量是否对齐?_Loops_Assembly_X86_Alignment_Increment - Fatal编程技术网

Loops 循环和增量是否对齐?

Loops 循环和增量是否对齐?,loops,assembly,x86,alignment,increment,Loops,Assembly,X86,Alignment,Increment,有没有办法循环对齐代码 因为我想显示这种输出。请点击 如果要使用循环,如何更改对齐和数字递增的设置 这是我的代码示例: mov cx, 5 ; counter try: ; loop mov ah,2 mov bh,1 ;1st column number 1 mov dl,12 int 10h Mov ah, 2 Mov dl, 49 ; display 1 int 21h mov ah,2 mov

有没有办法循环对齐代码

因为我想显示这种输出。请点击

如果要使用循环,如何更改对齐和数字递增的设置

这是我的代码示例:

 mov cx, 5     ; counter

 try:          ; loop

 mov ah,2      
 mov bh,1      ;1st column number 1
 mov dl,12
 int 10h

 Mov ah, 2
 Mov dl, 49    ; display 1
 int 21h

 mov ah,2      
 mov bh,2      ;2nd column number 1
 mov dl,10
 int 10h

 Mov ah, 2
 Mov dl, 49    ; display 1
 int 21h


 mov ah,2      
 mov bh,2      ;2nd column number 2
 mov dl,14
 int 10h

 Mov ah, 2
 Mov dl, 50    ; display 2
 int 21h

 loop try
请帮帮我


谢谢}

算法非常简单。下面是一些C-ish代码,让您了解如何实现它(我将把程序集实现留给您,因为这是您的任务):

#定义第5行
对于(int row=0;row
这就是问题所在,先生。我不太熟悉汇编的语法。我不知道该用什么。下载x86并开始阅读。
#define ROWS 5

for (int row = 0; row < ROWS; row++) {
    move_to_xy(ROWS - (row + 1), row);
    for (int column = 0; column < row + 1; column++) {
        printf("%d ", column + 1);
    }
}