gpt4 book ai didi

assembly - 如何修复宏中的 "Expecting pointer type"和 "symbol already different kind"

转载 作者:行者123 更新时间:2023-12-02 02:47:13 25 4
gpt4 key购买 nike

我不确定我做错了什么。

我试过在宏中添加前缀@@以及在宏中声明本地@@label,但没有用。

我也查看了这个网站 link以及之前的问题中提到的......它没有用。

.286
.model small
.stack 100h

writeString macro string, length, x, y, color
mov ah, 13h
mov al, 0
mov bh, 0
mov bl, color
lea bp, string
mov cx, length
mov dl, x
mov dh, y
int 10h
endm

draw_box_outline macro x_fin,y_fin,x_ini,y_ini

local col_draw,row_draw,row_rev,col_rev

mov cx,x_ini
mov dx,y_ini
mov ah,0ch
mov al,1111b
int 10h

col_draw:
inc cx
int 10h
cmp cx,x_fin
jb col_draw

row_draw:
inc dx
int 10h
cmp dx,y_fin
jb row_draw

row_rev:
dec cx
int 10h
cmp cx,x_ini
ja row_rev

col_rev:
dec dx
int 10h
cmp dx,y_ini
ja col_rev
endm

.data
msg db "Select Number of Player/s$"
msg1 db "1$"

;box parameters
b1_col_ini equ 50
b1_row_ini equ 110
b1_col_fin equ 90
b1_row_fin equ 150

b2_col_ini equ 130
b2_row_ini equ 110
b2_col_fin equ 170
b2_row_fin equ 150

b3_col_ini equ 210
b3_row_ini equ 110
b3_col_fin equ 250
b3_row_fin equ 150

.code
org 100h
main proc far
mov ax,@data
mov ds,ax
mov es,ax

mov ah,0h
mov al,13h
mov bh,0
int 10h

writeString msg,25,7,10,1111b

draw_box_outline b1_col_fin,b1_row_fin,b1_col_ini,b1_row_ini
draw_box_outline b2_col_fin,b2_row_fin,b2_col_ini,b2_row_ini
draw_box_outline b3_col_fin,b3_row_fin,b3_col_ini,b3_row_ini

writeString msg,25,7,10,1111b
;implement cursor press and detection
;implement cursor hide

mov ax,4c00h
int 21h
main endp
end main

在 DOSBox 中,我一直收到错误“预期的指针类型”和“符号已经不同种类”,但在 emu8086 中,没有任何问题。

最佳答案

LOCAL 指令必须位于宏的最开头。宏声明和 LOCAL 行之间的空行已经太多了。它应该看起来像这样:

draw_box_outline macro x_fin,y_fin,x_ini,y_ini
local col_draw,row_draw,row_rev,col_rev

另外,请看这里:TASM; LOCAL and LOCALS directives .

关于assembly - 如何修复宏中的 "Expecting pointer type"和 "symbol already different kind",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53947537/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com