Hot answers tagged

68

TL;DR; Using INT comes not only natural due the way the 8086 is designed, but was as well intended by Intel as OS entry point, much like a Supervisor Call (SVC) on /360 type mainframes: (Excerpt from the October 1979 Intel 8086 Family User's Manual page 2-28.) Software-initiated interrupt procedures may be used as service routines ("supervisor calls&...


37

[Preface: This is neither about discussing programming tricks nor how some changes could squeeze out a byte or two. Code can often be optimized by narrowing down the environment. The examples are meant rather for a generic estimation. ] The question has already been asked in ways of 6502 vs. Z80 and PNDC provided a good answer pointing out that real code ...


20

It seems the diagrams are not accurate. I wrote a test program that traces INT1 invocations (and delays execution during INT1 to increase the chance of getting hit by timer interrupts) while executing the following machine language fragment: pushf mov ax, 300h ; 100h = TF; 200h = IF push ax popf ; This instruction sets the trace flag mov ...


14

As I mentioned in my comment, IBM's BIOS also used interrupts for service dispatch when it could have easily chosen a well-known address as a ROM entry point (such as how a soft reset was programmatically available by jumping to FFFF:0000). I'm speculating, but Microsoft might have been following IBM's lead. Also, triggering an interrupt only takes two ...


13

There are 386 real-mode emulators for 286s, such as Eko Priono’s EMU386; but they relied on one important feature which 8086s don’t have, the invalid instruction exception. Whenever a 286 attempts to run an invalid instruction, it traps, and a handler can be put in place to emulate the instruction (if it really is a “missing” instruction from a later ...


13

It's possible to write bloated code for any CPU. Reportedly one of the candidate operating systems for the Acorn Archimedes was dropped because it couldn't run sixteen simple tasks in 4MB RAM without swapping, while "Arthur" (which became RiscOS) was demonstrated to be able to do it in 256KB. With RAM prices at the time, that was a huge advantage. One ...


13

Where would this 'jump table' live? As I understand it, the use of a pure trap-based mechanism for calling system services removes the need for user programs to have knowledge of supervisor program layout. For the latter case, either (a) the table is at a well-known address that will never change, or (b) you need linker technology to include a system ...


11

[Ok, I did dig out the manual, now improved with details about the hardware part of the communication protocol] Or was it more complicated than this? No, it was completely different. The 8089 did not use any opcodes - at least not any within the 8086's instruction stream. The 8087 is an extension to the CPU, while the 8089 is a separate CPU with its own ...


10

Nobody thought MS-DOS would be a long-lived system when it was created. Microsoft were quite clear that Xenix was going to be the future. It just didn't turn out that way, because the vast sales of the IBM PC and compatibles caused the development of a lot of popular software. Using software interrupts with an operation code is very much like using a jump ...


9

The physical address in the IVT associated with INT31H should be: 13H * 4H = 4CH True But a book I was referring to says that [...] According to them, Physical Address of INT13H is 34H ( 13*4 = 52 ) Not true, but read close: But the point is the number system used in the given solution. They use int 13, i.e. 13 decimal, not int 13h. So 13 * 4 -> 52 -&...


9

The interrupt system really is just a fancy jump table... Already has allocated space that can't be used for anything else. Adding a regular jump table would have been a waste of memory at that time. Back then there was no Protected mode to worry about, never mind what its requirements would be...


9

one point discussed is code density of 8 vs. 16 bit CPUs. At least Sun Microsystems recommended to write 32-bit applications for 64-bit versions of Solaris unless 64-bit integer operations are used and/or there is the need of more than 4 GiB of memory. However, the reason was the data size (each pointer variable requires 8 instead of 4 bytes), not the code ...


8

Have you ever thought of changing the 8088 in your PC to a NEC V20 (uPD70108)? The V20 is basically a 80186/286 EU with an 8088 BU. This offers all the 'new' real mode instructions (*1) you need, while still being pin-compatible with the 8088. And in addition you'll get some 30% sped up as well - quite handy, isn't it? Using a V20 would remove all need to ...


6

I am sure some one had that idea before me, As always :) Does anyone know of an implementation of that idea, so I don't have to implement it myself? Nop. Sorry. You may have to go ahead with your debug idea, catching them using Int3. Still, it wouldn't be anywhere near acceptable speed as Int/Ret already eats up 72+44=116 cycles - a table look up (...


5

Yes, there were other co-processors for the IBM PC computer other then Intel 8087 NPU/FPU Units. Many of them had additional circuity with some RAM and a ROM chips. The ROM chips on some of them contained an FPU emulation program if it was using a standard microprocessor other than a Intel model. Others had a BIOS extension for the system. Some older issues ...


5

Yes it is possible to have an IDE controller on a 8087 NPU (FPU) coprocessor socket. Most of these adapters had a circuit to switch in a BIOS and RAM cache Overlay when the IDE controller logic required it. .. Another example of this would be any expansion card that used the Dec. Rainbow 100 computers memory expansion card slot for peripherals. The card ...


4

interlink its part of MS-DOS and was easy to use simply by adding a line into config sys devicehigh=e:\rescue\dos98\interlnk.exe and then running interlnk.exe or intersvr.exe however RS232 is slow just ~115200/11=~10.2 KByte/s which is slower than floppy... laplink this was the interlink's LPT counterpart (can use either COM or LPT) FX this one is ...


4

To adjust a value, one needs to know how many carries there were out of each decimal digit. When adding two 8-bit numbers, there can be at most one carry out of each 4-bit chunk, which will fit in two flags which are devoted to that purpose. Multiplication of two decimal digits, however, may yield up to eight carries--far too many to fit into two one-bit ...


3

One advantage of using interrupts is that in a system that uses segmented memory you don't need to change the current page to the one with the jump table, or to allocate part of the 64k available to standard DOS programs to said table.


3

There seems to be no known software product implementing the idea yet - possibly the idea is not viable in the end. To find it out, I started a project on github to develop said 286 emulator. There is nothing interesting to see yet, though. The idea of this answer is to provide a link to my GitHub project. If that project yields anything useful, I will edit ...


2

Is 1949 early enough? The Manchester Mark 1 had 20-bit wide instructions which were conventionally written as four 5-bit characters using a variation on teleprinter code which Alan Turing adapted for the purpose by replacing control codes with printable characters so that all instructions and data could be written as text. One might suggest this is cheating ...


2

The first example of an ASCII executable you saw is in the Google Usenet archive here


2

AAM is needed because the result of multiplying two unpacked BCD is a 'strange' value that needs to be 'normalized' again. The whole mechanic of using the binary multiply with BCD only woks with 'unpacked' values. Using two packed BCD values will return a result that can't be decoded as easy. To allow multiplication with packed BCD would have required the ...


2

8-bit POV: A bad design is GEOS which uses a fixed jump table. Therefore C64 and Apple II cannot share the same executable. A software interrupt is more flexible. For a better solution see https://retrocomputing.stackexchange.com/a/12296


1

Depends on what your code is doing. The amount of code (in bytes) needed to do heavy duty numerics (linear equation solvers, FFTs, etc.) would need to be much larger on a 6502 or 8080 than on an 8086+8087, or even a modern 64-bit ARM, due to more types of instructions and a larger register set.


1

The 8086 was 16-bit processor, and thus could only access 64K of RAM. IIRC, the 8086 had 20 memory address lines, so it could address up to 1M of RAM. In order to directly address this memory, they would have needed at least 1 20-bit register. I'm assuming that was too expensive or difficult to fit into their architecture, so they decided to use the ...


1

This certainly seems to be possible on the 6502. While several seemingly crucial instructions (like STA, STX and STY) exist only with the 8th bit set, it's still possible to construct arbitrary bytes in RAM using SEC with the read-modify-write forms of ROL, ROR and/or LSR, provided the RAM addresses are printable ASCII. The full set of ADC/EOR/AND opcodes ...


Only top voted, non community-wiki answers of a minimum length are eligible