Jump to content

Photo

Minikernel Developer's Guide


31 replies to this topic

#26 Muddyfunster OFFLINE  

Muddyfunster

    Chopper Commander

  • 110 posts

Posted Sun Sep 30, 2018 7:53 AM

You can do a minikernel (mostly) in bB.

 

I don't know if thats helpful or just trying to dodge things that should be confronted head on.

 

ie you don't really need to know much assembly but you still need to know

nuts and bolts (and you need enough assembly to understand what you get from

bB anyway)

 

 

 

 

This code example wouldn't compile for me, not sure if I broke something in my bB setup?

 

got the error :

 

old value: $f699  new value: $f69c
old value: $00c6  new value: $00c9
segment:  fffc                    vs current org: 10004
      2190 bytes of ROM space left
 
D:\Applications\2600Development\Projects\Examples\x6_1_5.bas.asm (2841): error: Origin Reverse-indexed.

Edited by Muddyfunster, Sun Sep 30, 2018 7:54 AM.


#27 bogax OFFLINE  

bogax

    Dragonstomper

  • 776 posts

Posted Sun Sep 30, 2018 8:01 AM

That's pretty cool.  It would have never occurred to me to try to do a minikernel in bB.  I'm not sure that example would be any easier to teach than the assembly equivalent, though.

 

Anyway, for purposes of my guide, one of my goals is to teach some assembly to experienced bB coders, which, as you seem to be saying, can be useful to bB programmers even if they primarily stick to bB.

 

I'm trying to think how to put this without sounding like I'm telling you how you should be doing it, 'cause I'm not.

 

You show some bB and then some equivalent assembly.  My off the top of my head, gut reaction is that that's a good way to do it.

 

The bB gives you something familiar to hang it (eg the assembly) on.

 

I was just pointing out that you could take that farther.

 

 

Now if it was me, I think I'd start with the bB  show the how and why of the assembly it produces, then

how it could be improved and how you might do things in assembly that aren't practical in bB

(I'm thinking specifically the bit of code that does the MOD 15 and timing in a loop as a good example).

 

But I'm not sure that that's better than just saying 'here, learn some assembly  it's not that hard'.  :)



#28 bogax OFFLINE  

bogax

    Dragonstomper

  • 776 posts

Posted Sun Sep 30, 2018 9:43 AM

 

 

 

This code example wouldn't compile for me, not sure if I broke something in my bB setup?

 

got the error :

 

old value: $f699  new value: $f69c
old value: $00c6  new value: $00c9
segment:  fffc                    vs current org: 10004
      2190 bytes of ROM space left
 
D:\Applications\2600Development\Projects\Examples\x6_1_5.bas.asm (2841): error: Origin Reverse-indexed.

 

 

Oops

Yes, I should have mentioned that.

 

Does it actually not compile?  Or does it compile and give you that warning?

 

I never really doped that out.

 

It seems to produce the correct code.

 

You get that if you assign 'minikernel' to the value of a label

 

I'm guessing that inserting a JSR to the minikernel (ie to the label) shifts the label

and that that gets fixed on a subsequent pass. 



#29 Muddyfunster OFFLINE  

Muddyfunster

    Chopper Commander

  • 110 posts

Posted Sun Sep 30, 2018 9:58 AM

I don't think it compiles, when I try to run the .bin, I just get a black screen.



#30 RevEng ONLINE  

RevEng

    River Patroller

  • 4,972 posts
  • Bitnik
  • Location:bottom of the stack

Posted Sun Sep 30, 2018 10:11 AM

It works for me - I get the report due to shifting rom - but the compiled rom works.

The values reported are slightly different for me. Are you using the latest bB? I forget at which release it happened, but the dasm included with the my bB has fixes specifically related to shifting ROM.

#31 Muddyfunster OFFLINE  

Muddyfunster

    Chopper Commander

  • 110 posts

Posted Sun Sep 30, 2018 11:06 AM

I'm using 1.1dreveng41



#32 RevEng ONLINE  

RevEng

    River Patroller

  • 4,972 posts
  • Bitnik
  • Location:bottom of the stack

Posted Sun Sep 30, 2018 11:25 AM

Moved the conversation to this thread. No point in cluttering up the guide thread with this.




0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users