Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown. Learn more about Collectives on Stack Overflow. The Overflow Blog. Stack Gives Back Safety in numbers: crowdsourcing data on nefarious IP addresses. Featured on Meta. New post summary designs on greatest hits now, everywhere else eventually.
Related Hot Network Questions. Question feed. Stack Overflow works best with JavaScript enabled. Accept all cookies Customize settings. We redirect you to this notice instead of stripping out the link to preserve the integrity of the post. Thanks, Nathan Paulino Campos. Answered by wildgoose in a post from 12 Years Ago. I'm kind of rusty at this It's been many years so I don't remember if writing a 0Ch to the display clears it or not!
How i have to use this, like this? Clr: mov es:[di],ax ; Write text char and attribut byte add di,2 dec cx jne Clr. Thanks, now it's working! Facebook Like. Twitter Tweet. Be a part of the DaniWeb community. Sign Up — It's Free! The Accumulator is an area of fast memory located within the CPU. A subroutine is a piece of code in memory that does something and knows how to return to where it was called. CHROUT expects the character to be output to be in the Accumulator, hence the reason that it was put there previously.
Once the subroutine has finished it returns to the instruction after the one that called it. Here this is the BRK instruction, which says that processing has finished and control will be returned to the ML monitor. In introductory programming tutorials it is customary to do a "Hello, World! We'll do this by extending the program above past the clear screen routine:.
This location is where the "Hello, World! So it allows each character of the string to be put into the Accumulator. Therefore 0 is used to mark the end of the string. The X index register is now incremented by one and the code Branches back to the instruction that loads the next character from the string. To get around this, when the program was first written I put in dummy values and made a note of which places I needed to go back to, to correct the forward references. Once the program was entered I could disassemble it and find the locations of the BRK instruction and the one past it for the string.
Armed with this I went back and using the A command altered those lines to point to the correct locations. If we look at the table below we can see that the BNE instruction takes less bytes in memory 2 instead of 3. This allows a maximum distance of bytes backwards and bytes forward because a single byte can have possible values.
The BNE instruction also has the added bonus that it protects the program from running for ever in case the 0 is forgotten at the end of the string. Once X gets to if it is incremented it will become 0 and the BNE instruction will pass control to the BRK instruction to end the program. More information is available in this instruction reference. This is a "Hello, World! Use your cursors to move over to the first octet and alter each in turn to match the list of hexadecimal numbers above.
However, I wanted to show how to use the A command to change the instruction at a location and carry on entering assembly. If we wanted to Save our program above we would use the S command. To save it to disk use:. The end memory address must be given as one past the real end address. You can now load the program back off cassette or disk:. There is plenty of information on this site with further links to other sites about programming the Vic.
To start have a look at:.
0コメント