phat code Duct Tape is like the Force: It has a light side, a dark side, and it holds the universe together.
Main

Projects

Downloads

Articles

Links

Forum

 

View Message

Back to Messages
Peter Swinkels Fri Jan 17 2025 at 4:06 pm
This QBasic program does run CALL ABSOLUTE correctly->
 
 
DEFINT A-Z

DIM AsmByte AS INTEGER
DIM AsmProg AS STRING

 CLS
 RESTORE AsmBytes
 AsmProg = ""
 DO
  READ AsmByte
  IF AsmByte = -1 THEN EXIT DO
  AsmProg = AsmProg + CHR$(AsmByte)
 LOOP

 DEF SEG = VARSEG(AsmProg)
 CALL ABSOLUTE(X%, SADD(AsmProg))

 CoProcessor = X% AND &H2
 IF CoProcessor = 2 THEN
  PRINT "Math coprocessor present."
 ELSE
  PRINT "No math coprocessor."
 END IF
END

AsmBytes:
DATA &H55              : 'PUSH BP        Save base pointer.
DATA &H8B, &HEC        : 'MOV  BP,SP     Get our own.
DATA &HCD, &H11        : 'INT  11H       Make the ROM-BIOS call.
DATA &H8B, &H5E, &H06  : 'MOV  BX,[BP+6] Get argument address.
DATA &H89, &H07        : 'MOV  [BX],AX   Save list in argument.
DATA &H5D              : 'POP  BP        Restore base pointer.
DATA &HCA, &H02, &H00  : 'RET  2         Pop argument off stack and make far return.
DATA -1
 
 
 
 

Reply to this Message

Name
Subject
Message

No HTML is allowed, except for <code> <b> <i> <u> in the message only.
All URLs and email addresses will automatically be converted to hyperlinks.