Join us on Discord!
You can help CodeWalrus stay online by donating here.

Claw development system, a multiplatform programming platform [multiplatform]

Started by DarkestEx, May 07, 2016, 05:33:29 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

c4ooo

Quote from: DarkestEx on August 22, 2016, 12:06:52 PM
Quote from: c4ooo on August 22, 2016, 08:50:08 AM
Quote from: DJ Omnimaga on August 10, 2016, 04:02:26 PM
Oh I meant how commands are #elseif instead of elseif for example. On my French Canadian keyboard the # has no 1st level key assigned. I am ok with #, but commands will take longer to type.

Keep up the good work though :3=
No keyboard has a first level '#'.
If you can't be bothered to press the shift button you could get the hash-tag keyboard :trollface: http://thehashkey.com/kickstarter
Do a bit of research before claiming something:
-snip-
This is the german keyboard layout which has a first level # key right left to the return key.
Unfortunately the same layout makes it cumbersome to access the curly and sharp braces, as they need a modifier key to work.
Given that the population of Germany makes up 1.1% of the world population, these keyboards are still a minority ;) However, i would presume there are other      keyboard layouts with a first level '#', and one should also consider that computer use is not equally distributed across countries., however it seems that english keyboards with no first level '#' are still the blatant majority.

DarkestEx

Quote from: c4ooo on August 23, 2016, 09:10:25 AM
Quote from: DarkestEx on August 22, 2016, 12:06:52 PM
Quote from: c4ooo on August 22, 2016, 08:50:08 AM
Quote from: DJ Omnimaga on August 10, 2016, 04:02:26 PM
Oh I meant how commands are #elseif instead of elseif for example. On my French Canadian keyboard the # has no 1st level key assigned. I am ok with #, but commands will take longer to type.

Keep up the good work though :3=
No keyboard has a first level '#'.
If you can't be bothered to press the shift button you could get the hash-tag keyboard :trollface: http://thehashkey.com/kickstarter
Do a bit of research before claiming something:
-snip-
This is the german keyboard layout which has a first level # key right left to the return key.
Unfortunately the same layout makes it cumbersome to access the curly and sharp braces, as they need a modifier key to work.
Given that the population of Germany makes up 1.1% of the world population, these keyboards are still a minority ;) However, i would presume there are other      keyboard layouts with a first level '#', and one should also consider that computer use is not equally distributed across countries., however it seems that english keyboards with no first level '#' are still the blatant majority.
Haha yes, but I was still right :P

Also I am just following standards. C, C# and most assemblers use # for preprocessor instructions so I really don't feel bad for using it.
  • Calculators owned: TI-84+, Casio 101-S, RPN-Calc, Hewlett-Packard 100LX, Hewlett-Packard 95LX
  • Consoles, mobile devices and vintage computers owned: Original Commodore 64C, C64 DTV, Nintendo GameBoy Color, Nintendo GameCube, Xbox 360, PlayStation 2

DarkestEx

So I would say the instruction set is now finally done :)
I have moved stuff around and tweaked others.
  • Calculators owned: TI-84+, Casio 101-S, RPN-Calc, Hewlett-Packard 100LX, Hewlett-Packard 95LX
  • Consoles, mobile devices and vintage computers owned: Original Commodore 64C, C64 DTV, Nintendo GameBoy Color, Nintendo GameCube, Xbox 360, PlayStation 2

Dream of Omnimaga

Great. There is only one concern I have about that instruction set, though, and it's that there seems to be many for an ASM-like instruction set. Are all ASM languages like that? Because I kept hearing ASM programmers saying they found ASM easier than higher-level languages because there are very few instructions to learn compared to other languages.
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

DarkestEx

