标题:大家帮忙看一下 这段代码是C 还是汇编
取消只看楼主
caidian2005
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2011-9-4
 问题点数:0 回复次数:1 
大家帮忙看一下 这段代码是C 还是汇编
data segment      
string db 'ASCII SCAN CHAR',0dh,0ah,'$'
ending db 'Press any key to continue',0dh,0ah,'$'
temp db ?
data ends
stack segment
db 512 dup(?)
stack ends

code segment

start:
;---------input a num(Tips)
mov ah,09h
mov dx,offset string
int 21h
;---------input a num(getcode)
getkey:

mov ah,00h
int 16h

mov dl,al
mov dh,ah
;---------Backup
push dx
push dx
push dx
push dx
push dx
;---------Al,ASCII
;------------high4bits
mov cl,04h
shr dl,cl
cmp dl,09h
ja outa1
add dl,30h
mov ah,02h
int 21h

jmp next1

outa1:
add dl,37h
mov ah,02h
int 21h

next1:
;------------low4bits
pop dx
and dl,0fh
cmp dl,09h
ja outa2
add dl,30h
mov ah,02h
int 21h
jmp next2

outa2:
add dl,37h
mov ah,02h
int 21h

next2:
;------------Out space
mov ah,02h
mov dl,20h
int 21h
;------------AH,Scan Code
;------------high4bits
pop dx
mov cl,04h
shr dh,cl
cmp dh,09h
ja outa1
add dh,30h
mov ah,02h
mov dl,dh
int 21h

jmp next3

outa3:
add dh,37h
mov ah,02h
mov dl,dh
int 21h
;------------low4bits
next3:
pop dx
and dh,0fh
cmp dh,09h
ja outa4
add dh,30h
mov ah,02h
mov dl,dh
int 21h

jmp next4

outa4:
add dh,37h
mov ah,02h
mov dl,dh
int 21h


next4:

;------------Out space
mov ah,02h
mov dl,20h
int 21h
;-----------Out char
pop dx
mov ah,02h
int 21h
;------------newline
mov ah,02h
mov dl,0dh
int 21h
  
mov ah,02h
mov dl,0ah
int 21h
;------------check ends
pop dx
cmp dl,03H
je happyed
jne getkey

happyed:
mov ah,02h
mov dl,0dh
int 21h
  
mov ah,02h
mov dl,0ah
int 21h

mov ah,09h
mov dx,offset ending
int 21h

code ends
搜索更多相关主题的帖子: continue 
2011-09-04 12:14
caidian2005
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2011-9-4
得分:0 
我也知道   但是问了好多学汇编的人 他们都不会啊
2011-09-04 12:52



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-349123-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 1.392426 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved