home.social

#0f — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #0f, aggregated by home.social.

  1. @vanja in noodle, there's routines to convert a string to a byte too, if you don't need a short:
    git.sr.ht/~rabbits/noodle/tree

    @sbyte ( str* -- byte ) LDAk ,chex JSR #40 SFT STH INC2 LDA ,chex JSR STHr ADD JMP2r
    @chex ( c -- val|ff ) LIT "0 SUB DUP #09 GTH JMP JMP2r #27 SUB DUP #0f GTH JMP JMP2r POP #ff JMP2r

    In Adelie there's a nice one too:
    git.sr.ht/~rabbits/adelie/tree

  2. @jameschip When you would normally use MOD ( DIVk MUL SUB ) you can sometimes use AND with the boundary-1:

    #01 AND -> 2 MOD
    #03 AND -> 4 MOD
    #07 AND -> 8 MOD
    #0f AND -> 16 MOD
    #1f AND -> 32 MOD

    etc..

    It's a good trick

  3. @neauoire If varvara.html just said something like "Port memories are not visible in main memory. `#0f LDZ` and `#0f DEI` are not equivalent." I think that'd do it. Now that I understand I'm seeing a couple hints I ignored because of false assumptions.

    #0f
  4. @neauoire Yes. In the real computing hardware I'm familiar with it is extremely common to map hardware registers/device memories into the "main" memory. The double meaning of #0f as both 'the halt port' and 'a word in the zero page' was extremely confusing as a result, especially when the TAL examples all write the System struct at #00 which sorta implies it has a memory layout as other structs would.

    #0f