[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Prodos MLI difficulties



In article <88767@cup.portal.com>,
Scott - Maxwell <ScottM@cup.portal.com> wrote:
>>Here is an example of what you might try:
>>
>>        dfb     $C0             ;   CREATE FILE
>>        da      creParm         ;   CREATE FILE PARAMETERS
>>        asc     '/THIS/IS/A/PAIN'
>>
>I have a question. I'm guessing that asc defines an ascii string. What do
>dfb and da do?

dfb = DeFine a constant Byte (dc.b for many assemblers)
da = Define constant Adress (word) (dc.w for many assemblers)

Btw, I don't know the context of the cited code, but if it was a MLI call
(jsr $0xbf00 immediately before the first line), it certainly won't work.
The general MLI calling mechanism is:

	jsr $bf00
	dfb MLI_Opcode
	da  Address_of_Parameter_Block
	... ; MLI returns here

The MLI returns to immediately behind the "da" line.
It returns an error code in A (0 == no error), and additionally sets the
carry flag on error. A typical code sequence would be:

	jsr $bf00
	dfb MLI_Opcode
	da  Parameter_Block
	bcs Error
	... ;no error


; NOTE: the following should be in the data section of your program because
; the MLI returns information in some fields of the parameter block for
; many commands, so it must be in RAM.

Parameter_Block:
	dfb Argument_Count
	dfb/da Argument_1
	dfb/da Argument_2
	...

I don't know the correct arguments for CREATE($c0 opcode), but there are
quite a few (ie. storage type, file type & aux type, creation date&time,
etc.)


- Wulf