-1
Ich möchte die LOOP
Anweisung verwenden, um diese Zeichenfolge in der Montage drucken:Assembly Schleife char
abcccbcccabcccbccc
Wir haben ab
, ccc
, b
und dann Sicherung ab
und dann ccc
.
Ich hoffe, ich werde mit Ihrer Hilfe einige Lösungen finden.
Ich benutze Emu, um die Quelle zu kompilieren!
.model small
.stack 200h
.code
main PROC
mov ah, 0
mov al, 12h ; Clear screen
int 10h
mov ah, 3
mov bh, 0 ; get cursor
int 10h
mov ah, 2
mov bh, 0 ;set cursor
mov dl,12
int 10h
mov cx, 5 ; counter
mov dl, 65 ; ASCII of 'A'
t1:
mov ah, 2h
int 21h
add dl, 32 ; 97 - 65 - convert to LC
mov ah, 2h
int 21h
sub dl,31 ;remove the 32 added, but increment
push dx ;save DX on stack
mov dl, 32 ;space character
mov ah, 2h
int 21h
pop dx ;return DX from stack
loop t1
mov ah, 4Ch ;exit DOS program
mov al, 00h ;return code = 0
int 21h
ENDP
END main
Was die spezifisch ist Problem, das Sie sehen? Was funktioniert nicht? –
der Ausgang ist: Aa Bb Cc Dd Ee, und ich möchte sein: abcccbcccabcccbccc – user6128930
Versuchen Sie, ein wenig besser zu erklären, welche Art von Algorithmus Sie wollen, weil es viele Möglichkeiten gibt, um Ihr Problem zu lösen. –