Re: [stella] help with: move this

Subject: Re: [stella] help with: move this
From: "Glenn Saunders" <cybpunks@xxxxxxxxxxx>
Date: Mon, 05 Nov 2001 13:49:43 -0800
LDX $08 ; <= I GET A SYNTAX ERROR HERE!!!

You need to learn the different addressing modes. I had a similar problem when I started out. What you are trying to do is load X immediate and what you are doing is loading X abolute-zeropage. I don't know why you'd get a DASM syntax error per se, but your program won't run the way you think it should. Immediate in DASM has to be specified with the # symbol.

LDX #$08

What is confusing, perhaps, is thinking that # means hex. It does in HTML, but it doesn't here.

Number formats in DASM are decimal by default (no preceding symbol), $ hex, and % binary.

; LOAD THE NUMBER 8 (immediate)
LDX #8 <- decimal, confusing to me because of my HTML background.
LDX #$08 <- hexadecimal
LDX #%00001000 <- binary

; LOAD THE CONTENTS OF MEMORY ADDRESS 8 (absolute, zero page)
LDX 8 <- decimal
LDX $08 <- hexadecimal
LDX %00001000 <- binary

; LOAD THE CONTENTS OF MEMORY ADDRESS 8 (absolute)
LDX.w 8 <- DASM forced word, decimal
LDX.w $08 <- DASM forced word, hexadecimal
LDX.w %00001000 <- DASM forced word, binary
LDX $0008 <- standard hexadecimal notation



_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp

----------------------------------------------------------------------------------------------
Archives (includes files) at http://www.biglist.com/lists/stella/archives/
Unsub & more at http://www.biglist.com/lists/stella/


Current Thread