Quote from: DJ Omnimaga on August 25, 2016, 05:36:20 AM
Great. There is only one concern I have about that instruction set, though, and it's that there seems to be many for an ASM-like instruction set. Are all ASM languages like that? Because I kept hearing ASM programmers saying they found ASM easier than higher-level languages because there are very few instructions to learn compared to other languages.
Well after all this is a fraction of all total Z80 instructions ;)
And most of them do high level things such as working with arrays.
  • Calculators owned: TI-84+, Casio 101-S, RPN-Calc, Hewlett-Packard 100LX, Hewlett-Packard 95LX
  • Consoles, mobile devices and vintage computers owned: Original Commodore 64C, C64 DTV, Nintendo GameBoy Color, Nintendo GameCube, Xbox 360, PlayStation 2

Dream of Omnimaga

  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

DarkestEx

  • Calculators owned: TI-84+, Casio 101-S, RPN-Calc, Hewlett-Packard 100LX, Hewlett-Packard 95LX
  • Consoles, mobile devices and vintage computers owned: Original Commodore 64C, C64 DTV, Nintendo GameBoy Color, Nintendo GameCube, Xbox 360, PlayStation 2

Dream of Omnimaga

Thanks for the link @DarkestEx , I didn't realize there were that many.

Also what happened to your avatar and signature banner? Both images are 404 links O.O
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

p2

both his avatar and signature banner are working? ^^ no 404s for me :)
(pictures weren't cached, could download them)

Edit: Looks like I checked right after he had fixed them ^^
  • Calculators owned: ti-83+, ti-84+, ti-84+, ti-84+se, ti-84+se(te), ti-nsphire, ti-nsphire CAS, ti-nsphire CX-CAS, ti-voyage, ti-voyage, Who reads this list anyways...?
Anyway war sucks. Just bring us your food instead of missiles  :P ~ DJ Omnimaga (11.10.2016 20:21:48)
if you cant get a jframe set up, draw stuff to it, and receive input, i can only imagine how horrible your game code is _._   ~ c4ooo (14.11.2016 22:44:07)
If they pull a Harambe on me tell my family I love them ~ u/Pwntear37d (AssangeWatch /r/)
make Walrii great again ~ DJ Omnimaga (28.11.2016 23:01:31)
God invented the pc, satan the smartphone I guess ~ p4nix (16.02.2017 22:51:49)

DarkestEx

Quote from: DJ Omnimaga on August 25, 2016, 11:46:59 PM
Thanks for the link @DarkestEx , I didn't realize there were that many.

Also what happened to your avatar and signature banner? Both images are 404 links O.O
Yes, Z80 is huge O.O

I just fixed the images. Thanks for telling me :)
  • Calculators owned: TI-84+, Casio 101-S, RPN-Calc, Hewlett-Packard 100LX, Hewlett-Packard 95LX
  • Consoles, mobile devices and vintage computers owned: Original Commodore 64C, C64 DTV, Nintendo GameBoy Color, Nintendo GameCube, Xbox 360, PlayStation 2

Dream of Omnimaga

Yay! Yeah at first I thought your host went belly up or something
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

DarkestEx

I started working on Claw as an operating system. This will be a separate project and will allow booting into Claw with a normal computer.
Unlike the embedded Claw, this will be closed source.
Here's a screenshot of it booting:
  • Calculators owned: TI-84+, Casio 101-S, RPN-Calc, Hewlett-Packard 100LX, Hewlett-Packard 95LX
  • Consoles, mobile devices and vintage computers owned: Original Commodore 64C, C64 DTV, Nintendo GameBoy Color, Nintendo GameCube, Xbox 360, PlayStation 2

Dream of Omnimaga

Nice. I hope the startup times remain fast, unlike the TI-Nspire OS  and most Windows OSes :)
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

DarkestEx

Quote from: DJ Omnimaga on September 07, 2016, 05:20:01 AM
Nice. I hope the startup times remain fast, unlike the TI-Nspire OS  and most Windows OSes :)
It's starting in just a few seconds (under 5 secs).

Btw, I have made a step by step walktrough through a sample program I made.
It is also available on my GitHub Wiki: https://github.com/bmuessig/Clawsemble/wiki/Step-by-step-example-program



.CWX:16  ;16 bit executable

#define num_values 3  ; number of values is 3
.dbs values {10,5,2}  ; constant short array with the values

.sym main:0  ; main entry point, you can name it whatever you want as long as you set its id to 0
        xci values  ; create a new buffer filled with the constant "values" from above
        lc 0  ; load the sum start number 0 onto the stack
        dp  ; load the counter start number 0 onto the stack by duplicating the last zero
    .lbl forloop_bgn  ; new label (start of for-loop)
        dp  ; duplicate the uppermost value to save it
        ltc num_values  ; check if counter is less than 5
        jpn forloop_end  ; if last comparision was false end the for-loop
        sw  ; swaps the counter with the sum
        ld 1  ; copies the counter ontop of the stack
        lxbd  ; load value in the values array at the counter position
        add  ; add the value from the array to the sum
        sw  ; swap to the counter again
        icr  ; increment the counter
        jp forloop_bgn  ; jump to the begin of the for-loop again
    .lbl forloop_end  ; end of the for loop
        dv  ; drop the counter
        divc num_values  ; divide the sum by the number of values
        dbdv  ; print the result to the debug console
        eop  ; optional end of program statement


.CWX:16
This statement basically just tells the assembler to make an executable, no library.
The executable shall use 16 bit constants.

#define num_values 3
This tells the preprocessor to load the number 3 into the preprocessor constant "num_values"

.dbs values {10,5,2}
This tells the compiler stage 2 to add an entry to the constant database with the name "values"

.sym main:0
This tells the compiler stage 2 to add a new symbol (aka function) that is named "main" and has the function id 0. Later the operating system / vm searches for function 0 when it launches the program. Function 0 is always the entry point for executables.

xci values
This creates a new array on the stack and makes its size and element equal to the one of the "values" constant.

lc 0
This loads the constant 16-bit number 0 onto the stack:
(Top of stack) 0 (Bottom of stack)

dp
This duplicates the top entry of the stack:
0 (Counter) (Top of stack)
0 (Sum) (Bottom of stack)

.lbl forloop_bgn
This saves a label (only valid to the current symbol) with the name "forloop_bgn".
This tells the compiler to note this address down for later use.

dp
This duplicates the counter as it will otherwise get lost in the next instruction:
0 (Copy of Counter) (Top)
0 (Counter)
0 (Sum)

ltc num_values
If the uppermost stack value that is popped is less than num_values (3), push 1. Otherwise push 0:
1 (Result of check) (Top)
0 (Counter)
0 (Sum)

jpn forloop_end
If the uppermost stack value that is popped is zero or smaller than zero, jump to "forloop_end":
0 (Counter) (Top)
0 (Sum)

sw
Swaps the Counter with the Sum:
0 (Sum) (Top)
0 (Counter)

ld 1
Copies the counter to the top of the stack:
0 (Copy of Counter) (Top)
0 (Sum)
0 (Counter)

lxbd
Loads the byte number at the array index of the uppermost stack entry to the stack:
10 (Value from array) (Top)
0 (Sum)
0 (Counter)

add
Adds the Value from the array to the sum and pushes the result:
10 (Sum) (Top)
0 (Counter)

sw
Swap to the counter again:
0 (Counter) (Top)
10 (Sum)

icr
Increment the counter by one:
1 (Counter) (Top)
10 (Sum)

jp forloop_bgn
Jumps back to the beginning of the loop.

(We go back to the beginning of the loop)
dp
This duplicates the counter as it will otherwise get lost in the next instruction:
1 (Copy of Counter) (Top)
1 (Counter)
10 (Sum)

ltc num_values
If the uppermost stack value that is popped is less than num_values (3), push 1. Otherwise push 0:
1 (Result of check) (Top)
1 (Counter)
10 (Sum)

