Board index » delphi » Registers in TP
UCF15
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
|
UCF15
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Registers in TPCould someone explain how the registers AX, BX, and DX I have a module that has a read register and write register Any help would be greatly appreciated. Regards, Jeff |
Osmo Ronkan
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:Registers in TPIn article <1998060311423101.HAA20...@ladder03.news.aol.com>, QuoteUCF1566 <ucf1...@aol.com> wrote: 8 more or less general purpose 16-bit registers: AX BX CX DX SI DI BP SP. If you do not know about what registers are then why do you need to read or write them? Quote
about etc etc etc etc. Your question is simply way too ambiguous. Osmo |
Frank Peel
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:Registers in TPQuoteUCF1566 wrote in message Quote> [snip question about writing CPU registers to port. Or something.] I think you are suffering from some confusion here. The AX, BX etc. FP |
Ing. Franz Glase
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:Registers in TPQuoteUCF1566 wrote: port addresses also as "registers". This is correct for people who think in hardware terms. Several I/O related chips have a couple of registers which can be read and written with I/O commands. Some chips have one address to select the "register number" and another port to read or write into the addressed "register". This must not be confused with CPU registers AL,AH,BL,BH etc. Reading an I/O port Writing an I/O port It is very unusual to write words to I/O ports, since the Franz Glaser |
Daylieen Theyala
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:Registers in TPNot having spent much time studying the actual schematics of a PC I can't What are they ? variables they can hold bytes and words and segments(seemingly) Why use them? Speed. How can I use them ? You can get at them from Pascal but it is simply Where do I use them? Well, anytime you uses assembler I suppose but -- Osmo Ronkanen <ronka...@cc.helsinki.fi> wrote in article Quote> In article <1998060311423101.HAA20...@ladder03.news.aol.com>, |
Osmo Ronkan
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:Registers in TPIn article <01bd55f6$063fc440$0100007f@daylieen>, QuoteDaylieen Theyalas <l...@coventry.ac.uk> wrote: Quote
Quote
Sure one can choose between storing much of the information in registers and choosing to store all in memory and using registers only as temporary storage. In High level languages the above choice is made by the person who Here is an example. Lets have same code in Pascal and C and the compare function pow(x:integer;y:word):integer; begin int pow(int x,unsigned int y) s=1; Quote} { printf("%d\n",pow(2,10)); Quote} PROGRAM.POW: begin cs:001C FF46FC inc word ptr [bp-04] Note how every variable is in the memory and there are 4 memory loads Now compare this to the code that TC++ 3.0 produces: _pow: int pow(int x,unsigned int y) cs:02A4 8BC7 mov ax,di Notice how not only are the variables i and s in registers (SI and DI Note that TC is not among the best code generators when one considers C The bonus with the TP approach is that when you write assembler routines Quote
There is no reason explicit use registers in HLL unless one wants var rg:registers; fillchar(rg,sizeof(rg),0); {make sure all unneeded registers are zeroes } Osmo |
Ken Fisch
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:Registers in TPQuoteOsmo Ronkanen (ronka...@cc.helsinki.fi) wrote: : >What are they ? : > : >variables they can hold bytes and words and segments(seemingly) : : Yes, one can consider them variables that are inside the CPU. The idea that CPU registers can hold "segments" : >Why use them? The rest of your presentation, with examples, Regards, Ken Fischer --- |
Osmo Ronkan
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:Registers in TPQuoteIn article <EutDFI....@iglou.com>, Ken Fischer <kefis...@iglou.com> wrote: Quote> This would be true if each instruction used slower as they take longer to fetch. Of course newer processors are fast at fetching so that is not a problem but with something like 8088 the fetching time was what dominated and it is not mentioned in the execution times that you read at books. Using memory is also slower as one has to put more instructions and Osmo |
2. TP procedures preserve registers ?
3. Differences between TP 6.00 & TP 6.01
4. Question: Backward compatibility TP 7.0 & TP 6.0
5. Help: adapting graphics from TP DOS to TP Windows
7. Porting from TP for DOS 5.0 to TP for windows 1.5
8. Q: Incompatibilities between TP 6.0 and TP 7.0