China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-07-31 22:59
中国DOS联盟论坛 » DOS开发编程 & 发展交流 (开发室) » Question About Using an Assembly Language Compiler View 2,199 Replies 6
Original Poster Posted 2010-04-05 20:51 ·  中国 陕西 西安 电信
初级用户
Credits 88
Posts 32
Joined 2010-03-27 14:30
16-year member
UID 163163
Gender Male
Status Offline
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
Floor 2 Posted 2010-04-06 09:31 ·  中国 黑龙江 哈尔滨 联通
高级用户
★★
苏醒的沉睡者
Credits 659
Posts 217
Joined 2003-02-15 00:00
23-year member
UID 930
Gender Male
From 福建
Status Offline
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!
好久没碰Dos,手都生了,赶紧回来练练.嘿嘿
Floor 3 Posted 2010-04-06 20:28 ·  中国 陕西 西安 电信
初级用户
Credits 88
Posts 32
Joined 2010-03-27 14:30
16-year member
UID 163163
Gender Male
Status Offline
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 ]
Floor 4 Posted 2010-04-07 12:32 ·  中国 黑龙江 哈尔滨 联通
高级用户
★★
苏醒的沉睡者
Credits 659
Posts 217
Joined 2003-02-15 00:00
23-year member
UID 930
Gender Male
From 福建
Status Offline
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.
好久没碰Dos,手都生了,赶紧回来练练.嘿嘿
Floor 5 Posted 2010-04-07 20:53 ·  中国 陕西 西安 电信
初级用户
Credits 88
Posts 32
Joined 2010-03-27 14:30
16-year member
UID 163163
Gender Male
Status Offline
Thanks very much, I'll pay more attention in the future.
Floor 6 Posted 2010-04-08 09:15 ·  中国 江苏 苏州 电信
银牌会员
★★★
Credits 2,227
Posts 790
Joined 2005-01-27 00:00
21-year member
UID 35703
Gender Male
Status Offline
Change line 15 from “cmp [si],0” to “cmp byte ptr [si],0”.
This error only shows up with masm5. MASM6 won't.
my major is english----my love is dos----my teacher is the buddha----my friends--how about U
Floor 7 Posted 2010-04-08 12:14 ·  中国 黑龙江 哈尔滨 教育网
高级用户
★★
苏醒的沉睡者
Credits 659
Posts 217
Joined 2003-02-15 00:00
23-year member
UID 930
Gender Male
From 福建
Status Offline
As expected, big brother Benshi is amazing...!
好久没碰Dos,手都生了,赶紧回来练练.嘿嘿
Forum Jump: