Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

ASM question

Posted on 1998-01-02
6
Medium Priority
?
377 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
[X]
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
  • 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 400 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
10 Questions to Ask when Buying Backup Software

Choosing the right backup solution for your organization can be a daunting task. To make the selection process easier, ask solution providers these 10 key questions.

 
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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

I use more than 1 computer in my office for various reasons. Multiple keyboards and mice take up more than just extra space, they make working a little more complicated. Using one mouse and keyboard for all of my computers makes life easier. This co…
This article outlines why you need to choose a backup solution that protects your entire environment – including your VMware ESXi and Microsoft Hyper-V virtualization hosts – not just your virtual machines.
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

670 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