Jump to content

Search the Community

Showing results for tags 'assembly'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Commander X16 Forums
    • Introductions
    • X16 Discussion Lounge
    • X16 Help & Support Lounge
    • The Lounge
    • Hobbies and Interests

Categories

  • Official Software
  • Official Docs
  • Community Downloads
    • Games
    • Productivity Apps
    • Graphics Apps
    • Audio Apps
    • Demos
    • Networking Apps
    • Dev Tools
    • Tutorial Apps
    • Misc Apps

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


About Me

  1. When programming in assembly language, quite often you will need to do calculations that would normally require floating point math. Those subroutines are available, the same ones that BASIC uses, but they are very slow. And if you're programming in assembly, you're doing so because it's much faster than BASIC, so using those routines can defeat the purpose, particularly if you need to do a lot of such calculations. Ideally in assembly language you want to have most of your variables consisting of single bytes, not the four used for floating point. It's having to move all those bytes around and doing calculations involving all of them that makes the floating point subroutines slow. And if you're going for speed, you can make a tradeoff: increased speed at the expense of accuracy. A function involving a single byte can just be a lookup table. Over the last several years I have developed a number of lookup tables and subroutines that enable some very fast math on the 6502 and now 65c02. Inspired by @svenvandevelde's question about ATAN2, I decided to compile many of them into a single 8kb file that can be loaded into banked RAM. I have other such routines and lookup tables, but I decided to just include those that would most likely be useful to the broadest range of applications. These lookup tables and functions will work on all revisions of the X16 emulator, and indeed will work on any 65c02 system as long as the file is loaded at $A000. The functions are all called through JMP redirects in page BF, and those JMP table locations will not change if I do revisions on the code. I'm pretty sure I killed all the bugs, but some might have slipped through. I'll be using further posts in this thread as sort of a user guide, but attached to this post is the file FASTMATH.BIN (the lookup tables and functions) and a text file containing the BASIC program that made all of the lookup tables (but don't copy and paste it into the emulator or it will overwrite FASTMATH.BIN). When using FASTMATH.BIN, you must use a relocated load to put it into banked RAM, otherwise it will load into memory at $7000 and won't work. Or you could load it into its default location at $7000 and just copy it up into the RAM bank of your choice. This software is released under an MIT license, meaning you can use it freely for any purpose, commercial or non-commercial, as long as you leave the MIT license in there (it's located at $BF7F). And please, these functions are all just approximations accurate to about 1%, so don't use the software for controlling a nuclear power plant or medical equipment. maketables.txt FASTMATH.BIN
  2. Version 2.0.0

    11 downloads

    When programming in assembly language, quite often you will need to do calculations that would normally require floating point math. Those subroutines are available, the same ones that BASIC uses, but they are very slow. And if you're programming in assembly, you're doing so because it's much faster than BASIC, so using those routines can defeat the purpose, particularly if you need to do a lot of such calculations. Ideally in assembly language you want to have most of your variables consisting of single bytes, not the five used for floating point. It's having to move all those bytes around and doing calculations involving all of them that makes the floating point subroutines slow. And if you're going for speed, you can make a tradeoff: increased speed at the expense of accuracy. A function involving a single byte can just be a lookup table. Over the last several years I have developed a number of lookup tables and subroutines that enable some very fast math on the 6502 and now 65c02. FASTMATH.BIN is many of them compiled into a single 8kb file that can be loaded into banked RAM. These lookup tables and functions will work on all revisions of the X16 emulator, and indeed will work on any 65c02 system as long as the file is loaded at $A000. The functions are all called through JMP redirects in page BF, and those JMP table locations will not change if I do revisions on the code. I'm pretty sure I killed all the bugs, but some might have slipped through. This is probably going to be the final revision of FASTMATH, barring some sneaky bug hiding in the code. There's only 6 bytes left anyhow. The file fastmath.txt contains detailed information about each lookup table and function and how to use them. The file FASTMATH.BIN is the binary that must be loaded into banked RAM.
  3. FASTMATH View File When programming in assembly language, quite often you will need to do calculations that would normally require floating point math. Those subroutines are available, the same ones that BASIC uses, but they are very slow. And if you're programming in assembly, you're doing so because it's much faster than BASIC, so using those routines can defeat the purpose, particularly if you need to do a lot of such calculations. Ideally in assembly language you want to have most of your variables consisting of single bytes, not the five used for floating point. It's having to move all those bytes around and doing calculations involving all of them that makes the floating point subroutines slow. And if you're going for speed, you can make a tradeoff: increased speed at the expense of accuracy. A function involving a single byte can just be a lookup table. Over the last several years I have developed a number of lookup tables and subroutines that enable some very fast math on the 6502 and now 65c02. FASTMATH.BIN is many of them compiled into a single 8kb file that can be loaded into banked RAM. These lookup tables and functions will work on all revisions of the X16 emulator, and indeed will work on any 65c02 system as long as the file is loaded at $A000. The functions are all called through JMP redirects in page BF, and those JMP table locations will not change if I do revisions on the code. I'm pretty sure I killed all the bugs, but some might have slipped through. This is probably going to be the final revision of FASTMATH, barring some sneaky bug hiding in the code. There's only 6 bytes left anyhow. The file fastmath.txt contains detailed information about each lookup table and function and how to use them. The file FASTMATH.BIN is the binary that must be loaded into banked RAM. Submitter Ed Minchau Submitted 06/23/22 Category Productivity Apps  
  4. Version 1.3.41.0712

    20 downloads

    The META/L editor is a direct assembly language editor. It shares some features of a Monitor program, with extensive use of metadata to take it well beyond anything a Monitor can do. Unlike a text editor that later compiles your code, META/L interprets it as assembly language opcodes as you type it. Unlike a Monitor, you can do things like copy and paste code, move it around, or insert or delete bytes in the middle of your code; the metadata allows the editor to adjust parameters as labels move. Every byte of RAM and ROM is accessible to you on the fly. Download the zip file, unzip it somewhere, and copy everything into the same folder as your r41 emulator. Full documentation is in the file docs/edit.html This software is released under an MIT license. There are also a number of videos in the forum here
  5. META/L assembly language editor View File The META/L editor is a direct assembly language editor. It shares some features of a Monitor program, with extensive use of metadata to take it well beyond anything a Monitor can do. Unlike a text editor that later compiles your code, META/L interprets it as assembly language opcodes as you type it. Unlike a Monitor, you can do things like copy and paste code, move it around, or insert or delete bytes in the middle of your code; the metadata allows the editor to adjust parameters as labels move. Every byte of RAM and ROM is accessible to you on the fly. Download the zip file, unzip it somewhere, and copy everything into the same folder as your r41 emulator. Full documentation is in the file docs/edit.html There are also a number of videos in the forum here Submitter Ed Minchau Submitted 05/28/22 Category Productivity Apps  
  6. Now live on GitHub, version 1.2.38.0664 of the META/L assembly language editor. https://github.com/edrobotguy/cx16/blob/master/METAL1_2_38_0664update.zip If you down'oad the zip file, extract it into the same folder as your X16 rev 38 emulator. Then you'll find thorough documentation in docs/edit.html the video playlist is here: METAL1_2_38_0664update.zip
  7. Version 1.0.1

    17 downloads

    Pong clone written in assembly by me. Done on ROM version r39 Controls: Right pallet: Arrow up- up Arrow down - down Left pallet: A - up X- down Source code: https://github.com/radekrudak/PONG-clone-for-comander-x-16 As much as i would like to add "Try it now" button, sadly web emulator refuse to work with my crappy code ( ngl. i would do the same if i was it !)
  8. Yet another pong clone View File Pong clone written in assembly by me. Done on ROM version r39 Controls: Right pallet: Arrow up- up Arrow down - down Left pallet: A - up X- down Source code: https://github.com/radekrudak/PONG-clone-for-comander-x-16 As much as i would like to add "Try it now" button, sadly web emulator refuse to work with my crappy code ( ngl. i would do the same if i was it !) Submitter Radoslaw Submitted 04/29/22 Category Games  
  9. Version 0.0.0.7

    65 downloads

    I leave this here mainly for me to play about with when not at home, and also to see if it works on the web emulator. It does not yet function as a game, but as development progresses, I will regularly update this to track its progress. Controls: W, A, S, D to move. Hold down for running.
  10. Version 0.6

    677 downloads

    Here is the Mandelbrot version of my Julia Set program, coded in assembly. Again, many thanks to the forum users here for their guidance, as well as the many YouTubers with their excellent tutorials on 6502 assembly language. It's a lot faster than the BASIC version, but nevertheless, benefits from being run in warp mode. Now in colour, with thanks to: VERA Overview (8bitcoding.com) NEW VERSION NOW WITH MOUSE CONTROLS! When the image has finished rendering, click the left mouse on the area of the screen you wish to zoom in to. To change the detail settings (cycle between Low, Med, High) click the right mouse button. Poke around in the old version... Try copying and pasting the following groups of POKEs to explore further (not all at once, just each paragraph in turn!): POKE $D6B,$19:POKE $D6A,$64:REM FX=6500 POKE $D6D,$13:POKE $D6C,$54:REM FY=4948 POKE $D6E,$00:POKE $D6F,$FF:REM FX=POS,FY=NEG POKE $D7B,$00:POKE $D7A,$01:REM STEP=1 POKE $D7C,$FF:REM ITERATIONS=255 SYS2061 POKE $D6B,$0F:POKE $D6A,$A0:REM FX=4000 POKE $D6D,$00:POKE $D6C,$00:REM FY=0 POKE $D6E,$FF:POKE $D6F,$FF:REM FX=NEG,FY=NEG POKE $D7B,$01:POKE $D7A,$F4:REM STEP=500 POKE $D7C,$FF:REM ITERATIONS=255 SYS2061 POKE $D6B,$0F:POKE $D6A,$878:REM FX=3960 POKE $D6D,$03:POKE $D6C,$E8:REM FY=1000 POKE $D6E,$FF:POKE $D6F,$FF:REM FX=NEG,FY=NEG POKE $D7B,$00:POKE $D7A,$32:REM STEP=50 POKE $D7C,$FF:REM ITERATIONS=255 SYS2061 To use the POKES above in the web emulator, first click the X in the top right corner of the web emulator. Paste the POKES above that you want to use in to the text field to the left, replacing what's already in there, then click the Run button. Individual addresses that can be poked: $D6A 30 75 .word 30000 ; FX $D6C A8 61 .word 25000 ; FY $D6E FF .byte $ff ; FX SIGN ff = negative $D6F FF .byte $ff ; FY SIGN ff = negative $D7A A8 61 .word 25000 ; STEP (lower=higher zoom) $D7C 10 .byte $10 ; ITERATIONS Old poke codes for the colour PETSCII version: step: POKE $0D3D e.g. 50 for a step of 0.05 (smaller number, higher zoom) iterations: POKE $0D3F e.g. 30 iterations about right, higher = slower start x: POKE $0D2F, normally 8 (for -0.8) - nicely centred at low zoom start y: POKE $0D31, normally 12 (for -1.2) - again centred at low zoom Old poke codes for the PETSCII version: step: POKE $0cff e.g. 50 for a step of 0.05 (smaller number, higher zoom) iterations: POKE $0d01 e.g. 30 iterations about right, higher = slower start x: POKE $0cf1, normally 8 (for -0.8) - nicely centred at low zoom start y: POKE $0cf3, normally 12 (for -1.2) - again centred at low zoom You Tube video of this in action: Commander X16 - 6502 assembly demo - Mandelbrot set - YouTube Commander X16 - Fractal Zoom Demo - 6502 Assembly - YouTube
  11. I have been experimenting with assembly for a little bit. I've created a simple function to replace some BASIC I have which works, but is slow (the BASIC is slow, not the assembly - whoosh its super fast!) . I'm using the cc65 toolchain. Its definitely a challenge I am enjoying. When I compile with .ORG $080D I can load the PRG and run it ok. If I change the memory address to .ORG $0400 that just breaks the program since the SYS2016 no longer works. If I adjust the PRG header so it is loaded to address $0400 instead of $0801 and then try to SYS to the actual first assembly instruction it is broken as well. If I adjust the .ORG $040C which is the first assembly instruction after the 3 BASIC NULLs, adjust the PRG header and call with SYS then my program works. My question is, how do I compile some assembly which I can call using the SYS command easily. eg Create some machine code that my BASIC program can just poke in to memory and then call with SYS. Or create a PRG which has the correct load address and no single line basic included. Or once compiled will I need to manually edit the PRG? I'm sure I've missed some simple switch or I've not understand something. Any pointers would be great.
  12. Hi Everyone! Like many other people around here, I'm using the CA65 assembler to develop for the X16. One thing I don't really understand is what the .SEGMENT command does exactly. I find the CA65 documentation a bit terse on this matter: Could any tell me what exactly happens if I use .SEGMENT "DATA" inside my code? Thanks! Cedric
  13. File Loader Tutorial View File Introduction Here is a little demo of how to dynamically load files in RAM bank in assembly. It's very simple to do but I think that it can be helpful for someone who don't know how to do this right away. In fact I personally would love to see more of this kind of programs in the download section How this loader works ? First thing to do is to tell the Kernal that we want to use a logical file. For this we need to use the SETLFS subroutine. From the "C64 Programmer Reference Guide" : Since we want to load from the disk (or filesystem) we'll need to use the device number 8. The logical file is not important so we use the file 0. Also, as we want to relocate the program into a bank at $A000, we'll set the Y register to #0 to activate secondary address mode. Next step is telling the Kernal which file we want to load. For this we'll use the SETNAME subroutine. From the "C64 Programmer Reference Guide" : For this we'll need to store our file names somewhere in our program so we write at the bottom of our file the names as a string of petscii characters. We then prepare our registers with the size of the filename to load, and then the address. Our final step to load a file is obviously the LOAD subroutine. From the "C64 Programmer Reference Guide" : As the Reference guide said, we want to load a file so we set our A register to 0 and since we want to load to banked RAM ($A000) we enter the address in our X and Y registers. One last thing that we need to do just after each of our LOAD calls, is to verify that our file has been successfully loaded. For this, we'll need to use the READST subroutine. From the "C64 Programmer Reference Guide" : As usual, following the Reference guide, all we need to do is call this subroutine just after our LOAD call, and check the content of the Accumulator. If zero, the load was successful. And that's all ! You can chain file loading as much as you need, and even you just need to call SETLFS once at the start of the chain. Note that you'll need to switch the bank between file loads to prevent overwriting previously added program. And since Bank 0 is also reserved you'll need to first switch to bank 1 and start from here. At the end you can also load a file in place of the loader, just avoid overwriting memory where the code is currently being executed. You can for example leave this kind of code in your first bank and at last run it to load a program from $0800 to $9EFF. Kernal Subroutines full documentation : https://www.pagetable.com/c64ref/kernal/ Post Scriptum If you have any suggestions for the code or even want to change things in this description, don't hesitate to tell me ! Submitter VincentF Submitted 07/19/20 Category Tutorial Apps  
  14. so im pretty new to text based programming languages. with only one i am fluent with. (BATCH) i have coded some simple things before in BASIC and the X16 caught my eye because im really interested in C64 things. even though i dont have one of my own. so, jumping straight in, certain things i found that worked on the C64 dont work in the X16. and some things that im not even sure are possible even on a C64. so, as the title says, i have some simple questions. how can i make a random number generator capable of outputting 2 different 1 digit numbers? how does one program in assembly? no, im not asking to learn assembly. im asking how i actually start writing assembly code.
  15. Hello everyone, Here's my 3rd experiment on the x16. It's a 32x32 pixel scroller like you'd see in a demoscene intro. I wanted to share what I've learned so far in case it might help some other newbie along. While watching slithymatt's tutorials about VERA I wanted to play around with the layering, tiles and scrolling systems. Attached is an animated gif, the prg and the source code in KickAssember format, since that's what I'm used to using on the C64 for my cross development. The best thing about using KickAssembler in my opinion is that is has a strong macro language build in, so the source code loads the png font and converts it to a VERA compatible format... no need to write conversion helpers in other scripting languages. Hope you enjoy. p.s. Not sure if this is the best forum to post this? Is there somewhere more appropriate? p.p.s. IS the jittering in the emulator avoidable? I tried a few things but was unable to reduce / remove it? scroll32.prg src_scroll32.zip
  16. Codename ChickenLips View File I leave this here mainly for me to play about with when not at home, and also to see if it works on the web emulator. It does not yet function as a game, but as development progresses, I will regularly update this to track its progress. Controls: W, A, S, D to move. Hold down for running. Submitter gavinhaslehurst Submitted 04/22/21 Category Demos  
  17. Will it be possible to detect the clock speed setting/jumpers programatically? In case I have a program that is sensitive to processor speed, I would like to automatically adjust a delay routine so that program usage is transparent to the user. If not, I suspect that most people will be using 8Mhz anyway.
  18. I wanted to ask : is assembly language and monitor covered in the x16 manual?
  19. Chonky Text in 6502 Assembly View File A little demo of rendering giant text in assembly. It takes the data from the Lower/Upper character set in ROM and renders it in a large, "LCD-style" font. You can use .asciiz in CC65 for letters, or use a zero-terminated array of bytes to reference the character codes, as below (thanks to https://www.commanderx16.com/forum/index.php?/profile/5-jimmydansbo/ for the character set reference). Submitter gavinhaslehurst Submitted 03/03/21 Category Demos  
  20. Version 0.8

    146 downloads

    A little demo of rendering giant text in assembly. It takes the data from the Lower/Upper character set in ROM and renders it in a large, "LCD-style" font. You can use .asciiz in CC65 for letters, or use a zero-terminated array of bytes to reference the character codes, as below (thanks to https://www.commanderx16.com/forum/index.php?/profile/5-jimmydansbo/ for the character set reference).
  21. Version 0.0.3

    147 downloads

    I have been playing with the VERA chip in assembly, and have come up with a cheeky little demo screen that is reminiscent of some 80s demos I can remember as a kid. No music or fancy interactive stuff, but some of you might find it amusing. Warning: As a GP I feel I ought to point out this demo contains flashing / strobing effects! Thanks to the excellent tutorials of SlithyMatt - Commander X16™ Community, especially the latest one demystifying the VERA chip. I have used a lot of his code from the latest tutorial to create this demo.
  22. VERA Demo Screen written in assembly View File I have been playing with the VERA chip in assembly, and have come up with a cheeky little demo screen that is reminiscent of some 80s demos I can remember as a kid. No music or fancy interactive stuff, but some of you might find it amusing. Warning: As a GP I feel I ought to point out this demo contains flashing / strobing effects! Thanks to the excellent tutorials of SlithyMatt - Commander X16™ Community, especially the latest one demystifying the VERA chip. I have used a lot of his code from the latest tutorial to create this demo. Submitter gavinhaslehurst Submitted 02/24/21 Category Demos  
  23. Version 0.1

    12 downloads

    A small demo of the save_rect and rest_rect functions from the VTUI (VERA Text User Interface) library. For more information see https://github.com/jimmydansbo/vtuilib/ It is still very much work in progress, but I thought I would share this little demo with you.
  24. VTUI save/restore demo View File A small demo of the save_rect and rest_rect functions from the VTUI (VERA Text User Interface) library. For more information see https://github.com/jimmydansbo/vtuilib/ It is still very much work in progress, but I thought I would share this little demo with you. Submitter JimmyDansbo Submitted 02/08/21 Category Demos  
  25. Version 0.0.4

    157 downloads

    This is a quick demo of a 2D graphics library I've been working on recently. It's written in assembler, and aims to make life a bit easier when it comes to drawing vector graphics. You can define individual polygons which can be moved about and rotated. The source code looks fairly daunting, but when it comes down to it, building, transforming and rendering the polygons is very straightforward. Hopefully this will form the basis of a game at some point soon. (Perhaps an Asteroids clone?) Once I sink my teeth into interrupt handling, I should be able to "vsync" everything so it's flicker-free. All comments and suggestions welcome! Short screen capture of this demo on YouTube (featuring my tunez!!): Commander X16 Demo - Vector Graphics in 6502 Assembly - YouTube WARNING: For those who are sensitive to flickering/strobing, please be aware that this may cause problems for you. -- See below for a quick preview of the game I'm working on, retro flickering and all!
×
×
  • Create New...

Important Information

Please review our Terms of Use