題目是:輸入乙個字串,統計輸入的字串中字母、數字以及其他字元各有多少個。
invalid keyboard code specified
link : warning l4021: no stack segment
link : warning l2029: unresolved externals:
readhex in file(s):
d:/example/work412.obj(d:/example/work412.asm)
readint in file(s):
d:/example/work412.obj(d:/example/work412.asm)
crlf in file(s):
d:/example/work412.obj(d:/example/work412.asm)
writedec in file(s):
d:/example/work412.obj(d:/example/work412.asm)
writecr in file(s):
d:/example/work412.obj(d:/example/work412.asm)
readdec in file(s):
d:/example/work412.obj(d:/example/work412.asm)
writehex in file(s):
d:/example/work412.obj(d:/example/work412.asm)
writeint in file(s):
d:/example/work412.obj(d:/example/work412.asm)
there were 8 errors detected
我的原始檔是:
include ylib.h
data segment
buffer db 101,?,101 dup(?)
mess db 0ah,0dh,"input a string please:$"
outmsg1 db 0ah,0dh,"char:$"
outmsg2 db 0ah,0dh,"number:$"
outmsg3 db 0ah,0dh,"others:$"
char db ?
num db ?
other db ?
data ends
code segment
assume cs:code,ds:data
start: mov ax,data
mov ds,ax
lea dx,mess
mov ah,09h
int 21h ;輸入提示資訊
mov ah,0ah
lea dx,buffer
int 21h ;輸入字串
call crlf
mov cl,buffer+1
mov ch,0
lea bx,buffer+1
mov char,0
mov byte ptr num,0
one: cmp cx,0
je over
inc bx
dec cx
cmp byte ptr[bx],30h
jb one
je two
cmp byte ptr[bx],39h
jc there
two: inc num
jmp one
there: cmp byte ptr[bx],41h
jb one
je four
cmp byte ptr[bx],5ah
jc five
four: inc char
jmp one
five: cmp byte ptr[bx],61h
jb one
je six
cmp byte ptr[bx],7ah
jc one
six: inc char
jmp one
over: mov al,other
mov al,buffer+1
sub al,char
sub al,num
mov other,al
mov al,char
mov ah,0
lea dx,outmsg1
call writeint
mov al,num
lea dx,outmsg2
call writeint
mov al,other
lea dx,outmsg3
call writeint
mov ax,4c00h
int 21h
code ends
end start
請路過的高手指點一二。
我的第乙個匯程式設計序 Hello,World
作為乙個程式設計師,我想起碼要精通3們語言 c,c 彙編!今天我開始了我的奇妙的彙編世界。我用的是gnu assembler gas 現用vim建立乙個hello.s檔案 root localhost vim hello.s 回車後,編寫彙編 如下 1 data 2 msg string hello...
第乙個匯程式設計序hello world
程式原始碼如下 assume cs code,ds data 定義 段和資料段框架 data segment 資料段 msg db hello world 定義字串 data ends code segment 段 start mov ax,data mov ds,ax 資料段初始化 mov bx,...
01 第乙個匯程式設計序
在閱讀 x86組合語言 從實模式到保護模式 這本書的時候,從b站上看到 教程,使用虛擬機器然後將彙編檔案寫入磁碟0面0扇區,然後啟動,在螢幕輸出字元,這個程式本身就很簡單,之前學習過王爽的彙編,知道視訊記憶體位置08b00h,字低8位是ascii編碼,高8位是字元的顏色 但是在看 的 發現不同之處 ...