flat assembler
Message board for the users of flat assembler.
Index
> DOS > string question |
Author |
|
Giedrius 11 Apr 2005, 15:48
hello is address, [hello] is the character that hello address contain. [hello]='H', [hello+1]='e' etc...
_________________ Better to rule in hell, than to be a slave in heaven... |
|||
11 Apr 2005, 15:48 |
|
Torrey 12 Apr 2005, 08:32
"mov dx,hello" puts a memory pointer to the hello world string into the DX register. When you do mov's it doesn't always move memory addresses, it depends on how you use the command, below are examples.
Code: ;moving a value into a register some_value dw 0xBEEF mov dx,[some_value] ;Moving two bytes into a register. ;This would move "He" from your ;hello world string into DX. mov dx,word [hello] etc... |
|||
12 Apr 2005, 08:32 |
|
vid 12 Apr 2005, 11:33
check my tutorial it's nicely explained there. Somewhat lot to read but you can be sure you understand it.
|
|||
12 Apr 2005, 11:33 |
|
Bitdog 21 Apr 2005, 07:33
yes & no, yes
MOV DX,HELLO ;move offset adr of HELLO to DX reg SEG:OFF = SEGMENT:OFFSET address=adr is the full adr required to address memory for read/write, but in ASM the DS seg reg is default so the adr of HELLO is held in DS:DX after your MOV DX,HELLO but DS is not updated by the MOV, so you have to set DS to your data segment where the HELLO data is located before the INT 21h instruction. In a .COM file DS=CS at startup in an .EXE file, data seg is not= to CS=Code Segment = text (You need a JMP OVERhello to get IP=Instruction Pointer over the HELLO data during "run time" = program execution.) There might be some stuff that interests you in this ENV thingie, http://bitdog.home.att.net/files/fasmenv.zip unzips to path and creates an environment/dir-tree. |
|||
21 Apr 2005, 07:33 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.