0 Replies - 460 Views - Last Post: 02 September 2011 - 05:36 AM

#1 victor1412  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 02-September 11

how to replace vue >100 and <-100 by 100 n -100 in the array

Posted 02 September 2011 - 05:36 AM

bra start
dataArray .byte 10,80,100,120,130,90,60,30,50,-80,-110,-120,30,0
y .byte 100
z .byte -100
start ldx #dataArray
myLoop ldaa 0,x
tsta
bmi minus
beq stop
ldab y
sba
tsta
bmi notReplace
beq notReplace
clra
ldaa y
inx

// the value <100

bra myLoop
notReplace inx
bra myLoop

//the negative value

minus ldab z
sba
tsta
bmi final
inx
bra myLoop

//the value <-100

final clra
ldaa z
inx
bra myLoop
stop .end

i try to replace the values in the array but when i store these value just store in another memory .

if you could just only show me how to replace a value in the array . for example i want to replace the negative number in the array . How can do that. thanks

Is This A Good Question/Topic? 0
  • +

Page 1 of 1