Solved

ASM question

Posted on 1998-01-02
6
339 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
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

We recently endured a series of broadcast storms that caused our ISP to shut us down for brief periods of time. After going through a multitude of tests, we determined that the issue was related to Intel NIC drivers on some new HP desktop computers …
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…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

707 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now