datas segment
;此處輸入資料段**
buf db 'piease input a number:$'
datas ends
stacks segment
;此處輸入堆疊段**
stacks ends
codes segment
assume cs:codes,ds:datas,ss:stacks
start:
mov ax,datas
mov ds,ax
;此處輸入**據段**
jmp str
err1:call err
str:mov ah,01h
int 21h
cmp al,0dh
je exit
cmp al,20h
je exit
cmp al,31h
jb err1
cmp al,39h
ja err1
xor cx,cx
and al,0fh
mov cl,al
loop1:call dely
call ring
loop loop1
exit:mov ah,4ch
int 21h
clr:push ax
push bx
push dx
mov ah,2
mov bh,0
mov dh,0
mov dl,0
int 10h
pop dx
pop bx
pop ax
reterr:call clr
push ax ;錯誤顯示
push dx
lea dx,buf
mov ah,09h
int 21h
pop dx
pop ax
retring:push ax ;響鈴一次
push dx
mov ah,02h
mov dl,07h
int 21h
pop dx
pop ax
retdely:push ax ;延時程式
push bx
push cx
push dx
mov ah,2ch
int 21h
mov bl,dh
inc bl
dely1: mov ah,2ch
int 21h
cmp bl,dh
jnz dely1
pop dx
pop cx
pop bx
pop ax
retcodes ends
end start
彙編一日一學 9 響鈴N次
試編寫一程式,要求能從鍵盤接收乙個個位數n,然後響鈴n次 響鈴的ascii碼為07 stacks segment dw128dup 0 stacks ends codes segment start input mov ah,1 輸入字元 int 21h cmp al,0 jle input cmp...
鍵盤控制移動
pathgo 導航模組的預設固定 ip 是 192.168.31.200 預設使用者名為eaibot 預設密碼為 eaibot 開啟乙個終端,執行以下命令,啟動底盤驅動 帶平滑加減速 ssh eaibot 192.168.31.200 roslaunch dashgo driver demo.lau...
OpenGL 鍵盤控制
glut允許我們編寫程式,在裡面加入鍵盤輸入控制,包括了普通鍵,和其他特殊鍵 如f1,up 在這一章裡我們將學習如何去檢測哪個鍵被按下,可以從glut裡得到些什麼資訊,和如何處理鍵盤輸入。處理按鍵訊息,我們必須使用glut通知視窗系統,當某個鍵被按下時,哪個函式將完成所要求的操作。我們同樣是呼叫乙個...