Введите строку символов, латинские строчные буквы превращаются в заглавные буквы, а остальные символы заменяют только нечетные позиции в двоичном коде и отображают.
ВЫХОД ДОЛЖЕН БЫТЬ 'CБCBD', НО ВЫХОДЭТО ИЗОБРАЖЕНИЕ
КОД ЭТОГО
DOSSEG ;segment sequencing directive
.MODEL SMALL ;directive of the model of code
;and data of the near type
.STACK 200H ;a 512-byte stack
.DATA ;start of the data
STRING DB 'c~cbd$' ;string
STRING_LENGTH EQU $-STRING ;string length=6 in this example
STRING1 DB STRING_LENGTH DUP (?) , '$' ;another string1,has the same
;length
.CODE ;start of the code
MOV AX,@DATA ;access to the data segment
MOV DS,AX ;access to the data segment
XOR SI,SI ;SI set to zero
XOR DI,DI ;DI set to zero
MOV CX,STRING_LENGTH ;put string length into CX,for
;looping 6 times
S: ;breakpoint S
MOV BL,STRING[DI] ;remember current element of
;string into BL
AND STRING[DI],11100000B ;checking if the current element
;of string is lowercase
CMP STRING[DI],01100000B ;checking if the current element
;of string is lowercase
JNE L1 ;if the current element of string
;is lowercase is not equal
; go to the breakpoint L1 otherwise go to inside
XOR BL,00100000B ;remember current element of string into BL
; (lowercase letters) convert to capital letters
MOV STRING1[SI],BL ;put the current capital letter into string1
ADD SI,2 ;increment by 2 (because the size of SI is 2 bytes)
; to go to the next item of string1
ADD DI,2 ;increment by 2 (because the size of DI is 2 bytes)
;to go to the next item of string
LOOP S ;cycle,go to the breakpoint S
L1: ;breakpoint L1
XOR STRING[DI],01010101B ;Switch the current element of string back
;to only non-even places
MOV AL,STRING[DI] ;put the current element into register AL
MOV STRING1[SI],AL ;put the current element into string1
ADD SI,2 ;increment by 2 (because the size of SI is 2 bytes)
; to go to the next item of string1
ADD DI,2 ;increment by 2 (because the size of DI is 2 bytes)
; to go to the next item of string
LOOP S ;cycle,go to the breakpoint S
XOR DX,DX ;DX set to zero
LEA DX,STRING1 ;download executive address
MOV AH,09H ;DOS line output function
INT 21H ;display changed characters
MOV AH,4CH ;DOS function of program termination
INT 21H ;finish the program
END
Я ИСПОЛЬЗУЮ TURBODEBBUGER, ЧТОБЫ УВИДЕТЬ ЧТО ПРОИСХОДИТ, НО НЕ МОЖЕТ НАЙТИ ПРОБЛЕМУ
Я ИЩУ В STACKOVERFOW, GOOGLE, НО НЕ МОГУ НАЙТИ СОВРЕМЕННУЮ ПРОБЛЕМУ.Можете ли вы помочь мне решить эту проблему