中国DOS联盟论坛

China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
Guest | Log in | Register | Members | Search | China DOS Union
中国DOS联盟论坛
The time now is 2026-09-15 00:29
47,812 topics / 349,917 posts / today 0 new / 48,268 members
DOS开发编程 & 发展交流 (开发室) » Question About Using an Assembly Language Compiler
Printable Version  2,296 / 6
Floor1 chrise Posted 2010-04-05 20:51
初级用户 Posts 32 Credits 88
x-9.asm(7): warning A4016: Reserved word used as symbol: CS
ex-9.asm(8): error A2062: Missing or unreachable CS
ex-9.asm(16): error A2062: Missing or unreachable CS
ex-9.asm(18): error A2062: Missing or unreachable CS

50866 + 415518 Bytes symbol space free
ex-9.asm(18): what does error A2062: Missing or unreachable CS mean, especially what does A2062 have to do with the error location
Floor2 070 Posted 2010-04-06 09:31
高级用户 Posts 218 Credits 663 From 福建
What does error A2062: Missing or unreachable CS mean

Roughly it should mean that the CS segment (code segment) is missing or unreachable... Check whether your CS segment is set correctly.

At the very least you should post the source code!
What is the programming environment? Also, what version of MASM is it? If it's a relatively new version, you can consider pseudo-code, then you can skip the segment setup... and it's less error-prone!
Floor3 chrise Posted 2010-04-06 20:28
初级用户 Posts 32 Credits 88
The assignment is to count the number of positive numbers, negative numbers, and 0s.
name ex-10
data segment
buff dw 12,43,54,78,34
plus dw ?
minus dw ?
zero dw ?
count dw $-buff
data ends
code segment
assume cs:code ds:data
start:mov ax,data
mov ds,ax
mov cx,count
lea si,buff
begain:cmp ,0
je zero0
jg plus0
jl minus0
zero0:inc ah
jmp com
plus0:inc al
jmp com
minus0:inc bh
jmp com
com:inc si
loop begaim
mov ah,4ch
inc 21h
code ends
end start
The error messages are
ishuqi.asm(1): warning A4001: Extra characters on line
jishuqi.asm(10): warning A4001: Extra characters on line
jishuqi.asm(15): error A2035: Operand must have size
jishuqi.asm(26): error A2009: Symbol not defined: BEGAIM
jishuqi.asm(28): error A2056: Immediate mode illegal

50818 + 415566 Bytes symbol space free

2 Warning Errors
3 Severe Errors
Could one of the experts help analyze what these errors mean? Many thanks


[ Last edited by chrise on 2010-4-6 at 20:30 ]
Floor4 070 Posted 2010-04-07 12:32
高级用户 Posts 218 Credits 663 From 福建
On the first line, it should be "_", not the minus sign "-".
On line 10, it should be assume cs:code,ds:data — you missed a comma.
On line 15, I really don't know why either.
On line 26, it should be begain — you mistyped a letter.
On line 28, it should be int, not inc.

There are too many input errors... just be more careful when writing code.
Floor5 chrise Posted 2010-04-07 20:53
初级用户 Posts 32 Credits 88
Thanks very much, I'll pay more attention in the future.
Floor6 本是 Posted 2010-04-08 09:15
银牌会员 Posts 790 Credits 2,227
Change line 15 from “cmp [si],0” to “cmp byte ptr [si],0”.
This error only shows up with masm5. MASM6 won't.
Floor7 070 Posted 2010-04-08 12:14
高级用户 Posts 218 Credits 663 From 福建
As expected, big brother Benshi is amazing...!
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023