Author Topic: Is this indirect addressing?  (Read 5036 times)

Offline maplesirop

  • Jr. Member
  • *
  • Posts: 60
Is this indirect addressing?
« on: April 16, 2013, 03:33:17 AM »
Add X

MAR <- X
MBR <- M[MAR]
AC <- MBR

I read that this is direct addressing, but we are passing the value X into MAR, which is used as an index to the memory.

AddI X

MAR <- X
MBR <- M[MAR]
MAR <- MBR
MBR <- M[MAR]
AC <- AC + MBR

In this case the address (or index) is used to contain the address that contains the value.

Offline Frank Kotler

  • NASM Developer
  • Hero Member
  • *****
  • Posts: 2667
  • Country: us
Re: Is this indirect addressing?
« Reply #1 on: April 17, 2013, 07:39:39 PM »
I'm not sure I understand your notation, Maplesirop. "<" implies a "mov", not "less than", right? And I'll bet "MBR" doesn't mean "Master Boot Record", either...

Are you trying to do something like...
Code: [Select]
string1 db "hello world", 0
string2 db "goodbye world", 0
stringptr dd string1
...
...
; if command is "quit"
mov dword [stringptr], string2

Or... ?

Best,
Frank


Offline maplesirop

  • Jr. Member
  • *
  • Posts: 60
Re: Is this indirect addressing?
« Reply #2 on: April 18, 2013, 09:07:45 PM »
Thanks for replying,

MBR = memory buffer address

<- direction of data