Skip to main content
gamedev.net
🔒 Locked

ASM crap

Started by bobbias Nov 26, 2003 at 5:05 PM 6 replies 950+ views
Original Post
bobbias
bobbias
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!)
Narcist
Narcist
my ASM is hell rusty

but shouldnt the message be db rather than dw? i would doubt DOS supports unicode strings

eg

MyMessage db "This is a message!$"
_the_phantom_
_the_phantom_
right, a quick shifty at some old Uni source gave me this


thecode segment para public ''code''
assume cs:thecode, ds:thedata, ss:thestack
start: mov ax,thedata
mov ds,ax ;set data segment
cls: mov ax,0003 ;clear screen
int 10h ;80x25 chars
headin: 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 21h
thecode ends
thedata segment para public ''data''
head db ''Video Recorder Program V2.52b $''
thedata ends
thestack 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
bobbias
bobbias
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, )
brassfish89
brassfish89
What assembler are you using? Nasm uses a different sintax than tasm and masm, just so you know.
chollida1
chollida1
Problem looks to be that your memory model is declared as small, try changing that

Cheers
Chris
CheersChris
bobbias
bobbias
blarg, damn anonymous, that WAS me btw
oh yes, and you have to use the dos DEBUG (it's the consol window your editing)

[edited by - bobbias on November 26, 2003 9:00:26 PM]

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.