tschak909 Posted May 1, 2020 Share Posted May 1, 2020 Does anyone remember how to page align a symbol to the next page in AMAC? I need to set aside a buffer space and then set MEMLO right after it. -Thom Quote Link to comment Share on other sites More sharing options...
tschak909 Posted May 1, 2020 Author Share Posted May 1, 2020 For anyone who runs into this, I wound up doing: Basically subtracting the LOW byte of END from $FF, and using that as the operand for the PADD DS, which pads out the req'd # of bits. -Thom Quote Link to comment Share on other sites More sharing options...
Rybags Posted May 1, 2020 Share Posted May 1, 2020 The IBM S/370 Assembler I used to use on mainframes has an ALIGN directive (generally you'd want to align on 2, 4, 8 byte boundaries for convenience of constant storage). With our common Assemblers it'd be like: AsmEd: *=*+$FF&$FF00 Mac-65: .ORG *+$FF&$FF00 (and can also use the AsmEd method) For different alignments just use the relevant add and mask values, e.g. 7 and $FFF8 for 8 byte alignment, $3FF and $FC00 for 1K alignment. 1 Quote Link to comment Share on other sites More sharing options...
tschak909 Posted May 1, 2020 Author Share Posted May 1, 2020 yup: ORG * + $FF & $FF00 works just fine. -Thom Quote Link to comment Share on other sites More sharing options...
+bhall408 Posted October 14, 2020 Share Posted October 14, 2020 I was just messing with that in a game I had where I wanted the customer character set to be on a page boundary and display lists to not cross one. In my old code, I did this: ORG $3000-$3 jmp Init < define the character set here, where it will end up at 0x3000> <define the display lists here, where they will end up at 0x3400> Init: ; this is where the real code starts ... end Init (sets the run address to Init) Quote Link to comment Share on other sites More sharing options...
+bhall408 Posted October 14, 2020 Share Posted October 14, 2020 My today approach is to just start the code off with the character set first, and set the run address via the XEX format. Then if compiling with ca65, don't set the start address there, but set it at the link stage, and just make sure it starts on a page boundary. I have some .ASSERT directives in the source to generate an error in case I forget. You can also use the .ALIGN directive of ca65. Quote Link to comment Share on other sites More sharing options...
+bhall408 Posted October 14, 2020 Share Posted October 14, 2020 Here is the ca65 source fragment for above, with the .ALIGN directive commented out, since I prefer doing it at the link stage... ; ---------------------------------------- ; Character Sets and Display Lists ; ---------------------------------------- ; Chset and DL's don't like to cross page boundarys... ; .ALIGN $100 .ASSERT (* .MOD $100) = 0, error, "Character set not page aligned" ; Include the custom character set .INCLUDE "chset.a65" ; Double check all bytes are there... .ASSERT * = (ChSet1+$400), error, "Character set incorrect size" ; We include the Display List data next, to stay on/prevent crossing a page boundary .INCLUDE "mdldata.a65" Quote Link to comment Share on other sites More sharing options...
+bhall408 Posted October 14, 2020 Share Posted October 14, 2020 And the original code (1984) for AMAC: * Chset and DL's don't like to cross * page boundarys... ORG $3000-3 Start: jmp Init INCLUDE D:CHSET.MAC * Double check... ASSERT *L=[ChSet1+$400] INCLUDE D:MDLDATA.MAC Init: Stz Hscore sta Hscore+1 ldx #4 ;read ego ldy #CBGET ;count.. er.. jsr DiskHi ;I mean hscore . . . END Start 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.