求答案 試編寫組合語言程式,要求對鍵盤輸入的小寫字母用大寫字母顯示出來

時間 2021-07-01 01:18:23

1樓:中原小壞蛋

;按回車結束程式

codes segment

assume cs:codes

start:

a: mov ah,01h

int 21h

cmp al,0dh

jz exit

sub al,32

mov dl,al

mov ah,02

int 21h

jmp a

exit: mov ah,4ch

int 21h

codes ends

end start

2樓:

name turn

dseg segment

a db 'please input (a~z):','$'

b db 0ah,0dh,'$'

dseg ends

sseg segment stack

db 90h dup(?)

sseg ends

cseg segment

assume cs:cseg,ds:dseg,ss:ssegstart:

mov ax,dseg

mov ds,ax

mov dx,offset a///提示輸入mov ah,09h

int 21h

mov ah,01h

int 21h

mov bl,al

sub bl,20h///轉換

mov dx,offset b

mov ah,09h

int 21h

mov dl,bl

mov ah,02

int 21h//輸出

mov ah,4ch

int 21h/////結束

cseg ends

end start

用c語言編寫一個程式,從鍵盤上輸入一個小寫字母,將其本身及對應的大寫字母輸出.

3樓:黑馬程式設計師

#include

int main()

編寫一個彙編程式,要求將用鍵盤輸入的小寫字母轉換成大寫字母並顯示出來

4樓:匿名使用者

額。樓上的已經寫的很好了。他是字串的。我寫個單個字元的轉換吧。

code segment

assume cs:code

start:

mov ah,1

int 21h

sub al,32

mov dl,al

mov ah,2

int 21h

mov ah,4ch

int 21h

code ends

end start

5樓:匿名使用者

assume cs:code, ds:datasdatas segment

str db 100 dup(?)

datas ends

code segment

start:

mov ax, datas ;初始化段mov ds, ax

lea si, str ;載入str儲存位置mov ah, 1 ;1號功能呼叫輸入字元next:

int 21h

cmp al, 13 ;回車結束輸入jz done

cmp al, 'a' ;對字元範圍'a'~'z'進行轉換jl noop

cmp al, 'z'

jg noop

sub al, 20h ;轉為對應大寫形式noop:

mov [si], al ;儲存

inc si ;更新位置

jmp next

done:

mov ah, 2 ;以下5句輸出一個換行mov dl, 13

int 21h

mov dl, 10

int 21h

mov byte ptr [si], '$' ; 設定結束標誌mov ah, 9 ;9號功能輸出ds:dx的字串lea dx, str

int 21h

mov ax, 4c00h ;程式結束int 21h

code ends

end start附圖:

試編寫組合語言程式,要求從鍵盤接收四位的16進製制數,並在終端上顯示與它等值的二進位制數

鷹的飛翔 試編寫一段程式,要求對鍵盤輸入的小寫字母用大寫字母顯示出來。編寫程式,從鍵盤接收乙個小寫字母,然後找出它的前導字元和後續字元,再按順序顯示這三個字元。編寫程式,從鍵盤接收乙個小寫字母,然後找出它的前導字元和後續字元,再按順序顯示這三個字元。從鍵盤上輸入一串字元,將其中的小寫英文本母變換為大...

用組合語言編寫程式,用組合語言編寫乙個程式

print macro para 定義乙個巨集,這樣輸出字串的時候,可以省些事兒 lea dx,para mov ah,9 int 21h endm data segment msg1 db 請用拼音輸入姓名學號 格式為 xinming,xuhao buffer db 50,52 dup 0 為什麼...

組合語言程式設計問題編寫組合語言程式。能每隔10秒顯示數字分別為

org 0000h 數碼管共陰 ajmp main org 000bh t0ms equ not 50000 100 ms 晶振 6.000 mhz pjsbz equ 20h pjsbzy equ 21h pst0 mov tl0,low t0ms t0 中斷 mov th0,high t0ms ...