Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

ASM question

Posted on 1998-01-02
6
Medium Priority
?
381 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 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
NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

 
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

Learn Veeam advantages over legacy backup

Every day, more and more legacy backup customers switch to Veeam. Technologies designed for the client-server era cannot restore any IT service running in the hybrid cloud within seconds. Learn top Veeam advantages over legacy backup and get Veeam for the price of your renewal

Question has a verified solution.

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

Moving your enterprise fax infrastructure from in-house fax machines and servers to the cloud makes sense — from both an efficiency and productivity standpoint. But does migrating to a cloud fax solution mean you will no longer be able to send or re…
This paper addresses the security of Sennheiser DECT Contact Center and Office (CC&O) headsets. It describes the DECT security chain comprised of “Pairing”, “Per Call Authentication” and “Encryption”, which are all part of the standard DECT protocol.
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Screencast - Getting to Know the Pipeline

885 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