Giter Site home page Giter Site logo

Comments (3)

PSLLSP avatar PSLLSP commented on August 29, 2024

OK, maybe there is other problem, The original code is

LDX #$01
LDA #$05
STA $01
LDA #$06
STA $02
LDY #$0a
STY $0605
LDA ($00,X)

There is instruction "STY $0605" in the list, it modifies the code at address $0605, 'STA $01' is replaced with 'STA $0a'; that explains the mystery. Not good example, it is confusing...

from easy6502.

PSLLSP avatar PSLLSP commented on August 29, 2024

This is better example; it doesn't modify code, but it writes data to display memory, so it is visible.

LDA #$0a
STA $0306

LDX #$01
LDA #$06
STA $01
LDA #$03
STA $02
LDA ($00,X)

I miss in the tutorial explanation of memory mapping of this "computer". It should be at the beginning of the tutorial, something like this.

$0000-$00ff: RAM, zero page
$00fe-$00fe: RAM, RND generator  ?? sysRandom
$00ff-$00ff: RAM, KEYBOARD input, ASCII code  ??  sysLastKey
$0100-$01ff: RAM, STACK
$0200-$05ff: RAM, video; 32x32 points; colors $00-$0f
$0600-$ffff: RAM, program; reset sets PC register to $0600.

Other important information is that this asembler is case senstive, so LOOP1 and loop1 are two different labels; when label is not defined, it is not an error but default value $ffff is used.

define agent $07

loop1:
  LDA agent
  LDX Agent
  JMP loop1
  JMP LOOP1
Address  Hexdump   Dissassembly
-------------------------------
$0600    a5 07     LDA $07
$0602    ae ff ff  LDX $ffff
$0605    4c 00 06  JMP $0600
$0608    4c ff ff  JMP $ffff

from easy6502.

BigEd avatar BigEd commented on August 29, 2024

Thanks for the feedback.

That use of self-modifying code in the tutorial for indexed indirect is somewhat unexpected and not ideal. I agree that we should update the example and commentary - I'd suggest we don't index from $00 either, as that is not helping explain the effect:

LDA #$0a
STA $0306

LDX #$02
LDA #$06
STA $42
LDA #$03
STA $43
LDA ($40,X)

This mode is rarely used: the meaning is that there is an array of pointers in zero page, and we need to select our pointer using X and then use it. The commentary should say this.

You're right that case-sensitive labels could be noted somewhere. Perhaps in the messages window, when it writes 'Indexing labels ...' it could say 'Indexing labels (case-sensitive) ...'

(I'm reluctant to change it to be insensitive in case anyone already has made use of it as-is.)

There is the Notes button, to the right of Disassemble, which puts up some notes. Perhaps those notes could be placed in the messages window by default, and could include some extra info:

  • the WDM opcode for console output
  • the initial PC value of $0600
  • the case-sensitivity of labels

Maybe it would be worth listing undefined labels too, at the end of assembly

from easy6502.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.