Results 1 to 3 of 3

Thread: TASM Error

  1. #1

    Thread Starter
    Hyperactive Member made_of_asp's Avatar
    Join Date
    Jul 2001
    Location
    123 Fake Street
    Posts
    394

    TASM Error

    Hi

    I am learning and i am getting an "Illegal Instruction Error" from TASM compiler. What does it mean?


    Code:
    text 	segment
    assume	CS:text,DS:data
    
    VirtualReplace proc ptrString ;pass parameters
    	;looping...
    	mov SI,0
    	mov CX,2
    
    scroll: ;we are scrolling
    	inc SI ;increase counter...
    	mov ptrString[SI], 30	
    	loop scroll	   
    endp
    
    begin:
       mov AX,data ;create data segment
       mov DS,AX   ;move AX to DX
       ;This is where the error happends
       VirtualReplace ptr offset hello
       mov AH,09h  ;screen output
       lea DX,hello ;move output
       int 21h     ;call dos
       mov AH,4Ch  ;finished!
       mov AL,0    ;code 0 - success
       int 21h     ;call dos
    text   ends
    data	segment
    symbols db 233 dup('*')
    crlf      db 10,13,'$'
    hello   db 'hi!$'
    data	ends
    stk	segment stack
    	db 256 dup (0)
    stk ends
    	end	begin
    VS.NET 2003

    Need to email me?

  2. #2
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    Can you call a function this way in TASM?
    Usually you push the arguments on the stack, then do a 'call'.
    MASM has the 'Invoke' high command to make things a little easier.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  3. #3

    Thread Starter
    Hyperactive Member made_of_asp's Avatar
    Join Date
    Jul 2001
    Location
    123 Fake Street
    Posts
    394
    Thanks for your reply

    You can call macro's this way, i dont know abut functions.
    I'l try the push method
    VS.NET 2003

    Need to email me?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width