I am beginning to remember why I created HLA :-)

I am beginning to remember why I created HLA :-)

Post by Randall Hy » Tue, 26 Aug 2003 07:33:40


Well, I've been playing around with the macro trying to get it to work.

Lots of little problems are killing me.
First of all, MASM thinks that 1-4 character literal strings are
numeric constants. This means that something like

strconst( "0")

gets translated to

strconst( 48 )

Another problem is that the EQU the macro generated winds up
creating "fixup" errors later on.


So I got real sneaky and tried this:

;------------------------------------------------------------------------
;
; strconst-
;
; Defines a string literal constant in the .CONST section.
; Note that the first argument of this macro is the name
; that MASM will use as the address of the first character
; in the string.
;
; Typical invocation:
;
; helloWorld strconst ("Hello World")

strconst macro i_or_str:vararg
local strChars ; label of string object data
local strLength
local theVar
local isStrConst
local firstChar
local rtnStr

firstChar substr <i_or_str>,1,1
isStrConst = ((100y and (opattr (i_or_str))) eq 0)
% ifidn <firstChar>,<">
isStrConst = true
endif
% ifidn <firstChar>,<'>
isStrConst = true
endif
% ifidn <firstChar>,<!<>
isStrConst = true
endif

CONST segment dword readonly public 'CONST'
align 4
dword strLength ; maximum length of string

if isStrConst

; reserved space has been initialized with data

dword strLength ; current length of string
strChars byte i_or_str

else ; i_or_str is string

; space has just been reserved for a string

dword 0 ; current length of string
strChars byte i_or_str dup (0)

endif
strLength = $-strChars
byte 0 ; string is null terminating
align 4
CONST ends
EXITM @CatStr(<EQU byte ptr ds:>,strChars)
endm


This macro solved the aforementioned problems, but now
you run into problems whenever a string contains one of
MASM's special characters: < > ! % & etc.

Slowly, but surely, I'm retracing all the steps I went through
back in 1996 when I finally gave up on MASM and said to
myself "I need a better assembler than this..." :-( That, of course,
led to the development of HLA.

Well, I'm about burned out again. Guess for the MASM header
file I'm creating for calling HLA stdlib routines I'll have to live with
ugly syntax unless someone has another breakthrough.
cheers,
Randy Hyde
 
 
 

1. My I's are coming up i's. (lower case)

2. Some old non-working Model I's and a Hard Disk III

A friend of mine - who doesn't use newgroups and doesn't want the
hassle of maybe moving this stuff on e-bay asked me to put
this up here - the place I suggested to him.

Non-working, but for someone in Central Florida who maybe a
tinkerer and/or need spare parts you might call Tom. He doesn't
want to just put them in the trash if someone can use them.

-------------------------

Have three TRS-80s; two Model I's, and a Model 4. Have been poorly
stored envirnonmentally since 2001. They power up, but don't work.
Would like to give them to someone who feels they might be able to
salvage for parts. Both Model I units have Gold-Plug-80s soldered to
each end of the path between CPU and E/I. Am in Orlando, FL area.
Cannot ship; you must pick up, and soon. Contact me directly (I'm not
in a newsgroup), Tom Cook, email XXXX@XXXXX.COM . Phone (407)
671-1224.

Seperately...

Have a "Hard Disk III" unit that I haven't powered up since about '96.
Has two 15MB full-height 5" drives (I forget which mfg.) 7 1/2MB of
each drive was formatted under LDOS, and the 7 1/2 under Montezuma
Micro's CP/M. FREE to good home in Orlando area (you pick it up), IF
you have a working Model 4 that I can temporarily hook up to backup my
data to my floppy disks. Then you can have the Hard Disk III. Also
have the Model I breakout box for it. Contact me directly (I'm not in a
newsgroup), Tom Cook, email XXXX@XXXXX.COM . Phone (407) 671-1224.

-------------------------

Bill
--
Bill Vermillion - bv @ wjv . com

3. Fonts not clear, i's and L's are red in color

4. I's callin out john lewis, walter mitty, tim o and more.

5. Graffiti 2 - Capital k's, t's and i's

6. unicode and i's

7. SQL DB Schema Diagram (i's)

8. i's

9. TRS-80 Model II Emulator? / 200,000 Model I's?

10. Please can Word spell liaise, liaison etc with 2 i's!

11. What to do when -I's are too long

12. I's confused..and have a font/message issue

13. Dotting the I's and crossing the T's

14. Outlook 2000 Service Release I's Foolish Security Enhancements

15. Capital I's are a pain, how do I get rid of them