funkheld Posted May 24, 2019 Share Posted May 24, 2019 Hi good afternoon how do you start an asm program at $6000? Thank you. Greeting 1 Quote Link to comment Share on other sites More sharing options...
JoSch Posted May 24, 2019 Share Posted May 24, 2019 That depends on the assembler, you are using. Most use "ORG $6000". Quote Link to comment Share on other sites More sharing options...
funkheld Posted May 24, 2019 Author Share Posted May 24, 2019 Hi, Thank You. I wanted a finished compiled asm program at $ 6000 is that possible with call ... or? Thank you. Greeting Quote Link to comment Share on other sites More sharing options...
JoSch Posted May 24, 2019 Share Posted May 24, 2019 Hi, Thank You. I wanted a finished compiled asm program at $ 6000 is that possible with call ... or? Thank you. Greeting What assembler are using? Quote Link to comment Share on other sites More sharing options...
funkheld Posted May 24, 2019 Author Share Posted May 24, 2019 this beginning bei $6000 : vscrold3.xex Greeting Quote Link to comment Share on other sites More sharing options...
JoSch Posted May 24, 2019 Share Posted May 24, 2019 try "org $6000" before the first assembler instruction. Quote Link to comment Share on other sites More sharing options...
Ute Posted May 24, 2019 Share Posted May 24, 2019 (edited) Here is a simple example by Peter Dell. It shows how to start an assembly program at a certain address. This example uses org $0400, but just substitute that for $6000. What you're missing is what tells the assembler where to start. You can use either RUNAD(02E0-02E1) or INITAD(02E2-02E3). The difference being INITAD will run as soon as that location loads. RUNAD will execute after the entire program has loaded. First example shows a typical way to point RUNAD to the org address. Second shows what it looks like disassembled. If you're using MADS assembler you can just use the 'run' command followed by the address you want to start from. Edited May 24, 2019 by Ute 2 Quote Link to comment Share on other sites More sharing options...
sanny Posted May 24, 2019 Share Posted May 24, 2019 how do you start an asm program at $6000? what exactly do you mean with "start"? How to start the program after it was compiled? Or what to write in the source code before instructions? Or how to define start address of program? Please be more specific... "NOT ENOUGH INFORMATION ERROR"... Quote Link to comment Share on other sites More sharing options...
ricortes Posted May 25, 2019 Share Posted May 25, 2019 (edited) $02E0 is a magic number for files. What happens is while/after a file is loaded, the OS checks that position for a change and if it does, jumps to that location. The way assemblers work is different ORG are appended to the preceding file. The above wouldn't work if it was assembled to memory and run from memory. That is, the first ORG sets that data stream in the file to that location. DOS will examine the first 6 bytes created to determine if it is a binary file, where to start loading it, and where it ends. When DOS finishes this, it sees if there are any additional bytes in the file. If there is more in the file, the same process is repeated. In this case, the only thing the second file does is put two bytes at the magic place for DOS to jump to. In this case, the first file gets loaded at $6000, DOS continues and loads the second file at $02E0, sees $02E0 has changed so it jumps<or JSR if INIT VECTOR at $02E2 is used> to that location. It's a really nice feature because you can actually load files that use the same memory or data or initiate routines. For instance you may want to switch the OS to RAM, load a new character font to the OS area, the load your mainline code to the same area the first OS switching program used. Or you could load an OS switcher, do a next file with just the address of the OS character set and the new font, then load your program. Very trick IMHO. You could load an entire OS with a new font, load a switcher somewhere else, then replace the OS and continue reusing those locations for your program. It would be possible to use an entire disk for a game or application where the INIT code just does dungeon levels in an RPG for instance. Edited May 30, 2019 by ricortes 2 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.