Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

ASM question

Posted on 1998-01-02
6
356 Views
Last Modified: 2012-05-04
As a matter of fact, this is no real _hardware_ question, but since there is no Programming-ASM topic...
Could someone tell me why TASM doesnt accept "JMP FAR 80:0"?
It gives the error msg "Illegal direct" or something. What is the correct syntax?
0
Comment
Question by:edsko
  • 3
  • 3
6 Comments
 
LVL 32

Expert Comment

by:jhance
ID: 1122027
To do an unconditional far jmp you need:

JMP FAR PTR 80:0
0
 

Author Comment

by:edsko
ID: 1122028
Sorry, but when I use "JMP FAR PTR 80:0" TASM gives this error msg "Near jump or call do different CS". So, it doesn't work :-(
Could someone please tell me what the correct syntax is?
Else I have to use MS-DOS debug.exe you know (debug actually accepts JMP FAR 80:0 :-))
0
 
LVL 32

Accepted Solution

by:
jhance earned 200 total points
ID: 1122029
Turbo Assembler  Version 1.0        01-02-98 13:16:49         Page 1
TEST.ASM

      1                              ; TEST.ASM
      2 0000                                 .MODEL SMALL
      3 0000                                 STACK 200h
      4
      5 0000                                 .CODE
      6 0000                         START   PROC NEAR
      7 0000  B8 0000                        mov     ax, 0
      8 0003  90                             nop
      9 0004  90                             nop
     10 0005  EB F9                          jmp     far ptr 80:0
     11 0007                         START   ENDP
     12                              END
Turbo Assembler  Version 1.0        01-02-98 13:16:49         Page 2
Symbol Table


Symbol Name                       Type   Value

??DATE                            Text   "01-02-98"
??FILENAME                        Text   "TEST    "
??TIME                            Text   "13:16:49"
??VERSION                         Number 0100
@CODE                             Text   _TEXT
@CODESIZE                         Text   0
@CPU                              Text   0101H
@CURSEG                           Text   _TEXT
@DATA                             Text   DGROUP
@DATASIZE                         Text   0
@FILENAME                         Text   TEST
@WORDSIZE                         Text   2
START                             Near   _TEXT:0000

Groups & Segments                 Bit Size Align  Combine Class

DGROUP                            Group
  STACK                           16  0200 Para   Stack   STACK
  _DATA                           16  0000 Word   Public  DATA
_TEXT                             16  0007 Word   Public  CODE

0
Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

 
LVL 32

Expert Comment

by:jhance
ID: 1122030
Here's another variation that is probably better in the general case:

Turbo Assembler       Version 2.5          01/02/98 13:49:55          Page 1
test.asm



      1                             ; TEST.ASM
      2      0000                             .MODEL LARGE
      3                                   ;
      4      0000                       OSEG    SEGMENT AT      80H
      5                                   ORG 0h
      6      0000                       LOC80   LABEL   WORD
      7      0000                       OSEG    ENDS
      8                                   ;
      9                                   ;
     10      0000                             .CODE
     11                                   ASSUME ES:OSEG
     12      0000                       START   PROC FAR
     13      0000  B8 0000s                       mov     AX,OSEG
     14      0003  8E C0                       mov     ES,AX
     15      0005  26: FF 26      0000r                 jmp     LOC80
     16      000A                       START   ENDP
     17                             END
Turbo Assembler       Version 2.5          01/02/98 13:49:55          Page 2
Symbol Table




Symbol Name                    Type       Value

??DATE                          Text       "01/02/98"
??FILENAME                    Text       "test        "
??TIME                          Text       "13:49:55"
??VERSION                    Number 0205
@CODE                          Text       TEST_TEXT
@CODESIZE                    Text       1
@CPU                          Text       0101H
@CURSEG                          Text       TEST_TEXT
@DATA                          Text       DGROUP
@DATASIZE                    Text       1
@FILENAME                    Text       TEST
@MODEL                          Text       5
@WORDSIZE                    Text       2
LOC80                          Word       OSEG:0000
START                          Far       TEST_TEXT:0000

Groups & Segments              Bit Size Align  Combine Class

DGROUP                          Group
  _DATA                          16  0000 Word        Public  DATA
OSEG                          16  0000  AT 0080
TEST_TEXT                    16  000A Word        Public  CODE




Or even this:

Turbo Assembler       Version 2.5          01/02/98 13:52:56          Page 1
test.asm



      1                             ; TEST.ASM
      2      0000                             .MODEL LARGE
      3                                   ;
      4                                   ;
      5      0000                             .CODE
      6      0000                       START   PROC FAR
      7      0000  B8 0080                       mov     AX,80H
      8      0003  8E C0                       mov     ES,AX
      9      0005  26: FF 26      0000                 jmp     ES:0
     10      000A                       START   ENDP
     11                             END
Turbo Assembler       Version 2.5          01/02/98 13:52:56          Page 2
Symbol Table




Symbol Name                    Type       Value

??DATE                          Text       "01/02/98"
??FILENAME                    Text       "test        "
??TIME                          Text       "13:52:56"
??VERSION                    Number 0205
@CODE                          Text       TEST_TEXT
@CODESIZE                    Text       1
@CPU                          Text       0101H
@CURSEG                          Text       TEST_TEXT
@DATA                          Text       DGROUP
@DATASIZE                    Text       1
@FILENAME                    Text       TEST
@MODEL                          Text       5
@WORDSIZE                    Text       2
START                          Far       TEST_TEXT:0000

Groups & Segments              Bit Size Align  Combine Class

DGROUP                          Group
  _DATA                          16  0000 Word        Public  DATA
TEST_TEXT                    16  000A Word        Public  CODE
0
 

Author Comment

by:edsko
ID: 1122031
Ok, of course you can use the machinelanguage opcodes. But isn't there any possible way to do this without that? Something like this (I use TASM 4.0):

MODEL TINY
P386

CSEG SEGMENT USE16
ASSUME CS:CSEG

JMP FAR 80:0

CSEG ENDS

END



0
 

Author Comment

by:edsko
ID: 1122032
Ok, of course you can use the machinelanguage opcodes. But isn't there any possible way to do this without that? Something like this (I use TASM 4.0):

MODEL TINY
P386

CSEG SEGMENT USE16
ASSUME CS:CSEG

JMP FAR 80:0

CSEG ENDS

END



0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
Monitor input from a computer is usually nothing special.  In this instance it prevented anyone from using the computer.  This was a preconfiguration that didn't work.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question