Overclock.net banner

1 - 2 of 2 Posts

·
Registered
Joined
·
286 Posts
Discussion Starter #1
I have the following code:

Quote:


ORG $2000 ;starting address is @ $2000
;loading data to the memory
LDD #$0011 ;load constant $0011 to Reg A:B
STAA $1500 ;[$1500] = $00
STAB $1501 ;[$1501] = $11
LDD #$2233 ;load constant $2233 to Reg A:B
STAA $1502 ;[$1502] = $22
STAB $1503 ;[$1503] = $33
LDD #$4455 ;load constant $4455 to Reg A:B
STAA $1504 ;[$1504] = $44
STAB $1505 ;[$1505] = $55
LDD #$6677 ;load constant $6677 to Reg A:B
STAA $1506 ;[$1506] = $66
STAB $1507 ;[$1507] = $77
LDD #$8899 ;load constant $8899 to Reg A:B
STAA $1508 ;[$1508] = $88
STAB $1509 ;[$1509] = $99
LDD #$AABB ;load constant $AABB to Reg A:B
STAA $150A ;[$150A] = $AA
STAB $150B ;[$150B] = $BB
LDD #$CCDD ;load constant $CCDD to Reg A:B
STAA $150C ;[$150C] = $CC
STAB $150D ;[$150D] = $DD
LDD #$EEFF ;load constant $EEFF to Reg A:B
STAA $150E ;[$150E] = $EE
STAB $150F ;[$150F] = $FF
;5-bit Constant Offset Indexed Addressing (offset is between -16 ~ +15)
LDX #$1509
LDAA 5,X
LDAB -8,X
;9-bit Constant Offset Indexed Addressing (offset is between -256 ~ +255)
LDY #$1590
LDAA -140,Y
LDY #$1490
LDAB $76,Y
;16-bit Constant Offset Indexed Addressing
LDX #$1000
LDAA $50F,X
LDY #$2000
LDAB -$AF6,Y
;16-bit Constant Indirect Indexed Addressing
Texas A&M University-Kingsville, Electrical Engineering & Computer Science Department 3
LDD #$1505
STAA $1515 ;[$1515] = $15
STAB $1516 ;[$1516] = $05
LDX #$152D
LDAA [-$18,X] ;$152D - $18 = $1515
;note: [$1505] = $55
LDD #$1508
STAA $1545 ;[$1545] = $15
STAB $1546 ;[$1546] = $08
LDX #$152D
LDAB [$18,X] ;$152D + $18 = $1545
;note [$1508] = $88
STOP
END

It then says: "Modify the offset for each indexed addressing and verify and record two offsets for each type of the indexed addressing."

I just dont know exactly what to do or input into my program.

Any help would be greatly appreciated. Thanks.
 

·
Registered
Joined
·
4,409 Posts
I'll see if i still have my assembly software at home and if i cant check it out tonight for you. Hopefully someone else knows assembly and sees this before then, because I can do it, but im not the best.
 
1 - 2 of 2 Posts
Top