Solved

ASM question

Posted on 1998-01-02
6
360 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 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
Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

 
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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Adobe Premier GPU Issues 6 65
scroll through a movie with a trackball mouse 5 47
Laptop models need quick answer 24 37
USA Brother MFC suitable for UK countries? 2 41
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.
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.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

749 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