rocky1138 Posted May 21, 2017 Share Posted May 21, 2017 In Belboz's workshop zip file there's a "move" example which moves a Jaguar logo around the screen. The attached tarball lets you assemble and link it using `vasm` and `vlink` instead of the more traditional methods. I'm having a lot of fun getting these workshops and other sample codebases to work with the new assembler and linker. No idea what the license is on Belboz's tools. I'd like to include a LICENSE file in this tarball, but can't yet. 1 Quote Link to comment Share on other sites More sharing options...
rocky1138 Posted May 21, 2017 Author Share Posted May 21, 2017 See attached. move-vasm-vlink.tar.gz 1 Quote Link to comment Share on other sites More sharing options...
toarnold Posted May 22, 2017 Share Posted May 22, 2017 (edited) Well done! Please let me give you a small suggestion. You define a STADDR but this address is never used. This can be done with parameter -Ttext $(STADDR) but this will be ignored by the linker, because you are using the jagsrv format. In this case you have to define your own linker script, otherwise vlink uses an interal linker script which looks like SECTIONS { . = 0x4000; .text: { *(.text CODE text) } . = ALIGN(32); .data: { VBCC_CONSTRUCTORS *(.data DATA data) } . = ALIGN(32); .bss: { *(.bss BSS bss) *(COMMON) _BSS_END = ALIGN(32); } }; In case your code should run in the rom area $80200 you can move the text segment. But be aware to move data and bss segment in the ram area $4000. Than pass this new linker script with parameter -T Greetings, toarnold Edited May 22, 2017 by toarnold 1 Quote Link to comment Share on other sites More sharing options...
rocky1138 Posted May 23, 2017 Author Share Posted May 23, 2017 Well done! Please let me give you a small suggestion. You define a STADDR but this address is never used. This can be done with parameter -Ttext $(STADDR) but this will be ignored by the linker, because you are using the jagsrv format. In this case you have to define your own linker script, otherwise vlink uses an interal linker script which looks like SECTIONS { . = 0x4000; .text: { *(.text CODE text) } . = ALIGN(32); .data: { VBCC_CONSTRUCTORS *(.data DATA data) } . = ALIGN(32); .bss: { *(.bss BSS bss) *(COMMON) _BSS_END = ALIGN(32); } }; In case your code should run in the rom area $80200 you can move the text segment. But be aware to move data and bss segment in the ram area $4000. Than pass this new linker script with parameter -T Greetings, toarnold Such a good catch. Thanks toarnold! Since I'm fine with the `jagsrv` format, I'll probably just remove the unused Makefile variable. 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.