assembly - TASM 代码在 YASM 中给出错误:标签后预期的指令
问题描述
我有我为 TASM 编写的代码,据我所知 YASM 与该代码兼容,所以 IDK 为什么会出现这些错误:
91.asm:3: error: instruction expected after label 91.asm:4: error: instruction expected after label 91.asm:27: error: instruction expected after label
对于此代码:
IDEAL
MODEL small
STACK 21h
DATASEG
; --------------------------
; Your variables here
; --------------------------
CODESEG
global start
start:
; --------------------------
; Your code here
; --------------------------
mov cx, 21
mov ax, 1000h
cmp cx, 0
je myExit
addStack:
push ax
inc ax
loop addStack
myExit:
exit:
mov ax, 4C00h
int 21h
END start
解决方案
据我所知, YASM与 TASM不兼容。它与使用完全不同指令的N ASM兼容。(和不同的含义mov reg, label
- 在 NASM/YASM 中,它是地址的 mov-immediate,与 TASM/MASM 不同,它是负载。)
一行上没有 a 的东西:
可以是标签(如果它不被识别为指令助记符,这是 YASM 所假设的)。
但是,如果它后面跟着其他也不被理解为指令的东西(如small
in MODEL small
),那就是语法错误。
对 YASM 使用 NASM / YASM 语法。
推荐阅读
- machine-learning - 无法克隆对象 keras.wrappers
- python - python数据帧时间序列划分成更小的时间窗口循环
- javascript - 在材质ui选择中添加文本框
- python - Pytorch 在 Conv2D 中的默认填充是什么意思?
- javascript - 如何使用 mapbox-gl-directions 设置起点和终点?
- java - 在哪里设置 BluetoothGatt 连接优先级
- mysql - 获取自定义 MYSQL 查询结果
- jquery - 如何使用 jquery ajax 删除 html 选择文件选项
- github - 为什么 Dependabot 尝试向 JCenter 进行身份验证?
- typescript - 当我导入 ts 后缀文件时,Webpack HMR 不起作用;