how to access some bytes in bank 2/3 ?

General discussion on mikroPascal.
Post Reply
Author
Message
yo2lio
Posts: 1878
Joined: 19 Sep 2006 12:57
Location: Romania, Arad City
Contact:

#2 Post by yo2lio » 30 Jun 2008 12:15

HI,

It's easy ... Use INDIRECT ADDRESSING !

IRP bit from STATUS register must be 0 for BANK 0/1 and 1 for BANK 2/3

Code: Select all

function ReadBank23(data_addr : byte) : byte;
begin
  STATUS.7 := 1;
  FSR := data_addr;
  result := INDF;
  STATUS.7 := 0;
end;

procedure WriteBank23(data_addr,value : byte);
begin
  STATUS.7 := 1;
  FSR := data_addr;
  INDF := value;
  STATUS.7 := 0;
end;
Last edited by yo2lio on 30 Jun 2008 12:55, edited 1 time in total.
Best regards, Florin Andrei Medrea.

http://www.microelemente.ro/
http://www.microelemente.ro/produse-si-servicii/
http://www.microelemente.ro/custom-software/

mail : florin@microelemente.ro

BaCaRdi
Posts: 236
Joined: 21 Feb 2008 02:19

#3 Post by BaCaRdi » 30 Jun 2008 12:41

You Rock Florin!

Thanks again.

-Marc
[size=109][color=Red][b]Error[/b]: {Panic!} when trying to load: [reality shell]. kernel: "universe has been halted"...[/color][/size]
[url=http://www.bacardiware.com]Information Underground[/url]

AlbrechtMe
Posts: 20
Joined: 03 Feb 2008 21:34
Location: Kiel, germany

how to access some bytes in bank 2/3 ?

#4 Post by AlbrechtMe » 30 Jun 2008 20:57

Whow! Well done. It works (of course...).

Thanks to Florin!

Post Reply

Return to “mikroPascal General”