Just Jeff Posted June 30, 2016 Share Posted June 30, 2016 Can anyone please clarify the the meaning of this from these DASM instructions? I set aside 9 bytes of RAM ($8c through $94) in a program that I am having trouble with. Is this telling me I could only set aside 1, 2, or 4 bytes?: [label] DS[.BWL] exp[,filler] declare space (default filler is 0). Data is not generated if within an uninitialized segment. Note that the number of bytes generated is exp * entrysize (1,2, or 4) The default size extension is a byte. Note that the default filler is always 0 (has nothing to do with the ORG default filler). I had a second question, actually. I see this alot- what does it mean?: #if Olaf and #endif From what I can tell it is C# code meaning "Do this stuff if defined" But I keep seeing olaf. What the frig is olaf and why is it in a set of instructions so much? Thanks! Quote Link to comment Share on other sites More sharing options...
tschak909 Posted June 30, 2016 Share Posted June 30, 2016 see my reply in Newbies... yes, ds can only be used in byte, word, and double word increments, but the point for that is to label your variables as I show in the other thread. -Thom Quote Link to comment Share on other sites More sharing options...
Just Jeff Posted June 30, 2016 Author Share Posted June 30, 2016 I have: Pills: ds 9 ; used for field prizes $8c through $94 Which I think means I didn't right? I think I can guess what you mean by word and double word. I wonder what the consequences are. It assembles without errors and runs, but is glitchy. I though I made mistake with some indirect addressing, but maybe this is it. Quote Link to comment Share on other sites More sharing options...
Thomas Jentzsch Posted June 30, 2016 Share Posted June 30, 2016 Your instruction allocates 9 bytes, because byte (or .B) is the default extension. DC.W 9 = 18 bytes DC.L 9 = 36 bytes Quote Link to comment Share on other sites More sharing options...
Just Jeff Posted June 30, 2016 Author Share Posted June 30, 2016 Ah.. I get it.. So these all mean the same thing or is there any difference at all? ds 4 ds.w 2 ds.l 1 Quote Link to comment Share on other sites More sharing options...
Thomas Jentzsch Posted June 30, 2016 Share Posted June 30, 2016 When you are just allocating non-initialized RAM, yes. But you can use e.g. ds.w to define 16-bit data in a table. Quote Link to comment Share on other sites More sharing options...
Just Jeff Posted June 30, 2016 Author Share Posted June 30, 2016 Hmm.. Do you have an example of that? Quote Link to comment Share on other sites More sharing options...
Thomas Jentzsch Posted June 30, 2016 Share Posted June 30, 2016 ds.w 2, Init instead of .word Init, Init 1 Quote Link to comment Share on other sites More sharing options...
+SpiceWare Posted June 30, 2016 Share Posted June 30, 2016 I had a second question, actually. I see this alot- what does it mean?: #if Olaf and #endif From what I can tell it is C# code meaning "Do this stuff if defined" But I keep seeing olaf. What the frig is olaf and why is it in a set of instructions so much? I see this in dasm.txt: Copyright © 1995 by Olaf "Rhialto" Seibert. ... PREFACE FROM PETER (APRIL/2008) Everything Andrew says above is still true, there have been a few sporadic updates to the documentation but no major ones, not even Olaf Seibert's changes from 1995 have been integrated, to say nothing of Thomas Mathys' F8 backend from 2004. We are urgently looking for volunteers to help with the documentation! So my guess is the #if Olaf / #endif denote parts of the help file that are only valid if the relevant changes by Olaf Seibert's are in your build of dasm. <checking source> Yep - I see this in asm.h: #if !defined(Olaf) || Olaf #define Olaf 1 /* Olaf Seibert's (KosmoSoft) Improvements */ #define OlafM 1 /* -M option */ #define OlafColon 1 /* Allow label:mne */ #define OlafDol 1 /* Allow 0$ labels */ #define OlafStar 1 /* Allow * for . */ #define OlafByte 1 /* Allow BYTE,etc for DC.B,etc */ #define OlafAsgn 1 /* Allow = for EQU */ #define OlafDotop 1 /* Allow .OP for OP */ #define OlafFreeFormat 0 /* Decide on looks of word if it is opcode */ #define OlafHashFormat 1 /* Decide on # and ^ if it is an opcode */ #define OlafIncbin 1 /* INCBIN operation */ #define OlafIncdir 1 /* INCDIR operation */ #define OlafPhase 1 /* silence phase errors sometimes */ #define OlafList 1 /* LIST ON/OFF */ #define OlafListAll 1 /* Option to list all passes, not just last */ #define OlafPasses 1 /* Option to specify max #passes */ #define OlafEnd 1 /* Implement END */ #define OlafDotAssign 1 /* Allow ". EQU expr" to change origin */ #endif And in the source I see things like this: #if OlafByte /* for byte, .byte, word, .word, long, .long */ if (mne->name[0] != 'd') { static char tmp[4]; strcpy(tmp, "x.x"); tmp[2] = mne->name[0]; findext(tmp); } #endif I know .byte works as I use it all the time, so OlafByte was defined when dasm was built. 1 Quote Link to comment Share on other sites More sharing options...
Just Jeff Posted July 1, 2016 Author Share Posted July 1, 2016 Thanks Darrell, I don't see that in my txt document though it does say copyright 1988. So Olaf isn't C# code then! You tried to get me to read dasm.txt about 6 months ago but I abandoned it a third of the way through because it was making little sense to me. I finally made it through this time and did get something out of it now that I recognize some of it from what I've seen in .asm files. Still a lot of it is over my head but what else is new Thanks again! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.