Ok, first off: does ANYONE here even know ASM???
If so, what the hell is wrong with this code:
.MODEL SMALL
.DATA
MyMessage dw "This is a message!$"
.CODE
START:
JMP BEGIN
BEGIN:
mov dx,OFFSET MyMessage
mov ax,SEG MyMessage
mov ds,ax
mov ah,9
int 21h
MOV ax,4c00h
INT 21h
END START
i''ve been trying to assemble it, but nothing,just a bunch of errors like:
ERROR: THIS IS A MESSAGE.ASM: String value too long! LINE: [5]
ERROR: THIS IS A MESSAGE.ASM: Expected end of line! LINE: [8]
ERROR: THIS IS A MESSAGE.ASM: Expected end of line! LINE: [14]
FATAL ERROR: Identifier does not exists "SEG"!
can someone PLEASE help me?!?! (yes, this looks noobish, yes, I''m desperate, comeone people, work with me! I WANT TO LEARN ASM, NOT JUST GET STUCK WITH ERRORS!)
my ASM is hell rusty
but shouldnt the message be db rather than dw? i would doubt DOS supports unicode strings
eg
but shouldnt the message be db rather than dw? i would doubt DOS supports unicode strings
eg
MyMessage db "This is a message!$"
right, a quick shifty at some old Uni source gave me this
Now, while all of that might not be needed it does show you how to clear a screen, print some text and how the assember i was using required the setup (was using TASM to compile).
btw, that code works, flawlessly, the whole project was i think the second best mark i got at Uni (clear over a first), 17K of pure handwritten assembler...ah, the good old days
thecode segment para public ''code'' assume cs:thecode, ds:thedata, ss:thestackstart: mov ax,thedata mov ds,ax ;set data segmentcls: mov ax,0003 ;clear screen int 10h ;80x25 charsheadin: mov dh,2 ;row mov dl,27 ;column mov bh,0 ;page mov ah,02 ;move int 10h ;cursor lea dx,head ;output heading mov ah,09 int 21hthecode endsthedata segment para public ''data''head db ''Video Recorder Program V2.52b $''thedata endsthestack segment para stack ''stack'' db 4096 dup(?)thestack ends end start
Now, while all of that might not be needed it does show you how to clear a screen, print some text and how the assember i was using required the setup (was using TASM to compile).
btw, that code works, flawlessly, the whole project was i think the second best mark i got at Uni (clear over a first), 17K of pure handwritten assembler...ah, the good old days
Thanks for the input, of course, the dw SHOULD be db, but my assembler still spits the same error for that, and thanks for the code there, i''ll have to take a better look at it later, i am being bitched at to get to supper lol (i''m 15, )
What assembler are you using? Nasm uses a different sintax than tasm and masm, just so you know.
Problem looks to be that your memory model is declared as small, try changing that
Cheers
Chris
Cheers
Chris
well, I''m using Blasm (barely known, nothing else worked properly, i couldn''t get Tasm or Masm, and this one has an ide (that wont assemble properly >:E )) so yeah. and thanx for more input, also, if anyone can tell me (I already know exactly how) how you think you can write e=mc^2 (squared, too lazy to find the ascii code) with normal color writing and dark blue ackgound, I''ll uhh..... program something small for you, lol
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement