🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.msdos.programmer
Article #5082

Re: TASM can't subtract ...

#5082
From: Naoto Kimura (ACM)
Date: Fri, 08 Mar 1991 12:32
50 lines
1844 bytes
In article <1991Mar1.014835.7651@athena.mit.edu> mmshah@athena.mit.edu (Milan M Shah) writes:
]Hi!
]
]I am trying to assemble Fontedit.asm, a program published in PC-Magazine
]vol 7 no. 15 using Turbo Assembler 1.0 (Yup, its 1.0 alright). In the program,
]there's a couple of lines that go:
]
]LOADER 	LABEL	BYTE
]LOADER_OFFSET	EQU	100H - LOADER
			  ^      ^
			  |      `--- An address
			  `---------- A constant

    I think your problem is that you're confusing the assembler with trying to
    subtract an address from a constant.

] .... (text deleted) ...
]
]Thanks for any help!
]
]Milan
].

I would suggest having something like the following:

			ORG	100H	; if you've got a COM file.
	Beginning	LABEL	BYTE
	...
	Loader	LABEL	BYTE
	Loader_offset	EQU	Beginning-Loader
	...

You could alternatively try something like:

	CODE	SEGMENT	BYTE	'CODE'
		; Dang! I can't recall the full syntax for the SEGMENT
		; directive, since mostly use the simplified CODESEG
		; DATASEG, and STACKSEG directives anyway.
	...
	Loader	LABEL	BYTE
	Loader_offset	EQU	CODE:100H-Loader
	...
	ENDS


                //-n-\\			 Naoto Kimura
        _____---=======---_____		 (abcscnuk@csuna.csun.edu)
    ====____\   /.. ..\   /____====
  //         ---\__O__/---         \\	Enterprise... Surrender or we'll
  \_\                             /_/	send back your *&^$% tribbles !!
Technical Details
Message-ID: <1991Mar8.123201.21590@csun.edu>
Path: arc1-ca.pugleaf.net!utzoo!news-server.csri.toronto.edu!cs.utexas.edu!usc!nic.csu.net!csun!csunb.csun.edu!abcscnuk
References: <1991Mar1.014835.7651@athena.mit.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!news-server.csri.toronto.edu!cs.utexas.edu!usc!nic.csu.net!csun!csunb.csun.edu!abcscnuk
From: abcscnuk@csunb.csun.edu (Naoto Kimura (ACM))
Newsgroups: comp.os.msdos.programmer
Subject: Re: TASM can't subtract ...
Message-ID: <1991Mar8.123201.21590@csun.edu>
Date: 8 Mar 91 12:32:01 GMT
References: <1991Mar1.014835.7651@athena.mit.edu>
Sender: news@csun.edu (News Administrator)
Organization: csun
Lines: 50