[Info-vax] Calling standards, was: Re: Byte range locking - was Re: Oracle
VAXman- at SendSpamHere.ORG
VAXman- at SendSpamHere.ORG
Thu Nov 24 08:06:08 EST 2016
In article <o15cvh$4oj$1 at dont-email.me>, "Craig A. Berry" <craigberry at nospam.mac.com> writes:
>On 11/23/16 12:59 PM, Bob Koehler wrote:
>> In article <e9m017F7ab9U1 at mid.individual.net>, Bill Gunshannon <bill.gunshannon at gmail.com> writes:
>>>
>>> As I said, I don't have a manual handy. I am aware that the VAX
>>> had descriptors, but I would be extremely surprised if the .ASCIZ
>>> and .PRINT weren't still there again, primarily for backwards
>>> compatibility.
>>
>> VAX macro has an .ASCIZ directive. Never had any use for it, even
>> after we started doing C. Can't seem to find a .PRINT directive, but
>> I haven't done an exhaustive search.
>
>30 seconds with a search engine reveals that .PRINT, .WARNING, and
>..ERROR in VAX MACRO are assembly-time directives that print the comment,
>i.e., everything after the semicolon. As far as I can see, the strings
>are always constants of known length and the only thing that could crash
>is assembling your program, not running it. I've never really been a
>MACRO person but I think I've usually seen people use LIB$PUT_OUTPUT for
>printing, and of course that is a descriptor-based interface.
$DSCDEF
.PSECT DATA,WRT,NOEXE,5
ZTSTR: .ASCIZ "This string ends with a null."
.ALIGN QUAD
AZFMT: .ASCID "!AZ"
.PSECT CODE,NOWRT,EXE,5
.ENTRY HOW_TO,0
CLRL -(SP) ;\
PUSHL #<DSC$K_CLASS_D@<DSC$B_CLASS at 3>>!- ;- dynamic descriptor on stack
<DSC$K_DTYPE_T@<DSC$B_DTYPE at 3>> ;/
PUSHAL ZTSTR
PUSHAL 4(SP) ; dynamic descriptor
PUSHL #0
PUSHAL AZFMT
CALLS #4,G^LIB$SYS_FAO ; format .ASCIZ string
PUSHAL (SP) ; dynmaic descriptor
CALLS #1,G^LIB$PUT_OUTPUT ; let's see it.
PUSHAL (SP) ; dynamic descriptor
CALLS #1,G^STR$FREE1_DX ; free it
ADDL2 #8,SP ; clear from stack
RET
.END HOW_TO
Note, I would have used LIB$ROUTINESDEF but its $LIB_SYS_FAO_S macro has been
hopelessly broken for EONS!!!
>I don't recall whether there are any native interfaces that use .ASCIZ
>but there are certainly MACRO programs that use it. And when coding in
>assembler, surely null-terminated strings are the least of your worries
>as far as accessing memory that doesn't belong to you. Which makes all
>the dumping on C kind of silly considering a third of VMS is written in
>a far more dangerous language. Dunno about BLISS. Maybe it's two thirds.
What's more *dangerous*?
--
VAXman- A Bored Certified VMS Kernel Mode Hacker VAXman(at)TMESIS(dot)ORG
I speak to machines with the voice of humanity.
More information about the Info-vax
mailing list