cj7hawk
Veteran Member
16 is a quite few ! Its cumbersome code, and uses a bit of space, but it's not too much... I suppose around 200 bytes or so to implement the extra support with the data structures I use, which isn't too much if that many is useful.
I never thought of using Macro's to generate DPBs, but it makes sense, since you can use more common parameters to build a DPB from base data, and know it's going to be correct.
Out of interest do you have a Macro from any version assembler that assembles a DPB ? I'd love to see how it looks.
Though I should mention that there's no limit to how many labels can pass into a macro, so if you did something like;
SET CYLINDERS,100
SET HEADS,4
SET SPT,32
SET DIRECTORY_ENTRIES,256
SET RESERVED_TRACKS,2
DPB ; Call DPB macro to generate DPB.
Then there's no need to put them all on the same line... The macro will still pick the parameters up on other lines, which avoids crowding, and removes any limits...
I just mean how many parameters should be passed directly to the Macro as unnamed arguments that follow the line eg,
DPB 100,4,32,256,2
Would do the same as the above, except instead of meaningful label names, the DPB parameters are just ARG1, ARG2, ARG3 etc.
My main thinking was that passing some arguments would allow creation of new "commands" like OUT (C),A as a 16 bit version to make the intent clear - eg
MACRO OUT16
LD BC,ARG1
LD A,ARG2
OUT (C),A
MEND
Would let you do stuff like
OUT16 $03F8,$32
So I was thinking to have parameters for readability, not just functionality.
Would you still think 16 arguments in the command line is needed, or would the first example cover it better?
Thanks
David
I never thought of using Macro's to generate DPBs, but it makes sense, since you can use more common parameters to build a DPB from base data, and know it's going to be correct.
Out of interest do you have a Macro from any version assembler that assembles a DPB ? I'd love to see how it looks.
Though I should mention that there's no limit to how many labels can pass into a macro, so if you did something like;
SET CYLINDERS,100
SET HEADS,4
SET SPT,32
SET DIRECTORY_ENTRIES,256
SET RESERVED_TRACKS,2
DPB ; Call DPB macro to generate DPB.
Then there's no need to put them all on the same line... The macro will still pick the parameters up on other lines, which avoids crowding, and removes any limits...
I just mean how many parameters should be passed directly to the Macro as unnamed arguments that follow the line eg,
DPB 100,4,32,256,2
Would do the same as the above, except instead of meaningful label names, the DPB parameters are just ARG1, ARG2, ARG3 etc.
My main thinking was that passing some arguments would allow creation of new "commands" like OUT (C),A as a 16 bit version to make the intent clear - eg
MACRO OUT16
LD BC,ARG1
LD A,ARG2
OUT (C),A
MEND
Would let you do stuff like
OUT16 $03F8,$32
So I was thinking to have parameters for readability, not just functionality.
Would you still think 16 arguments in the command line is needed, or would the first example cover it better?
Thanks
David
Last edited: