8000 at-xy · Issue #438 · jkotlinski/durexforth · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
at-xy #438
Open
Open
at-xy#438
@lonetech

Description

@lonetech

I didn't see where in the library at-xy was, so I cobbled one together using kernal plot:

: at-xy xr c! yr c! 0 sr c! $fff0 sys ;

Do you think it might be worth including somewhere?

It doesn't preserve interrupt disable, which might be something to improve. In assembly it would use CLC.

The routine itself would be grouped with page and emit, so I guess the norm here is assembly routines in io.asm.
I did the exercise to convert to code:

code at-xy ( x y -- )
  clc,
  w stx,
  \ w 1+ sty,
  lsb 1+ ldy,x
  lsb lda,x  \ had no ldx,x
  tax,
  $fff0 jsr,
  w ldx,
  \ w 1+ ldy,
  inx,
  inx,
;code

That also worked. It's rather cumbersome code, though, mostly dealing with ABI conversion. Still size reports the code version as smaller than the sys version.

Evidently, I am a total newbie at 6502 assembly.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0