v902
September 2nd, 2003, 22:19
In my futile attempts at learning ASM I have been of course messing with the obligatory "Hello World" And I was erading some FAQs' files and this file was on one of the sites (I wish I wrote it :D):
[code:1:1bfb48ffc6] org 100h
mov dx,msg
mov ah,9
int 21h
mov ah,4Ch
int 21h
msg db 'Hello, World!',0Dh,0Ah,'$'
[/code:1:1bfb48ffc6]
And it works... So I wanted to remvoe "0Dh,0Ah" (I believe it's the UNICODE in hex for \r and \n, not sure... But I believe) and put it in "break" So just to check that I didn't break anything I did:
[code:1:1bfb48ffc6] org 100h
mov dx,msg
mov ah,9
int 21h
mov ah,4Ch
int 21h
msg db 'Hello, World!',0Dh,0Ah,'$'
break db 0Dh,0Ah
[/code:1:1bfb48ffc6]
So it was still working so I tried moving break instead of "0Dh,0Ah" in msg... Well that didn't compile :) I got the following:
C:\>nasm hi.asm -o hi.exe
hi.asm:7: error: one-byte relocation attempted
I have no idea why this is happening as theoretically break should just load into msg, but I'm not ASM expert :) I also tried putting break in front of msg and it still didn't work... Anyone got any ideas why this wouldn't be working on Win2k with NASM 0.98.37? I amlso using nasm.exe (16-bit) since I'm not doing anything 32-bit yet and I'm lazy :) Thanks for reading...
EDIT: BTW line 7 is msg not break... FYI...
[code:1:1bfb48ffc6] org 100h
mov dx,msg
mov ah,9
int 21h
mov ah,4Ch
int 21h
msg db 'Hello, World!',0Dh,0Ah,'$'
[/code:1:1bfb48ffc6]
And it works... So I wanted to remvoe "0Dh,0Ah" (I believe it's the UNICODE in hex for \r and \n, not sure... But I believe) and put it in "break" So just to check that I didn't break anything I did:
[code:1:1bfb48ffc6] org 100h
mov dx,msg
mov ah,9
int 21h
mov ah,4Ch
int 21h
msg db 'Hello, World!',0Dh,0Ah,'$'
break db 0Dh,0Ah
[/code:1:1bfb48ffc6]
So it was still working so I tried moving break instead of "0Dh,0Ah" in msg... Well that didn't compile :) I got the following:
C:\>nasm hi.asm -o hi.exe
hi.asm:7: error: one-byte relocation attempted
I have no idea why this is happening as theoretically break should just load into msg, but I'm not ASM expert :) I also tried putting break in front of msg and it still didn't work... Anyone got any ideas why this wouldn't be working on Win2k with NASM 0.98.37? I amlso using nasm.exe (16-bit) since I'm not doing anything 32-bit yet and I'm lazy :) Thanks for reading...
EDIT: BTW line 7 is msg not break... FYI...