-1

I'm learning 16-Bit DOS Assembly. I'm trying to make an program that reads from STDIN and writes it to STDOUT. Everything is nice but I don't know how to move AL to address 015B(debug program address).

Michael Petch
  • 43,801
  • 8
  • 98
  • 174
cookie
  • 137
  • 2
  • 6
  • 1
    If you are using MASM(or TASM) maybe you are looking for `mov byte ptr [015bh], al`. That of course assumes that 015bh is relative to the _DS_. – Michael Petch Jan 27 '16 at 14:32
  • I'm using DOS debug command. – cookie Jan 27 '16 at 14:35
  • 3
    *I'm learning 16-Bit DOS Assembly.* This is your first problem. Don't waste your time with 16bit unless you have to. See http://stackoverflow.com/questions/34748733/drawing-a-character-in-vga-memory-with-gnu-c-inline-assembly for why I think so, and for alternative suggestions. (ignore the parts about that question's GNU C inline asm :P) – Peter Cordes Jan 27 '16 at 14:38
  • 2
    DOS debug then would be `mov [015b], al` assuming the address is relative to the current _DS_ segment. – Michael Petch Jan 27 '16 at 14:40

1 Answers1

-2

Quite simply you cannot. AL is an 8-bit register. That means, it can only store 2-digit hexadecimal numbers. You would have to use some 16-bit register like AX for that. Why do you ask?

FlatAssembler
  • 607
  • 6
  • 25
  • He's looking to move a single byte (in _AL_) to a memory address. That is allowed. – Michael Petch Nov 07 '17 at 21:12
  • I think you misread the question. They want to *store* AL to memory, not put the address *into* AL. e.g. `mov [015b], al ` (Apparently `debug.exe` requires you to omit the trailing `h` for hex constants.) – Peter Cordes Nov 07 '17 at 21:13