Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
You are not logged in - nap
CSDb User Forums


Forums > C64 Coding > Kick Assembler Thread 2
2009-07-21 17:20
Slammer

Registered: Feb 2004
Posts: 449
Kick Assembler Thread 2

The previous thread took a little long to load, so this is a new fresh one..
 
... 650 posts hidden. Click here to view all posts....
 
2025-06-13 15:15
cobbpg

Registered: Jan 2022
Posts: 53
Quoting Krill
I guess you can't do ".float 62.23, 6.28, 1e6" analogous to .byte/.word (apart from having to define a macro/function for the purpose or including some magic library file every time you need this).

Also, now you have to write it as something like EmitFloats(List().add(1, 2, 3, 4, 5)) (short of defining all the N variants you'll ever use). If we had variadic macros, you could write EmitFloats(1, 2, 3, 4, 5) instead, which doesn't feel too bad to me. Variadic macros and functions could be generally useful to clean up some noise here and there, and their implementation could be straightforward: they would always be declared with a single List-typed argument, possibly with a dedicated keyword like .varmacro/.varfunction.
2025-06-14 09:38
Slammer

Registered: Feb 2004
Posts: 449
Quoting Oswald
I dont use repository, its just a source file and an assembler and a few data files generated in vb6 or python, I dont like to overcomplicate things. but whatever floats your boat, hide the source include in some .cfg file you will forget even exists, its much nicer to be able to see it in the main source right away. but that is just my opinion, you do it as you like.


But Oswald, I find it a bit funny that you use the exact same constructs in Python as the ones you critize. Eg. if you want to use 'datetime' you do 'from datetime import datetime' and your downloaded libraries you keep in 'requirements.txt' (equivalent to what you call 'some .cfg file you will forget even exists'). And even if you don't use a repository, you can still place the jar/cfg-file together with your project. I'm starting to understand why people call you 'grumpy old man' - It's like you are trying to construct problems there isn't there :-)
2025-06-14 10:35
Oswald

Registered: Apr 2002
Posts: 5127
Quote: Quoting Oswald
I dont use repository, its just a source file and an assembler and a few data files generated in vb6 or python, I dont like to overcomplicate things. but whatever floats your boat, hide the source include in some .cfg file you will forget even exists, its much nicer to be able to see it in the main source right away. but that is just my opinion, you do it as you like.


But Oswald, I find it a bit funny that you use the exact same constructs in Python as the ones you critize. Eg. if you want to use 'datetime' you do 'from datetime import datetime' and your downloaded libraries you keep in 'requirements.txt' (equivalent to what you call 'some .cfg file you will forget even exists'). And even if you don't use a repository, you can still place the jar/cfg-file together with your project. I'm starting to understand why people call you 'grumpy old man' - It's like you are trying to construct problems there isn't there :-)


yes you can do all that, but I am lazy and grumpy, I just start the python file then it complains, then I see on top of the source what libraries are missing, I install them, done. :)

tbh I only used python for one thing, and dont know very much about it, didnt knew about req.txt, but wouldnt use it just to "remember" I used numpy and that other library I clearly remember downloading from a specific site.
2025-06-14 11:00
Slammer

Registered: Feb 2004
Posts: 449
Quoting cobbpg
Quoting Krill
I guess you can't do ".float 62.23, 6.28, 1e6" analogous to .byte/.word (apart from having to define a macro/function for the purpose or including some magic library file every time you need this).

Also, now you have to write it as something like EmitFloats(List().add(1, 2, 3, 4, 5)) (short of defining all the N variants you'll ever use). If we had variadic macros, you could write EmitFloats(1, 2, 3, 4, 5) instead, which doesn't feel too bad to me. Variadic macros and functions could be generally useful to clean up some noise here and there, and their implementation could be straightforward: they would always be declared with a single List-typed argument, possibly with a dedicated keyword like .varmacro/.varfunction.

True, The List().add(..) is not nice in this situation.. I can tell you that I'm planing a to make it easier to make lists and hashtables which will do it a little better. [..] and {..} is taken, so I plan for:
    .var myList = [[ $10, $20, $30, "Hello", "World"]]     
    .var myHashTable = {{ "Name" : "Codebase64", Message: "Support Frantic and Moloch" }}  

and some python inspired stuff like:
    .var myList = [[ x foreach x in range(10)]]     

    // Fill 5 sprites in alternating colors 
    // (Spriterange returns structs with n= spriteNo, x=xpos, y=....)
    .var colors = [[ %10101010, %01010101, %11111111, %10011001, %01100110 ]]
    .fill [[ colors.get(s.n) foreach s in spriteRange(5) ]]     

However, the new namespacing and segment modifiers shall be completed first.

variadic macros would also be good!

Regarding the current sitiation. Using .pseudocommands gets the job done so if you really want a float 'directive' you can hack it with something like:

    .pseudocommand float f0 : f1 : f2 : f3 : f4 : f5 : f6 : f7 {

        .var varargs = List().add(f0,f1,f2,f3,f4,f5,f6,f7)
        .foreach (var f in varargs) {
            .if (f.getType()== AT_NONE) .return;
            .fill myToBasicFloatFunc(f.getValue())
        }
    }

    // Use:
    float 1.234 : 0.000123 : -123.123
2025-06-14 11:28
Slammer

Registered: Feb 2004
Posts: 449
Krill: As I understand it, today you define textstings and use the basicroutines to do the conversions runtime, correct? Could you generate a set of test numbers (bigger than what we got here: https://www.c64-wiki.com/wiki/Floating_point_arithmetic)?
2025-06-15 17:21
chatGPZ

Registered: Dec 2001
Posts: 11523
Mind boggling this is even discussed.

The code to support this is probably a 10th as long as this thread :D
2025-07-05 15:14
ChristopherJam

Registered: Aug 2004
Posts: 1424
requirements.txt is so last decade. The cool kids use inline script metadata these days (the requirements are listed in magic comments near top of file), then you can just

uv run script.py

and the first time you run it it'll build and cache a virtualenv somewhere with any needed libraries that it will then use on this and on every subsequent run.
Previous - 1 | ... | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 - Next
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
Airwolf/F4CG
curtcool
Andy/AEG
psych
Guests online: 505
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Codeboys & Endians  (9.7)
4 Mojo  (9.6)
5 Coma Light 13  (9.6)
6 Edge of Disgrace  (9.6)
7 Signal Carnival  (9.6)
8 Wonderland XIV  (9.5)
9 Uncensored  (9.5)
10 Comaland 100%  (9.5)
Top onefile Demos
1 Nine  (9.7)
2 Layers  (9.6)
3 Cubic Dream  (9.6)
4 Party Elk 2  (9.6)
5 Copper Booze  (9.5)
6 Scan and Spin  (9.5)
7 Onscreen 5k  (9.5)
8 Grey  (9.5)
9 Dawnfall V1.1  (9.5)
10 Rainbow Connection  (9.5)
Top Groups
1 Artline Designs  (9.3)
2 Booze Design  (9.3)
3 Performers  (9.3)
4 Oxyron  (9.3)
5 Censor Design  (9.3)
Top Crackers
1 Mr. Z  (9.9)
2 OTD  (9.8)
3 Antitrack  (9.8)
4 Fungus  (9.8)
5 S!R  (9.8)

Home - Disclaimer
Copyright © No Name 2001-2025
Page generated in: 0.08 sec.