how do you write to address 0xb000:0000 in memory? like say i did this
mov al, 'A' ; or mov al, 56
and say i wanted to move the contents of al to address 0xb000:0000 how would i do that?
Printable View
how do you write to address 0xb000:0000 in memory? like say i did this
mov al, 'A' ; or mov al, 56
and say i wanted to move the contents of al to address 0xb000:0000 how would i do that?
mov es b000h
xor bx bx ; on 16-bit
mov BYTE PTR [es:bx] al
I don't think you can move an immediate operand to a segment...
Well if i move 'A' into al first the compiler wont care if its and immediat because it's gonna have 65 in al anyways the same as if i pulled it out of memory at some random address. Either way it's a value being placed in memory. So it should work. Now i can not move an immediat directly to memory is that was you were refering to? because in that case you are right, i have to go though a register first.
You're right DW, you can't. I forgot.
Code:mov ax b000h
mov es ax
There's certain combinations of operands that do not work, deoblo1. One of them is immediate -> segment. There's a few more and any ASM book will tell you the limitations.Quote:
Well if i move 'A' into al first the compiler wont care if its and immediat because it's gonna have 65 in al anyways the same as if i pulled it out of memory at some random address. Either way it's a value being placed in memory. So it should work. Now i can not move an immediat directly to memory is that was you were refering to? because in that case you are right, i have to go though a register first.
I was going from memory i havent done anything in asm since this post, so im a bit rusty. Ill get back into the swing of things in a while. Thanks for the help though guys.