assembly - 使用 dosbox 调试程序集 x-86
问题描述
因为我仍然不知道通过 ide 编写和编译汇编 x-86 链表程序的方法(据我所知,emu8086 不支持链表结构)我在记事本中编写并使用 dosbox 编译代码编译没有错误和当我通过g4e运行时(mov ah,4ch的地址,我输入了一个数字,程序就卡住了
这是我的代码
node struc
value db ?
next dw ?
node ends
dseg segment
list node <'1',3h>
ORG 3h
node <'3',6h>
ORG 6h
node <'7',9h>
ORG 9h
node <'9',-1>
searchInt db 0
counter1 db 0
welcome db 'Please enter a number between 1-10$'
dseg ends
sseg segment stack
db 10h dup (?)
sseg ends
cseg segment
assume cs:cseg,ds:dseg,ss:sseg
start:
mov ax,dseg
mov ds,ax
lea si,list
mov dx,offset welcome
call print
userInput:
xor ax,ax
mov ah, 1
int 21h
cmp al,30h
jb userInput
cmp al,39h
ja userInput
jmp searching
searching:
lea si,list
cmp [si].value,al
je counter
cmp [si].value,-1
je sof
mov si,[si].next
jmp searching
counter:
inc counter1
cmp [si].value,-1
je sof
jmp searching
print proc ;procedure for printing messages
mov ah,9h
int 21h
MOV dl, 10
MOV ah, 02h
INT 21h
MOV dl, 13
MOV ah, 02h
int 21h ;start a new line
ret
print endp
sof:
mov ah,4ch
int 21h
cseg ends
end start
有人能指出我的问题在哪里吗?
解决方案
推荐阅读
- javascript - 未捕获(承诺)DOMException:无法启动视频源,未捕获错误:您提供的错误不包含堆栈跟踪
- css - 这些 css 片段中哪一个性能更高,为什么?
- micronaut - Micronaut 数据分页全文搜索查询
- python - 如何在python中调整直方图的字体大小
- cmake - 使用 ifort 的 CMake 项目失败。“无法编译简单的测试程序。”
- plugins - How to install chaos physics
- ios - 我可以从现有应用程序创建新的 iOS 应用程序吗?
- c++ - 为什么我们可以在编译时使用派生类指针本身来操作派生类成员?
- assembly - gdb 中 pc 的含义(别名?)
- c++ - 如何通过向量处理元组?