jpn forloop_end
If the uppermost stack value that is popped is zero or smaller than zero, jump to "forloop_end":
1 (Counter) (Top)
10 (Sum)

sw
Swaps the Counter with the Sum:
10 (Sum) (Top)
1 (Counter)

ld 1
Copies the counter to the top of the stack:
1 (Copy of Counter) (Top)
10 (Sum)
1 (Counter)

lxbd
Loads the byte number at the array index of the uppermost stack entry to the stack:
5 (Value from array) (Top)
10 (Sum)
1 (Counter)

add
Adds the Value from the array to the sum and pushes the result:
15 (Sum) (Top)
1 (Counter)

sw
Swap to the counter again:
1 (Counter) (Top)
15 (Sum)

icr
Increment the counter by one:
2 (Counter) (Top)
15 (Sum)

jp forloop_bgn
Jumps back to the beginning of the loop.

(We go back to the beginning of the loop)
dp
This duplicates the counter as it will otherwise get lost in the next instruction:
2 (Copy of Counter) (Top)
2 (Counter)
15 (Sum)

ltc num_values
If the uppermost stack value that is popped is less than num_values (3), push 1. Otherwise push 0:
1 (Result of check) (Top)
2 (Counter)
15 (Sum)

jpn forloop_end
If the uppermost stack value that is popped is zero or smaller than zero, jump to "forloop_end":
2 (Counter) (Top)
15 (Sum)

sw
Swaps the Counter with the Sum:
15 (Sum) (Top)
2 (Counter)

ld 1
Copies the counter to the top of the stack:
2 (Copy of Counter) (Top)
15 (Sum)
2 (Counter)

lxbd
Loads the byte number at the array index of the uppermost stack entry to the stack:
2 (Value from array) (Top)
15 (Sum)
2 (Counter)

add
Adds the Value from the array to the sum and pushes the result:
17 (Sum) (Top)
2 (Counter)

sw
Swap to the counter again:
2 (Counter) (Top)
17 (Sum)

icr
Increment the counter by one:
3 (Counter) (Top)
17 (Sum)

jp forloop_bgn
Jumps back to the beginning of the loop.

(We go back to the beginning of the loop)
dp
This duplicates the counter as it will otherwise get lost in the next instruction:
3 (Copy of Counter) (Top)
3 (Counter)
17 (Sum)

ltc num_values
If the uppermost stack value that is popped is less than num_values (3), push 1. Otherwise push 0:
0 (Result of check) (Top)
3 (Counter)
17 (Sum)

jpn forloop_end
If the uppermost stack value that is popped is zero or smaller than zero, jump to "forloop_end":
3 (Counter) (Top)
17 (Sum)

(We jump to the end of the loop)
dv
Drops the uppermost stack value (the counter):
17 (Sum) (Top)

divc num_values
Integer-divides the Sum by the number of values (3):
6 (Result) (Top)

dbdv
Prints the result to the debug console: 6
The stack is now empty.

eop
Ends the program. This is optional.

I really hope this helps understanding how Claw works. Making this step by step listing took quite a while :)
  • Calculators owned: TI-84+, Casio 101-S, RPN-Calc, Hewlett-Packard 100LX, Hewlett-Packard 95LX
  • Consoles, mobile devices and vintage computers owned: Original Commodore 64C, C64 DTV, Nintendo GameBoy Color, Nintendo GameCube, Xbox 360, PlayStation 2

E37

Alright, I have all the hex and their names copied.
Since I don't have the organization for the menus, I have started on the compiler.
All I have is convert number in program to 16bit number.
I hope to have the source code compatible so all it now needs is a compiler.
  • Consoles, mobile devices and vintage computers owned: Ti83,Ti84!
I've never finished a project, there is always a way to improve!
What's my calc's name? Convert $37 to decimal. Look up that element in the periodic table. Then take the abbreviation of that element and you have it!
Look! A slime!    <(^.^)>

Powered by EzPortal