【发布时间】:2021-06-03 21:32:27
【问题描述】:
我需要编写一个汇编语言程序来处理一个最大 20 字节的数组。该程序将在直接输入数组时以相反的顺序显示数组(反之亦然)。真正缺少什么?
例如a b c d e f g h i j 0 1 2 3 4 5 6 7 8 9(直)
程序从控制台接受数据并直接显示(不反转)
我真正需要做什么才能使输入的字符串显示?
在控制台输入后要显示的字符需要更改什么?
链.asm
; The program demonstrates the use of the 10th interrupt function 21h
; to load a string directly into pao
;author: xyz
.286
.model small
.data
Inscription db "Enter the inscription",13,10,'$'
bufor db 20,0,20 dup ('$')
.code
start:
;przyg. segmentowej cz. adresu
mov ax, seg _data
mov ds, ax
;przyg. offsetowej cz. adresu
mov dx, offset napis
;display the inscription
mov ah, 09h
int 21h
;load chain
mov dx, offset bufor
mov ah, 0ah
int 21h
mov ax,4c00h
int 21h
end start
循环
;The program demonstrates the use of the 2nd interrupt function 21h
;to read single characters to pao through the al register
;author: xyz
.286
.model small
.data
inscription db "Enter the inscription",13,10,'$'
bufor db 20,0,20 dup ('$')
.code
start:
;przyg. segmentowej cz. adresu
mov ax, seg _data
mov ds, ax
;przyg. offsetowej cz. adresu
mov dx, offset napis
mov di, dx
;wyswietlenie znakow
mov cx, 10h
mov ah, 02h
print:
mov dl,ds:[di]
int 21h
inc di
dec cx
print now
;wczytanie znakow
mov dx, offset bufor
mov di, dx
mov ah, 01h
enter:
int 21h
mov ds:[di], al
inc di
cmp al, 13 ;czy enter?
already type
mov ax,4c00h
int 21h
end start
【问题讨论】:
-
这不是 [gnu-assembler]
.intel_syntax noprefix。不要使用不适用的标签。对我来说,它看起来像 MASM 或 TASM 语法。 -
你知道这段代码是做什么的吗?
-
我有点知道鳕鱼在做什么,但我不知道如何才能得到能显示所写内容的东西,即功能 9 和 10 合二为一
-
我想说我不知道如何连接这两个函数,因为我希望我输入的脚本字符串再次显示