CPCWiki forum

General Category => Programming => Topic started by: AMSDOS on 07:47, 11 December 10

Title: Firmware Indirections
Post by: AMSDOS on 07:47, 11 December 10
On Page 75 of the PDF form of the Firmware guide, I'm confused as to why there is an alternative set of Firmware Instructions which seemly appear to do what other Firmware instructions would be doing.

For example there's GRA PLOT (&BDDC) & GRA LINE (&BDE2) both of which appear to do the same job as GRA PLOT ABSOLUTE (&BBEA) & GRA LINE ABSOLUTE (&BBF6), I just don't understand what that means and the Firmware Guide clearly doesn't define what the Advantages/Disadvantages would be.
Title: Re: Firmware Indirections
Post by: arnoldemu on 11:34, 11 December 10
Quote from: CP/M User on 07:47, 11 December 10
On Page 75 of the PDF form of the Firmware guide, I'm confused as to why there is an alternative set of Firmware Instructions which seemly appear to do what other Firmware instructions would be doing.

For example there's GRA PLOT (&BDDC) & GRA LINE (&BDE2) both of which appear to do the same job as GRA PLOT ABSOLUTE (&BBEA) & GRA LINE ABSOLUTE (&BBF6), I just don't understand what that means and the Firmware Guide clearly doesn't define what the Advantages/Disadvantages would be.
The firmware functions call the indirection functions. And you can patch the indirections so that you can change how the firmware works.
Think of the gra plot absolute and gra line absolute as the high level functions, and then gra plot and gra line as the low level ones.
GRA PLOT ABSOLUTE calls GRA PLOT inside.
If you want low level control over the firmware, patch the indirections. This is exactly what I have done for the text printing code (6x8 char font).
I also found that if I patched the cursor indirections then I can draw the cursor in the correct place with the correct size.

So this is what they are for.
Title: Re: Firmware Indirections
Post by: AMSDOS on 22:25, 11 December 10
arnoldemu wrote:

The firmware functions call the indirection functions. And you can patch the indirections so that you can change how the firmware works.
Think of the gra plot absolute and gra line absolute as the high level functions, and then gra plot and gra line as the low level ones.
GRA PLOT ABSOLUTE calls GRA PLOT inside.
If you want low level control over the firmware, patch the indirections. This is exactly what I have done for the text printing code (6x8 char font).
I also found that if I patched the cursor indirections then I can draw the cursor in the correct place with the correct size.

So this is what they are for.


Just seems bizarre. I guess it's like the High Level Functions are there in case something goes wrong your computer merely resets, misuse the Low Level Functions and your computer blows up or something to that extent!  ???  Don't recall AA ever covering anything like this in Assembly tutorials (which makes it seem like their use at your own risk kind of Functions), I noticed you used an alternative Indirection which Prints to screen, though knew there was another alternative printing to screen instruction (besides &BB5A - TXT OUTPUT) in the form of &BB5D - TXT WR CHAR. An article from AA and the Firmware Guide confirms how &BB5A can be used when you want to Preserve the Registers and &BB5D does the opposite.

I would presume that because the Firmware Indirections are at Low Level, things like the Enter Firmware (&BE9B) from CP/M won't work because it's only meant to be used on the High Level Functions?
Powered by SMFPacks Menu Editor Mod