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...

soup4you2
September 2nd, 2003, 22:37
Wow... your way over my head on this one... i could ask our head programmer tomarrow though he learned ASM waaay back in the day... he used to write ASM for cray systems..

v902
September 2nd, 2003, 22:46
Don't worry soup, if I knew wtf I was doing too I wouldn't be having trouble with Hello World! programs :lol: My parents forgot ASM like... 20 years ago :) I also tried doing

[code:1:0fe5d7088f]msg db 'Work you POS',[break],'$'[/code:1:0fe5d7088f]

I get:

C:\>nasm hi.asm -o hi.exe
hi.asm:7: error: expression syntax error w00t... Wait... It still doesn't compile :)

v902
September 11th, 2003, 21:07
I posted on clax86(comp.lang.asm.x86) and I've already gotten some replies to several questions... You can follow it at:
http://groups.google.com/groups?dq=&hl=en&lr=&ie=UTF-8&threadm=hgf1mvclpdsk5i11hlcg6pibgkkfb724j2%404ax.c om&prev=/groups%3Fhl%3Den%26lr%3D%26ie%3DUTF-8%26group%3Dcomp.lang.asm.x86

But it'll probably be a bit slow for you since google groups is not updated that often (8 hours I believe)