Email or username:

Password:

Forgot your password?
Devine Lu Linvega

Reading the december adventure feed, nearly halfway into the month, you'd expect people to have started to play with stuff, but the feed reads like most are lost in the weeds of setting their servers or environment and whatnot so they can finally begin. For a chillout event, it looks exhausting af

10 comments
Eamon

@neauoire I am in this post and I don't like it.

Devine Lu Linvega

@eamon I saw you had some questions about relative and absolute addressing, can I help?

Eamon

@neauoire haha ok real quick. So far I've only used absolute addressing because I find it the most intuitive. Is the primary advantage of relative addressing is that it uses less memory (storing addresses as bytes instead of shorts)? Is there another reason to prefer it? Also, do I need to do anything special when I'm labeling an address to use relative addressing? Or can I make a relative jump (or load) as long as it's within 127 bytes and the assembler will take care of it for me?

Devine Lu Linvega

@eamon The primary advantage is that's it takes less memory and is faster, especially when used in datastructures. If you're using the STR/LDR opcodes, you need to use the comma rune. If you use JCI(?)/JMI(!)/JSI opcodes, the assembler will handle that for you.
wiki.xxiivv.com/site/uxntal_re

Eamon

@neauoire awesome, thank you! So if I label my function (or data structure) the normal way:
`@draw-character ( char -- )`

I can jump to it from any address within 127 bytes using any of the following, and they all work pretty much the same?
;draw-character JSR2 ( absolute call )
,draw-character JSR ( relative call )
draw-character ( relative immediate call )

(I was going to test this tonight.)

@neauoire awesome, thank you! So if I label my function (or data structure) the normal way:
`@draw-character ( char -- )`

I can jump to it from any address within 127 bytes using any of the following, and they all work pretty much the same?
;draw-character JSR2 ( absolute call )
,draw-character JSR ( relative call )
draw-character ( relative immediate call )

Devine Lu Linvega

@eamon Yep, exactly. Unless you need to do pointer arithmetic(like get the routine address dynamically) you should always use immediate calls. In this case, I wouldn't manually choose to JSR to it, I'd use a relative immediate call.

Devine Lu Linvega

@eamon JSR/JMP/JCN opcodes are so you can run routines from a pointer, but in normal times, you should almost never use those. Left has a single JSR2 opcode for example:
git.sr.ht/~rabbits/left/tree/m

Eamon

@neauoire ahhh this clears up a lot. Thank you!

DELETED

@neauoire i'm not even officially participating but my goal is to migrate to plan 9. i learn one new thing and break about 6 more in the process...

Go Up